[2.0] Replace run menu with my program (global hooking??)
I have created a replacement to the start->run dialog. I want to have it run instead of the regular run program whenever the user clicks the run menu or uses the key combination Windows + 'R'.
I've got no clue how i'm supposed to go about this, any help would be greatly appreciated.
Re: [2.0] Replace run menu with my program (global hooking??)
I guess it's undoable (new word)
But you might want to post this qestion in the Application Deployment forum
Re: [2.0] Replace run menu with my program (global hooking??)
Hmm, sounds like i'm gonna have to do it the cheeky way. At the moment i've got a thread in a loop which looks for the 'run' window (it sleeps for a while in the loop of course!). If it finds it then it shows my main window and closes the run dialog. This isn't perfect since you still get the regular run menu flashing up, but i guess it'll have to do.
Re: [2.0] Replace run menu with my program (global hooking??)
I'm not sure, but there might be other ways to do it...
I mean, doesn't Windows fire an event when it opens a new dialog?
Re: [2.0] Replace run menu with my program (global hooking??)
It might be possible to use SetWindowHookEx to hook the WindowProc of the Start Menu, but don't have much experience using that particular API. You'll need to place your hook function in a (probably unmanaged -- c/c++) DLL and call SetWindowHookEx with WH_CALLWNDPROC and the handle to your DLL and a pointer to the function.
Sorry I can't be of more help!
Re: [2.0] Replace run menu with my program (global hooking??)
Thanks for the help. I've not worked with hooking DLL's before; it looks a bit over my head. The method i'm using now isn't too bad!