dcsimg
Results 1 to 4 of 4

Thread: [vb2008] mainHwnd from Child Hwnd

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2009
    Posts
    425

    [vb2008] mainHwnd from Child Hwnd

    by this code

    Code:
    Hwnd = WindowFromPoint(Cursor.Position)
    I can get the Hwnd of every control of an external window is under the cursor.

    Question: I need only and always the MAIN WINDOW hwnd, everywhere should be the cursor... what API I need?

    ty

  2. #2
    Fanatic Member BlindSniper's Avatar
    Join Date
    Jan 2011
    Location
    South Africa
    Posts
    865

    Re: [vb2008] mainHwnd from Child Hwnd


    Useful CodeBank Entries of mine
    Expand Function
    Code Compiler
    Sudoku Solver
    HotKeyHandler Class

    Read this to get Effective help on VBForums
    Hitchhiker's Guide to Getting Help at VBF

  3. #3
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [vb2008] mainHwnd from Child Hwnd


  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2009
    Posts
    425

    Re: [vb2008] mainHwnd from Child Hwnd

    Quote Originally Posted by Negative0 View Post
    Actually, GetParent may be a more appropriate call in this case
    ty mate!

    this code
    Code:
            HwndFromPoint = WindowFromPoint(Cursor.Position)
            Hwnd = GetParent(HwndFromPoint)
            If Hwnd = IntPtr.Zero Then Hwnd = HwndFromPoint
    works perfectly...

    ty again

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width