overlapping

starcraft

Centurion
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
how do i make a program that will know what program is running and will 'splash' buttons onto the screen. And also have hotkey respond? plus is there a way for vb to send commands to a program like, sendkeys.sendwait("") to a programt hats not maximized?
 
Could you explain in detail what precisely you mean by "splash buttons onto the screen" an "have hotkey respond"?

As for your second question, you will need to use [api]SetForegroundWindow[/api] and possibly [api]SetFocus[/api] APIs to focus the window before SendKeys'ing to it; there's no way to send commands to a program regardless of focus state. SendKeys simply blindly emulates you typing on the keyboard in hopes that the correct window is focused.



800th post! :)
 
'splash buttons' make buttons at liek 300, 650 without a window
'hotkey respond' like have the program in the background, but when say when "f12" is pressed it will do something
 
Well, there is no built in .NET way that I know of to use global hotkeys, so you'll need Windows hooks for that; I not only don't know much about windows hooks, global keyhooks are an easily misused item, and so you probably won't find much help here (forum policy).

To make a button "float", you can use the [api]SetParent[/api]() API to set the button's parent window to that of the desktop (you can get this with the [api]GetDesktopWindow[/api]() API).
 
Ok, the first one is: SetParent()
The declaration is as follows:
Visual Basic:
Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer
This will set the parent of your control.

The one GetDesktopWindow() will get the handle to the desktop window which you need to set the desktop as the parent of the control.
Visual Basic:
Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Integer

Put those two declarations in your form class.
Then do this:
Visual Basic:
Dim DesktopHanlde As Integer = GetDesktopWindow()
SetParent(Button1.Handle.ToInt32, DesktopHandle)
First declare a variable that will store the handle of the desktop
and then SetParent using the Button1 handle and then DesktopHandle you just got.

:)
 
i get most of that except the last line
First declare a variable that will store the handle of the desktop
and then SetParent using the Button1 handle and then DesktopHandle you just got.
how do i do that?
and also once i got that how do i make the text/button appear on the screen?
 
thanks i figured it out just a while ago, buttttttt, there is still a window.... how do i have no window?and the objects that i 'splash' on the screen apprear as sepparet windows down on the taskbar. Is there any way to remove those without removing the objects?
 
Last edited:
Back
Top