home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_C / CENVIW9.ZIP / PMCORNER.CMM < prev    next >
Text File  |  1994-03-08  |  904b  |  27 lines

  1. // PMCorner.cmm - Minimize the Program Manager and put its
  2. // ver.1          icon into the lower right-hand corner of
  3. //                the screen.  If Program Manager is not
  4. //                running then just exit.
  5.  
  6. #include <WinTools.lib>  // Lots of useful routines
  7. #include <Message.lib>
  8.  
  9. // Get the Window handle based on the "Program Manager" text
  10. handle = GetWindowHandle("Program Manager");
  11. if ( handle != NULL ) {
  12.  
  13.    // Minimize this window
  14.    SendMessage(handle,WM_SYSCOMMAND,SC_MINIMIZE,0);
  15.  
  16.    // Find out the size of this window and the size of the screen
  17.    GetWindowRect(handle,IconBox);
  18.    IconWidth = IconBox.right - IconBox.left + 1;
  19.    IconHeight = IconBox.bottom - IconBox.top + 1;
  20.    GetScreenSize(ScreenWidth,ScreenHeight);
  21.  
  22.    // Move this icon to lower-right corner of screen
  23.    SetPosition(handle,ScreenWidth-IconWidth,ScreenHeight-IconHeight);
  24.  
  25. }
  26.  
  27.