Results 1 to 4 of 4

Thread: Form without border, How to have the icon and the context menu in the taskbar ?

  1. #1

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82

    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
    Last edited by matt3011; Jul 12th, 2003 at 04:44 AM.

  2. #2

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Anyone ?

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Ok , if this code doesn't work , then try to change Long types to Integer . Sometimes , this is the solution to incompatibility between VB6 and VB.NET .

  4. #4

    Thread Starter
    Lively Member matt3011's Avatar
    Join Date
    May 2002
    Location
    France
    Posts
    82
    Thank you, I have the icon and the menu.

    But I can't click minimize. I could do it in VB6, Any Idea ?

    Also, move doesn't work, i can click it but i can't move the form (I had the same issue with VB6), Any Idea ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width