Process MainWindowHandle

M

Moty Michaely

Hello all,

I am enumerating vb6 process from c# application by name.

I need to send message to all processes that has the specified name but for
this purpose I need the handle of the main window for each process returned.

I once read that vb6 app mainWindowHandle is the handle of the hidden window
that runs the application.

If so, what's the way to get the handle of the main window of each vb6
application by it's process info???

- Moty -
 
G

Guest

Hi,

You can use the Win32 API FindWindow if you know the process name, that will
return the Window handle.

Cheers
 
M

Moty Michaely

Hi, thanks for the reply,

I thought about it but FindWindow depands on the Z order of the windows.

I solved it by setting a propery like "IsWindowMain" and checking all child
forms of the MainWindowHandle.

Thanks again
-Moty-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top