Click here to Skip to main content
15,890,412 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used Findwindow & findwindowEX to get dialog box handle. But it's always returning 0 value.

I saw in Spy++ that this dialog box is not under Parent window child tree where it supposed to, but it was above the parent window, means on Main Desktop Process window child tree list. Even I used only FindWindow to find dialog box, I got again 0 value in return. This dialog box has only class name, no windows name.

Also I have checked that in spy++ that this dialog box showing parent window name & it's handle.
This dialog box look like global dialog box with having parent window mentioned in spy++ properties window, but not under child tree of his own parent window. Thats why FindWindowEx also not returning handle to this dialog box.

Anybody know why both findwidnow & findwindowEX not working on such dialog box windows. Please let me know if you have solution for getting such type of tricky dialog windows handles. I used C# for my project.
Posted

1 solution

You could traverse all windows until you find the one you need.

Have a look at this codeproject article:
Window Hiding with C#[^]


or maybe something like this:

http://channel9.msdn.com/forums/TechOff/258171-How-to-iterate-through-ALL-Window-handles-in-C/[^]

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900