Showintaskbar

xiaoxiao2021-03-06  58

Public Declare Function GetWindowLong Lib "user32" Alias ​​_ "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As LongPublic Declare Function SetWindowLong Lib "user32" Alias ​​_ "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _ByVal dwNewLong As Long) As LongPublic Declare Function ShowWindow Lib "user32" (ByVal hwnd _As Long, ByVal nCmdShow As Long) As LongPublic Const SW_HIDE = 0Public Const SW_SHOW = 5Public Const GWL_EXSTYLE = -20Public Const WS_EX_TOOLWINDOW = 1Public M_Num As LongPublic 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 SubPrivate Sub Command1_Click () Call setShowInTaskbar (False, Me.hwnd) End SubPrivate Sub Command2_Click () Call setShowInTaskbar (True, Me.hwnd) End SubPrivate Sub Form_Load () M_Num = GetWindowLong (Me.hwnd, GWL_EXSTYLE) End Sub

转载请注明原文地址:https://www.9cbs.com/read-112905.html

New Post(0)