hi,

i can get notepad to show the "open" dialog by getting its hwnd with FindWindow and then

SendMessage hwnd,273,2,0


where 2 is the ID of the 'open' option on the popup menu..
im trying to do the same with mspaint, the relevant ID is E101h (57601) but it doesn't work, any ideas why? i was able to find the window correctly, so that isn't the problem..
Posted on 2004-10-03 02:11:52 by zerog
There is a great tool to examine other people's executeables, especially the resource parts of this....Resource Hacker
Just google and you will find....it can also show you the menu items

I tried the same and it worked fine...
invoke SendMessage, pwnd, 273d, 57601d, 0h

Make sure that you really find the window handle (pwnd in my line)...

Dominik
Posted on 2004-10-03 05:47:36 by Dom
hi,

thanks, but i already have that..

and you're right it works fine, i just didnt give paint enough time to load before sending the message.
Posted on 2004-10-03 08:50:33 by zerog
i always use this, to wait for other application to start.

platform SDK:

WaitForInputIdle

The WaitForInputIdle function waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed.


DWORD WaitForInputIdle(
HANDLE hProcess,
DWORD dwMilliseconds
);
Posted on 2004-10-05 21:58:24 by ti_mo_n
hi,

i can get notepad to show the "open" dialog by getting its hwnd with FindWindow and then

SendMessage hwnd,273,2,0


where 2 is the ID of the 'open' option on the popup menu..
im trying to do the same with mspaint, the relevant ID is E101h (57601) but it doesn't work, any ideas why? i was able to find the window correctly, so that isn't the problem..

Is that the menu item ID? If so, your code should work... maybe the problem is somewhere else? I don't think ms paint cares to check where messages come from... :?:
Posted on 2004-10-06 13:43:27 by QvasiModo