|
-
Sep 12th, 2010, 07:06 PM
#1
Thread Starter
Addicted Member
[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
Last edited by *PsyKE1*; Sep 12th, 2010 at 08:06 PM.
-
Sep 12th, 2010, 07:43 PM
#2
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:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_SHOW = 5
Private Const SW_HIDE = 0
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_APPWINDOW = &H40000
Public Sub ShownInTaskBar(ByVal hwnd As Long, Optional bShow As Boolean = True)
Dim lExStyles As Long
lExStyles = GetWindowLong(hwnd, GWL_EXSTYLE)
If bShow Xor (lExStyles And WS_EX_APPWINDOW) = 0 Then Exit Sub
ShowWindow hwnd, SW_HIDE
SetWindowLong hwnd, GWL_EXSTYLE, lExStyles Xor WS_EX_APPWINDOW
ShowWindow hwnd, SW_SHOW
End Sub
Private Sub Command1_Click()
ShownInTaskBar Me.hwnd, False
End Sub
Last edited by Chris001; Sep 12th, 2010 at 07:53 PM.
-
Sep 12th, 2010, 08:07 PM
#3
Thread Starter
Addicted Member
Re: TaskVisible = False [HELP]
Thanks, but i put this and it doesnt works...
vb Code:
Form1.ShowInTaskbar = False
I have been searching...
Thanks...
-
Sep 12th, 2010, 08:18 PM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|