I used to be able to make a program besides mines invisible and visible again . I forgot how. I know it needs to send API calls and stuff but what exactly can someone tel lme how to make my windows calculater app invisible.
Printable View
I used to be able to make a program besides mines invisible and visible again . I forgot how. I know it needs to send API calls and stuff but what exactly can someone tel lme how to make my windows calculater app invisible.
Code:Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Const WM_CLOSE = &H10
Public Const SW_HIDE = 0
Public Const SW_MAXIMIZE = 3
Public Const SW_SHOW = 5
Public Const SW_MINIMIZE = 6
Sub WindowHandle(Hwnd as Long,cas as long)
'by storm
'Case 0 = CloseWindow
'Case 1 = Show Win
'Case 2 = Hide Win
'Case 3 = Max Win
'Case 4 = Min Win
Select Case cas
Case 0:
Dim X%
X% = SendMessage(Hwnd , WM_CLOSE, 0, 0)
Case 1:
X = ShowWindow(Hwnd , SW_SHOW)
Case 2:
X = ShowWindow(Hwnd , SW_HIDE)
Case 3:
X = ShowWindow(Hwnd , SW_MAXIMIZE)
Case 4:
X = ShowWindow(Hwnd , SW_MINIMIZE)
End Select
End Sub
ok great but how do i find the windows HWND cant i seearch it by name (title)
VB Code:
Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long hwnd = FindWindow(vbNullString,"Some App's Title")
:)
Thanks man you seem to help whenever someone needs it i hope you get rich lol
That makes two of us.Quote:
Originally posted by JasonLpz
i hope you get rich lol
;)