home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / win_lrn / apps / wfpoint.c < prev    next >
Text File  |  1988-08-10  |  884b  |  30 lines

  1. /*
  2.  *  Function(s) demonstrated in this program: WindowFromPoint
  3.  *  Compiler version: 5.1
  4.  *  Description:
  5.  *     This program will get the handle to the window that contains the
  6.  *  point ( 100, 100 ) in it.
  7.  */
  8.  
  9. #include <windows.h>
  10.  
  11. long FAR PASCAL WndProc(HWND, unsigned, WORD, LONG);
  12.  
  13. int PASCAL WinMain (hInstance, hPrevInstance, lpszCmdLine, nCmdShow)
  14. HANDLE      hInstance, hPrevInstance ;
  15. LPSTR       lpszCmdLine ;
  16. int         nCmdShow ;
  17.   {
  18.   HWND        hWnd;          /*  Handle to the window to iconize  */
  19.   POINT       pPoint;        /*  Will hold the point  */
  20.  
  21.   pPoint.x = 100;            /*  Set the point to 100, 100  */
  22.   pPoint.y = 100;
  23.  
  24.   hWnd = WindowFromPoint( pPoint );  /*  Get the window handle  */
  25.  
  26.   MessageBox( GetFocus(), (LPSTR)"We have the handle to the window",
  27.               (LPSTR)"", MB_OK );
  28.   return( TRUE );
  29.   }
  30.