m0she
10-18-2007, 08:09 AM
first decklere
so copy this to your decklere place
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
and copy this too to the decklere place
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
and copy this too to the same place :
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Const vbClass = "wndclass_desked_gsk"
then go to tool box and made a command botton and a text box
then copy this code to the command botton:
Static HideShow As Boolean
wHideShow HideShow
If HideShow Then
HideShow = False
Else: HideShow = True
End If
next:then copy this to your form:
Private Sub wHideShow(HideShow As Boolean)
Dim hwnd As Long
If Text1.Text = "" Then
MsgBox "FIRSR WIRTE DOWN THE PROGRAM NAME", vbOKOnly + vbInformation, "HIDE/SHOW WINDDOW"
Exit Sub
End If
hwnd = FindWindow(vbNullString, Text1.Text)
If hwnd = 0 Then
MsgBox ".NOT FIND WINNOW", vbInformation + vbOKOnly, "hide/show WINDDOW"
Exit Sub
End If
If HideShow Then
ShowWindow hwnd, SW_SHOW
Command1.Caption = "hide"
Else
ShowWindow hwnd, SW_HIDE
Command1.Caption = "show"
End If
End Sub
so it all shold look like this :
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Const vbClass = "wndclass_desked_gsk"
Private Sub Command1_Click()
Static HideShow As Boolean
wHideShow HideShow
If HideShow Then
HideShow = False
Else: HideShow = True
End If
End Sub
Private Sub wHideShow(HideShow As Boolean)
Dim hwnd As Long
If Text1.Text = "" Then
MsgBox "FIRSR WIRTE DOWN THE PROGRAM NAME", vbOKOnly + vbInformation, "HIDE/SHOW WINDDOW"
Exit Sub
End If
hwnd = FindWindow(vbNullString, Text1.Text)
If hwnd = 0 Then
MsgBox ".NOT FIND WINNOW", vbInformation + vbOKOnly, "HIDE/SHOW WINDDOW"
Exit Sub
End If
If HideShow Then
ShowWindow hwnd, SW_SHOW
Command1.Caption = "HIDE"
Else
ShowWindow hwnd, SW_HIDE
Command1.Caption = "SHOW"
End If
End Sub
now you made a program that can hide other program all you shokd do is to write down the name of the program that you want to hide in the text box and then just push hide bottom and walla your program is hide to show the program just push the batton again and it will show you the program
made by mosheeee
so copy this to your decklere place
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
and copy this too to the decklere place
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
and copy this too to the same place :
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Const vbClass = "wndclass_desked_gsk"
then go to tool box and made a command botton and a text box
then copy this code to the command botton:
Static HideShow As Boolean
wHideShow HideShow
If HideShow Then
HideShow = False
Else: HideShow = True
End If
next:then copy this to your form:
Private Sub wHideShow(HideShow As Boolean)
Dim hwnd As Long
If Text1.Text = "" Then
MsgBox "FIRSR WIRTE DOWN THE PROGRAM NAME", vbOKOnly + vbInformation, "HIDE/SHOW WINDDOW"
Exit Sub
End If
hwnd = FindWindow(vbNullString, Text1.Text)
If hwnd = 0 Then
MsgBox ".NOT FIND WINNOW", vbInformation + vbOKOnly, "hide/show WINDDOW"
Exit Sub
End If
If HideShow Then
ShowWindow hwnd, SW_SHOW
Command1.Caption = "hide"
Else
ShowWindow hwnd, SW_HIDE
Command1.Caption = "show"
End If
End Sub
so it all shold look like this :
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_SHOW = 5
Private Const vbClass = "wndclass_desked_gsk"
Private Sub Command1_Click()
Static HideShow As Boolean
wHideShow HideShow
If HideShow Then
HideShow = False
Else: HideShow = True
End If
End Sub
Private Sub wHideShow(HideShow As Boolean)
Dim hwnd As Long
If Text1.Text = "" Then
MsgBox "FIRSR WIRTE DOWN THE PROGRAM NAME", vbOKOnly + vbInformation, "HIDE/SHOW WINDDOW"
Exit Sub
End If
hwnd = FindWindow(vbNullString, Text1.Text)
If hwnd = 0 Then
MsgBox ".NOT FIND WINNOW", vbInformation + vbOKOnly, "HIDE/SHOW WINDDOW"
Exit Sub
End If
If HideShow Then
ShowWindow hwnd, SW_SHOW
Command1.Caption = "HIDE"
Else
ShowWindow hwnd, SW_HIDE
Command1.Caption = "SHOW"
End If
End Sub
now you made a program that can hide other program all you shokd do is to write down the name of the program that you want to hide in the text box and then just push hide bottom and walla your program is hide to show the program just push the batton again and it will show you the program
made by mosheeee