starcraft Posted July 12, 2003 Posted July 12, 2003 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? Quote
*Experts* Volte Posted July 13, 2003 *Experts* Posted July 13, 2003 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! :) Quote
starcraft Posted July 13, 2003 Author Posted July 13, 2003 '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 Quote
*Experts* Volte Posted July 13, 2003 *Experts* Posted July 13, 2003 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). Quote
starcraft Posted July 13, 2003 Author Posted July 13, 2003 wait.... i cant figure those things out... how do u use those? Quote
*Experts* mutant Posted July 15, 2003 *Experts* Posted July 15, 2003 You mean the API VolteFace gave you? Quote
starcraft Posted July 15, 2003 Author Posted July 15, 2003 yeah i dont know how to use those code strings, and that web site isn't for .net, its vb6 compiled things..... Quote
*Experts* mutant Posted July 15, 2003 *Experts* Posted July 15, 2003 Ok, the first one is: SetParent() The declaration is as follows: 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. Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Integer Put those two declarations in your form class. Then do this: 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. :) Quote
starcraft Posted July 18, 2003 Author Posted July 18, 2003 i get most of that except the last lineFirst 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? Quote
*Experts* mutant Posted July 18, 2003 *Experts* Posted July 18, 2003 Those two lines refer to the code right above them :) This is all you need to show the button on the desktop, nothing else is required. Quote
starcraft Posted July 18, 2003 Author Posted July 18, 2003 (edited) 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? Edited July 18, 2003 by starcraft Quote
starcraft Posted July 18, 2003 Author Posted July 18, 2003 how do i do that on a window? not just the desktop? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.