Answer» Hey,
IVE created a C++ program that takes a string and searches a .txt file and opens its location. i have also created a key in the registry which allows me to open 'run' and type folder and it will execute my program, the same way iexplore, OUTLOOK and winword works. this is in location
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\folder.exe
The above work fine but i would like to input using the run command as well i.e
folder food
which im hoping will open folder.exe and input and execute string food the same way that when you type iexplore test search it opens the internet and searches 'test search'
im thinking i either need to add another REG key or change my program to sniff input when call both of which i have no clue how to do so any help would be greatly appreciated.
Thanks in advance, KhasIf your program is located in your system folder or in your PATH variable, then you should be able to type "folder whatever" and the parameters will be successfully passed to the program. I don't get why you're changing registry values. You shouldn't have to do that.I didnt know you COULD just save it in the system folder that saves time... But passing the parameters not working. do i need to change my code to accept it ie
int main (string ¶meter){
}//main
??
C++ main routine has to be
Code: [Select]int main(int argc, char *argv[]) to accept commandline arguments. How are you doing it now? You can also use the WIN32 API GetCommandLine() function but it's rather SILLY to include windows.h for something you can get for free.
Thanks BC this has worked!
|