News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

click on menu item of another app

Started by Jimg, September 16, 2005, 03:26:41 PM

Previous topic - Next topic

Jimg

Yes, I did, but that didn't work either.

farrier

Jimg,

That seems to indicate that you don't have the correct hWnd !!!

Spy++ may be your best bet to find and compare the real hWnd with what you are using at the time.

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

Jimg

The handle I'm finding is the same handle as Spy++,  and everything else was working, so it should have been the correct handle anyway.

Looking a little more closely, I made some assumptions I shouldn't have.  I knew that the app was iconic, I just minimized it myself.  The IsIconic api, however, returned false.  So I wasn't really executing the openicon api.  When I forced the OpenIcon call, it restored the app to normal.  The wierd thing, however, is that afterward, I could not minimize the app again, the minimize button was just ignored.  The same thing happened using showwindow.  Obviously, I'm not doing this right.  If I can't trust IsIconic, what do I use??

Jimg

After some testing, I've determined that this app is just wierd.  I tried the process on another app, and the isiconic and openicon worked properly.  For some reason, when this app is minimized, it doesn't test as minimized, and a GetWindowRect shows the same coordinates, minimized or not, where a normal app shows minimize coordinates way off the screen as expected.  Does anyone know what this effect is and how to handle it?

P1

Is it 16bit Windows 3.1 app???

Regards,  P1  :8)

Jimg


jojo

Quote from: farrier on September 18, 2005, 11:23:39 PM
SetForegroundWindow

There are some problems with SetForegroundWindow, check http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setforegroundwindow.asp

A safe way to activate a window is
inv ShowWindow, Handle, SW_HIDE ;optional, may be faster
inv ShowWindow, Handle, SW_MINIMIZE
inv ShowWindow, Handle, SW_RESTORE

Mark Jones

Also if you didn't notice this already, each "press" of the ALT key must occur twice in code - one call for down, and one call for up. That's why it "sticks."
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08