PDA

View Full Version : اشکال برنامه Hide Taskbar در کجاست؟



atlantic_nights
چهارشنبه 10 بهمن 1386, 23:48 عصر
سلام دوستان
این project برای دانلود گذاشتم دانلود کنید و لطفا راهنمایی کنید اشکال بنده در کجاست
با تشکر از همه دوستان

http://barnamenevis.org/forum/attachment.php?attachmentid=14179&stc=1&d=1201725935

Mbt925
پنج شنبه 11 بهمن 1386, 00:10 صبح
این نمونه رو ببینید:

__siavash__
پنج شنبه 11 بهمن 1386, 00:22 صبح
Private Sub Command1_Click()
Dim Thwnd As Long
Thwnd = findwindow("Shell_Traywand", "")
Call SetWindowPos(Thwnd, 0, 0, 0, 0, 0, Swp_HideWindow)
End Sub

کلاس TaskBar اشتباه وارد شده "Shell_TrayWnd"
تابع FindeWindow درست Declare نشده

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

تابع SetWindowPos درست Declare نشده !

Public Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (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


در کل کد اصلاح شده !



Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public 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 Sub Command1_Click()
Dim Thwnd As Long
Thwnd = FindWindow("Shell_TrayWnd", "")
Call SetWindowPos(Thwnd, 0, 0, 0, 0, 0, Swp_HideWindow)
End Sub
Private Sub Command2_Click()
Dim Thwnd As Long
Thwnd = FindWindow("Shell_TrayWnd", "")
Call SetWindowPos(Thwnd, 0, 0, 0, 0, 0, Swp_ShowWindow)
End Sub
Private Sub Form_Load()
Me.Caption = "Hide Taskbar"
Me.Caption = "Show Taskbar"
End Sub