How can I use sendmessage() to force a toolwindow to hide or stay on bottom? And can I use the caption of the toolwindow to find the hwnd to use for sendmessage()?
Printable View
How can I use sendmessage() to force a toolwindow to hide or stay on bottom? And can I use the caption of the toolwindow to find the hwnd to use for sendmessage()?
What I mean is... I have a extremly annoying ad banner that is set to stay on top. I want to us sendmessage() to tell it to stay in the background or to dissappear.
You don't have to use SendMessage, but instead you can use ShowWindow. First, you need to know the window handle (hWnd) for the window you want to hide. Let's say you already have a handle for that window, then you would use something liek this:
Where lHwnd is a valid window handle.Code:Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Sub Command1_Click()
Call ShowWindow(lHwnd, SW_HIDE)
End Sub
Thanks alot. I just got it to work.