'ضع هذا الكود في المودل
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
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
'ضع هذا الكود في الفورم
'نحتاج زرين واحد للاخفاء والاخر للاظهار
Private Sub Command1_Click()
Dim Task As Long
Task = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Task, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
End Sub
Private Sub Command2_Click()
Dim Task As Long
Task = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Task, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
End Sub
'تحذير تأكد من اظهار شريط المهام قبل اغلاق البرنامج