How to determine, if process' window was previously hidden? And list hidden windows?


hi.

i used code listing (in listbox) running windows , hide/show of them.

i adding listbox processes, have mainwindowtitle or have mainwindowhandle != intptr.zero (i mean - i've tried first , second option, not both @ time) - looks it's quite same way.

everything works great until hide window , close , reopen app. of course hidden window doesn't show in listbox - can't, because it's hidden, has zero-handle.
process exists , if knew previous mainwindowhandle retrieve (show) it's window - checked copying handle before hiding , after reopen, showing specific window.

i don't know, how determine, process has hidden window and/or how it's handle. possible?

my goal portability, don't want save hidden window's handle anywhere. maybe can "check" somehow process, give attribute or something?

mainwindowhandle isn't reliable you're trying do.  it's designed getting access process'es handle can send message (such close).  taking quick @ impl relies on enumwindows won't pull hidden windows.  hence won't value if window hidden.  can verify by opening notepad, running app can see handle, hiding notepad (however doing that) , call refresh on notepad process instance.  you'll find handle gone. 

i believe findwindow win32 function can find hidden windows.  if want accomplish you're trying you're going have use find windows.  each window you'll have process via getwindowthreadprocessid.  given process id can .net process.  slow should work.

michael taylor - 5/11/2012
http://msmvps.com/blogs/p3net



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'