Jack
Jack

Reputation: 16724

Can two process share same classsame?

From my C# application I call FindWindow() like this:

FindWindow("#32770", "title goes here")

My question is: Can two process share the same classname? (If matter, I'm clicking in "ok" button on a dialog box raised by the WebBrowser in my application) I'm afraid of requesting to find process with #32770 classname and this return the process I'm not looking for. If I can share same classname, how can I make sure that classname is from a specific process? Maybe filter by process's path to make sure it's unique? I hope it's clean.

Upvotes: 0

Views: 120

Answers (1)

Alexei Levenkov
Alexei Levenkov

Reputation: 100545

Yes.

There is no restriction on window class names to be unique across processes. Each process registers its own classes, and every process is free to call they main window class "MainWindowClass".

In your case you are looking for system-wide "dialog" class, which definitely can be used by multiple processes.

#32770 The class for a dialog box.

Detailed info can be found in About Window Classes.

Upvotes: 2

Related Questions