Thursday 15 January 2015

.net - How to get window handle of minimized window -



.net - How to get window handle of minimized window -

i need window handle of minimized window in tray. know process name, has not mainwindowhandle set because minimized. how know window handle?

if goal close main window end process, there's pretty straightforward way of doing using system.diagnostics.process object. illustration closes first instance finds of notepad.

var procs = system.diagnostics.process.getprocessesbyname("notepad"); if (procs.length > 0) procs[0].closemainwindow(); foreach (var proc in procs) proc.dispose();

.net windows

No comments:

Post a Comment