Question Find Child Window

Zexor

Well-known member
Joined
Nov 28, 2008
Messages
520
Programming Experience
3-5
I am trying to find the handle of the child window for the Yes button in the User Account Control window so i can click it. This window has a structure with a few child windows with the same name.

VB.NET:
        Dim hwnd As IntPtr = FindWindow(Nothing, "User Account Control")
        Dim hwnd2 As IntPtr = FindWindowEx(hwnd, 0, "DirectUIHWND", vbNullString)
        Dim hwnd3 As IntPtr = FindWindowEx(hwnd2, 0, "CtrlNotifySink", vbNullString)
        Dim hwnd4 As IntPtr = FindWindowEx(hwnd3, 0, "Button", "&Yes")
There are multiple CtrNotifySink with its own Button child window or other child windows. How do i search thru the different CtrNotifySink window to find the one that contain the Yes button so i can send a click to it?

I do need to find it before i can send a click, right? because i try just sending it to the main window with sendmessage and nothing happen.

I even try sending it directly to the handle found by spy++ of the yes button with bm click but nothing happen
 
Last edited:
ok i figured out how to find the button handle in the child window. but i am still unable to get the button to click. The code works fine on another window, just not the UAC window
 
Last edited:
I'm pretty darn sure its blocked, it it wasn't it would make UAC 100% useless...

Why in the world do you need to do this for a legit application? :confused:
 
Back
Top