Form without border, How to have the icon and the context menu in the taskbar ?
I'm using a form with no borders in order to do some skinning. The fact is that only the form.text appears in the taskbar,
Do you know how to make the icon and the contextmenu to appear ?
In VB6, I used to do that with the following code.
Code:
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, ByVal bShow As Long) As Long
Public Const GWL_STYLE = (-16)
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Public Const WS_SYSMENU = &H80000
Public Sub RemoveTitleBar(hwnd As Long)
Dim lStyle As Long
Dim MyStyle As Long
lStyle = GetWindowLong(hwnd, GWL_STYLE)
MyStyle = lStyle And WS_SYSMENU
ShowWindow hwnd, SW_HIDE
SetWindowLong hwnd, GWL_STYLE, MyStyle
ShowWindow hwnd, SW_SHOW
DrawMenuBar hwnd
End Sub
It doesn't seem to work anymore in VB.NET 2003.
I search the forum and i only found people who
didn't want to use no border form to do some skinning
and who are still searching how to do this without using
some ActiveX.
Thank you