Posted on 2002-07-12
I am trying to make a usercontrol that will go on the desktop, via the "SetParent" API call.
However, there is one minor problem. Here is the slimmed down code:
(project with a usercontrol)
In the usercontrol there is this:
Private Declare Function WindowFromDC Lib "user32" (ByVal hdc As Long) As Long
Public Function hWnd() as long
hWnd = WindowFromDC usercontrol.hDC
Now, in a form with UserControl1 (and a command button), there is this:
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Command1_Click()
SetParent UserControl1.hWnd, GetDesktopWindow
This works fine, UserControl1 goes onto the desktop. However, it adds a button to the taskbar. How can I stop it from putting this button there?