Quantcast
Viewing all articles
Browse latest Browse all 1449

VB6 ShownInTaskBar,Show Form ICO IN taskbar or hide

Code:

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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Const GWL_EXSTYLE = (-20)

Public OLD As Long
Public Const WS_EX_APPWINDOW = &H40000
Const SW_HIDE = 1&
Const SW_SHOW = 5&

Sub ShownInTaskBar(ByVal hWnd As Long, bShow As Boolean)
'Force display, hide icon in taskbar
'?????????????

  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

when form1:
form2.show 1,me

in form2:ShownInTaskBar(me.hwnd,true)

Viewing all articles
Browse latest Browse all 1449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>