CSDN博客

img yinweihong

ShowInTaskbar

发表于2004/9/26 17:40:00  907人阅读

Public Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex 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 ShowWindow Lib "user32" (ByVal hwnd _
As Long, ByVal nCmdShow As Long) As Long
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Public Const GWL_EXSTYLE = -20
Public Const WS_EX_TOOLWINDOW = 1
Public M_Num As Long
Public Sub setShowInTaskbar(Visible As Boolean, hwnd As Long)
    Dim L As Long
    L = ShowWindow(hwnd, SW_HIDE)
    DoEvents
    L = SetWindowLong(hwnd, GWL_EXSTYLE, IIf(Visible, M_Num, 1))
    DoEvents
    L = ShowWindow(hwnd, SW_SHOW)
End Sub
Private Sub Command1_Click()
Call setShowInTaskbar(False, Me.hwnd)
End Sub
Private Sub Command2_Click()
Call setShowInTaskbar(True, Me.hwnd)
End Sub
Private Sub Form_Load()
M_Num = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
End Sub

阅读全文
0 0

相关文章推荐

img
取 消
img