Hide external window
-
UserOfPure
- Enthusiast

- Posts: 469
- Joined: Sun Mar 16, 2008 9:18 am
Re: Hide external window
He said "like Notepad" which means "for example, Notepad" in English. So yes, he was referring to Notepad directly. As for the code, Fluid Byte's example using the Calculator's exact window caption will work. Fluid Byte used the class name instead (class is the first param, title is the second param) so something like FindWindow_(0,"Calculator") will do it.
Re: Hide external window
OK run FindWindow_(0,"Notepad")
And tell me if it work or not
FindWindow_() it is not a reliable func
See Running one instance thread
And tell me if it work or not
FindWindow_() it is not a reliable func
See Running one instance thread
Egypt my love
Re: Hide external window
yes this is just example.RASHAD wrote:OK I am using Windows 7 x64
Please put some code using FindWindow_() to hide Calculator prog
mx101 did not say Notepad he said like NotePad so the choices are open
Please check
i need to hide a window that i call from another program is a console program.
thanks to all
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: Hide external window
RASHAD wrote:OK I am using Windows 7 x64
Please put some code using FindWindow_() to hide Calculator prog
Code: Select all
RunProgram("calc")
Delay(500)
hwndNotepad = FindWindow_("CalcFrame",0)
Delay(500)
ShowWindow_(hwndNotepad,#SW_HIDE)NonsenseRASHAD wrote:FindWindow_() it is not a reliable func
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: Hide external window
MSDN
http://msdn.microsoft.com/en-us/librar ... .85).aspx
Remarks
If the lpWindowName parameter is not NULL, FindWindow calls the GetWindowText function to retrieve the window name for comparison. For a description of a potential problem that can arise, see the Remarks for GetWindowText.
For a description of a potential problem that can arise, see the Remarks for GetWindowText.
GetWindowText
http://msdn.microsoft.com/en-us/librar ... .85).aspx
Remarks
If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control. If the target window is owned by another process and has a caption, GetWindowText retrieves the window caption text. If the window does not have a caption, the return value is a null string. This behavior is by design. It allows applications to call GetWindowText without becoming unresponsive if the process that owns the target window is not responding. However, if the target window is not responding and it belongs to the calling application, GetWindowText will cause the calling application to become unresponsive.
To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
Depending on the Caption Text is the Nonsense and nothing else
http://msdn.microsoft.com/en-us/librar ... .85).aspx
Remarks
If the lpWindowName parameter is not NULL, FindWindow calls the GetWindowText function to retrieve the window name for comparison. For a description of a potential problem that can arise, see the Remarks for GetWindowText.
For a description of a potential problem that can arise, see the Remarks for GetWindowText.
GetWindowText
http://msdn.microsoft.com/en-us/librar ... .85).aspx
Remarks
If the target window is owned by the current process, GetWindowText causes a WM_GETTEXT message to be sent to the specified window or control. If the target window is owned by another process and has a caption, GetWindowText retrieves the window caption text. If the window does not have a caption, the return value is a null string. This behavior is by design. It allows applications to call GetWindowText without becoming unresponsive if the process that owns the target window is not responding. However, if the target window is not responding and it belongs to the calling application, GetWindowText will cause the calling application to become unresponsive.
To retrieve the text of a control in another process, send a WM_GETTEXT message directly instead of calling GetWindowText.
Depending on the Caption Text is the Nonsense and nothing else
Egypt my love
- Fluid Byte
- Addict

- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: Hide external window
You first posted a totally overkill solution for a pretty simple problem. I proved how to solve it easier. You also said it doesn't work with calc.exe on Windows 7, again I proved the opposite. Last but not least you say FindWindow_() is unreliable and post some irrelevant info from MSDN. Again you are missing the point since you continue to ignore the fact we are talking about the CLASSNAME, not the WINDOWTITLE.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: Hide external window
I only have the prog. name for examole calc.exe
The Caption text will not be OK all times
And I do't want to hack the prog to get the ClassName 'Calcframe' for example
Your solutins are specific for special case And you do't like MSDN saying
So I will not argue with you anymore.
Chao
The Caption text will not be OK all times
And I do't want to hack the prog to get the ClassName 'Calcframe' for example
Your solutins are specific for special case And you do't like MSDN saying
So I will not argue with you anymore.
Chao
Egypt my love
Re: Hide external window
RASHAD wrote:And I do't want to hack the prog to get the ClassName 'Calcframe' for example
Code: Select all
Define ClassName.s{#MAX_PATH}
RunProgram("calc")
Delay(1000)
GetClassName_(GetForegroundWindow_(), @ClassName, #MAX_PATH)
Debug ClassNameRe: Hide external window
@Thomas
You are using PureBasic to run the external prog (Not always will happen)
you assumed that the prog is focused (GetForegroundWindow_()) (Not always will happen)
If you will try to make a perfect code using that tech. you will come to a complicated one
No special case please
Have a good day
You are using PureBasic to run the external prog (Not always will happen)
you assumed that the prog is focused (GetForegroundWindow_()) (Not always will happen)
If you will try to make a perfect code using that tech. you will come to a complicated one
No special case please
Have a good day
Egypt my love
- Rook Zimbabwe
- Addict

- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
Re: Hide external window
Yeah or the AV or Malware scanners... THAT would be a different way of hooking it though...Fluid Byte wrote:Be happy it's just Notepad and not some system critical application
Good thing we aren't helping with that!
-
SeregaZ
- Enthusiast

- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: Hide external window
why RunProgram with #PB_Program_Hide dont work?
run then find window and then hide window - make some splash of this programm. it is not acceptably. who know how made it without this splashes? i mean start programm already hide. and then after some time show to user.
Code: Select all
RunProgram("calc.exe", "", "", #PB_Program_Hide)-
SeregaZ
- Enthusiast

- Posts: 628
- Joined: Fri Feb 20, 2009 9:24 am
- Location: Almaty (Kazakhstan. not Borat, but Triple G)
- Contact:
Re: Hide external window
i learn to hide window by ShowWindow_(HNDL, #SW_HIDE)
but - if this window is internet explorer window, and if after hiding in this window some thing happen - open.window or form.submit by javascripts - this window some time make show again, or this hide window take main focus, so if i write in this moment some text in word or playing full screen game - this hide window take focus, and it means i write text not to word but in this hide explorer or if it was full screen game - he is minimized.
so main question is - how to make this explorer - after hide - absolutly unfocusable? and if i unhide explorer - again to focusable.
something like if i run this explorer under another user in windows xp.
but - if this window is internet explorer window, and if after hiding in this window some thing happen - open.window or form.submit by javascripts - this window some time make show again, or this hide window take main focus, so if i write in this moment some text in word or playing full screen game - this hide window take focus, and it means i write text not to word but in this hide explorer or if it was full screen game - he is minimized.
so main question is - how to make this explorer - after hide - absolutly unfocusable? and if i unhide explorer - again to focusable.
something like if i run this explorer under another user in windows xp.



