|
-
July 1st, 2009, 02:44 AM
#1
Hooking onto a console window
In general, I'm coding an external program with Ruby and would like to issue some API commands, but I'm afraid this is where Ruby becomes limited in its ability.
I want to have the console window set to be "Always on Top" in a sense. So how would I go about hooking onto a console and bring it to the top with C++ and Window's API?
I'm running into confusion with SetWindowPos() and SetForegroundWindow()
Any help/advice is much appreciated
Thanks,
- Mac
-
July 1st, 2009, 06:04 AM
#2
Re: Hooking onto a console window
See MSDN description of SetWindowPos() function at http://msdn.microsoft.com/en-us/libr...45(VS.85).aspx , where it is said:
If an application is not in the foreground, and should be in the foreground, it must call the SetForegroundWindow function.
My understanding is that there are two z-orders: one for the display, and another one (not named "z-order" in the manuals) for the keyboard and events.
SetWindowsPos() changes the z-order for the screen.
SetForegroundWindow() changes both the z-order for the screen and for the keyboard.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|