Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to find all children windows if the Spy++ can not show them? If I save a file via save MessageBox (Win 7) I can find only the MessageBox dialog but its childs not. I see the radio buttons and ok button and cancel button too, but I can't find them in Spy++ and the PostMessage can't click on successfully them (nothing happens).

C#
parent_hwnd = FindWindow("MozillaDialogClass", torrent_name_Window);

SetForegroundWindow((IntPtr)parent_hwnd);

// click on radio button "save as" (download dialog - mozilla):
PostMessage(parent_hwnd, WM_LBUTTONDOWN, 496, 473);
PostMessage(parent_hwnd, WM_LBUTTONUP, 496, 473);

System.Threading.Thread.Sleep(1000);

// click on OK (download dialog - mozilla):
PostMessage(parent_hwnd, WM_LBUTTONDOWN, 708, 571);
PostMessage(parent_hwnd, WM_LBUTTONUP, 708, 571);
Posted

1 solution

Assuming you've already tried EnumWindows: use the EnumChildWindows pinvoke ? Sample code here: [^]
 
Share this answer
 
Comments
Roland-HE-C# 10-Oct-15 6:32am    
I know both methods and if the Spy++ can not show a window then this two methods also can't show them. :/
But I see them but can't find them programatically.

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