by R.KUMARASAMYRAJA (1 Submission)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 9th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
for hiding and showing the start button and task bar
API Declarations
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Private Const SW_HIDE = 0
Private Const SW_SHOWDEFAULT = 10
Private Const SW_NORMAL = 1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim kk As Long
Dim l As POINTAPI
Dim a As Long
Dim xx, yy As Long
Private Const WM_PAINT = &HF
Private Const SW_SHOWNORMAL = 1
Call ShowWindow(kk, SW_HIDE)
End Sub
Private Sub Command2_Click()
Call ShowWindow(kk, SW_NORMAL)
End Sub
Private Sub Command3_Click()
f = FindWindow("Shell_TrayWnd", "")
Call ShowWindow(f, SW_NORMAL)
End Sub
Private Sub Command4_Click()
f = FindWindow("Shell_TrayWnd", "")
Call ShowWindow(f, SW_HIDE)
End Sub
Private Sub Form_Load()
kk = WindowFromPoint(42, 590)
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
xx = x
yy = y
End Sub
Private Sub Timer1_Timer()
Call GetCursorPos(l)
xx = l.x
yy = l.y
a = WindowFromPoint(xx, yy)
Call SetWindowPos(1900612, 0, 0, 0, 0, 0, 5)
'Label1.Caption = CStr(l.x)
End Sub