Finding window with coordinates

This is a discussion on Finding window with coordinates within the Windows Programming forums, part of the Platform Specific Boards category; If you had the coordinates of a certain widow, how would you get the handle?...

  1. #1
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230

    Finding window with coordinates

    If you had the coordinates of a certain widow, how would you get the handle?

  2. #2
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    By getting the handles for all windows and checking whether the co-ordinates match for each one in turn??

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    I thought of that, but I was just wondering if there was an easier approach. Oh well, guess that's good enough

    Thanks anyways.

  4. #4
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Would 'WindowFromPoint' be what you are after?:

    POINT pt; //set to coords eg mouse coord
    HWND hWnd=WindowFromPoint(&pt);

    There's also a fn 'ChildWindowFromPoint' that may also be of interest.

  5. #5
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Now THAT's what I'm talkin' 'bout. Thanks a heap, ken.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21