PDA

Click to See Complete Forum and Search --> : hiding an external program


R-E-L
Aug 15th, 2001, 06:27 PM
hi,
how can i hide a window that doesnt belong to my program/project?

thanks!

nabeels786
Aug 15th, 2001, 07:14 PM
get the windows caption, or its class name (if you have Spy++, open it and get the classname)


'in module:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal _
hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Const HIDE_WINDOW = 0

'somwhere else
'if you have caption
w_handle = FindWindow(vbNullString,"Caption")

'if you have the classname
w_handle = FindWindow("ClassName",vbNullString)


PostMessage w_handle,HIDE_WINDOW,CLng(0),CLng(0)


thats it, hope that helps
-nabeel

R-E-L
Aug 16th, 2001, 07:04 AM
where can i download spy++ ??

nabeels786
Aug 16th, 2001, 10:45 AM
it comes with Visual Studio. i dont know if you can download it. if you know the programs caption you can use that too.

R-E-L
Aug 16th, 2001, 10:59 AM
the program i want to hide is borderless so i cant see the caption...
when i press ALT+CTRL+DEL i see the name of the program and when i use "findWindow" using the name of the program it says that there a window with that caption... but it doesnt hide it... :(

SubSpawn
Aug 16th, 2001, 12:57 PM
You can also use the freeware program "The Customiser", a very handy tool that can retrieve the class as well.

Email me and I'll send you the program, since it's to big to add to this post (264kb zipped)

R-E-L
Aug 16th, 2001, 01:57 PM
Please send it over to me via e-mail. flashher@isdn.net.il

Thanks!