Hi,

Am creating an application, that will dynamicly create a popup menu, based on the data in a file (application command lines) ....

The application will allow people to quickly run an application, they use allot. Now, the problem is, I can create the menus, with thier IDs, but how can I go about knowing what program to run based on the selected, dynamicly created menu items ?!?!

For example, what if the user selects the second menu option, how can I tell what app the run ... Should I store each app in an array of strings ? Should read the files again ?

I hope I've explianed this enough (I probabaly haven't !!) ...

Thanks for any help ...
Posted on 2002-09-11 06:06:48 by Dracton
I don't quite understand the problem... What kind of file are you talking about.

Why don't you store the filenames in an ini file or in the registry ?

Say user wants these apps (parameters are just made up):

C:\Windows\Notepad.exe /b /n
C:\Windows\Defrag.exe /r

An ini file might look like this


Notepad=C:\Windows\Notepad.exe /b /n
Defrag=C:\Windows\Defrag.exe /r

where you may use the exe name ase the ini key and the menu name at the same time.
If you have unknown files:


File1=C:\Windows\Notepad.exe /b /n
File2=C:\Windows\Defrag.exe /r

Menu:
File <- main menu
Notepad < sub menu
Defrag <- sub menu
Posted on 2002-09-11 09:08:16 by goofee
WOOOOO ...

Thank you !! Now why didn't I think of that :) Problem solved, cheers mate ;)
Posted on 2002-09-12 07:08:03 by Dracton