+ Reply to Thread
Results 1 to 3 of 3

Thread: Find Child Window

  1. #1
    Zexor's Avatar
    Zexor is offline VB.NET Forum Enthusiast Zexor is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Nov 2008
    Posts
    95
    Reputation
    24

    Default Find Child Window

    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.

    Code:
            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 by Zexor; 03-20-2010 at 5:10 AM.

  2. #2
    Zexor's Avatar
    Zexor is offline VB.NET Forum Enthusiast Zexor is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Nov 2008
    Posts
    95
    Reputation
    24

    Default

    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 by Zexor; 03-20-2010 at 2:27 PM.

  3. #3
    Evan1993 is offline VB.NET Forum Enthusiast Evan1993 will become famous soon enough
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Apr 2008
    Posts
    45
    Reputation
    45

    Default

    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?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts