Results 1 to 4 of 4

Thread: [RESOLVED] TaskVisible = False [HELP]

  1. #1

    Thread Starter
    Addicted Member *PsyKE1*'s Avatar
    Join Date
    Jun 2010
    Location
    Spain
    Posts
    243

    Resolved [RESOLVED] TaskVisible = False [HELP]

    How I can do from my Form code to not appear in the TaskBar?
    Code:
    Form1.ShowInTaskbar = False
    This runtime does not work ...
    SetWindowLong ()?

    Thanks

  2. #2
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: TaskVisible = False [HELP]

    Set the ShowInTaskbar property to False. You can only do this in design time as far as I know.

    If you want to do it during run time, then you can use this.

    vb Code:
    1. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    3. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    4.  
    5. Private Const SW_SHOW = 5
    6. Private Const SW_HIDE = 0
    7. Private Const GWL_EXSTYLE = (-20)
    8. Private Const WS_EX_APPWINDOW = &H40000
    9.  
    10. Public Sub ShownInTaskBar(ByVal hwnd As Long, Optional bShow As Boolean = True)
    11.     Dim lExStyles As Long
    12.  
    13.     lExStyles = GetWindowLong(hwnd, GWL_EXSTYLE)
    14.  
    15.     If bShow Xor (lExStyles And WS_EX_APPWINDOW) = 0 Then Exit Sub
    16.  
    17.     ShowWindow hwnd, SW_HIDE
    18.     SetWindowLong hwnd, GWL_EXSTYLE, lExStyles Xor WS_EX_APPWINDOW
    19.     ShowWindow hwnd, SW_SHOW
    20. End Sub
    21.  
    22. Private Sub Command1_Click()
    23.     ShownInTaskBar Me.hwnd, False
    24. End Sub
    Last edited by Chris001; Sep 12th, 2010 at 07:53 PM.

  3. #3

    Thread Starter
    Addicted Member *PsyKE1*'s Avatar
    Join Date
    Jun 2010
    Location
    Spain
    Posts
    243

    Re: TaskVisible = False [HELP]

    Thanks, but i put this and it doesnt works...
    vb Code:
    1. Form1.ShowInTaskbar = False
    I have been searching...

    Thanks...

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: TaskVisible = False [HELP]

    As Chris001 said, the ShowInTaskbar property can only be set at design time, in the Properties window for the form. In code the property is read only, you can't set it through code like that.

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