// PMCorner.cmm - Minimize the Program Manager and put its // icon into the lower right-hand corner of // the screen. If Program Manager is not // running then just exit. #include // Lots of useful routines #include // Send messages to windows // Get the Window handle based on the "Program Manager" text handle = GetWindowHandle("Program Manager"); if ( handle != NULL ) { // Minimize this window SendMessage(handle,WM_SYSCOMMAND,SC_MINIMIZE,0); // Find out the size of this window and the size of the screen IconBox = GetWindowRect(handle); IconWidth = IconBox.right - IconBox.left + 1; IconHeight = IconBox.bottom - IconBox.top + 1; ScreenWidth = GetSystemMetrics(SM_CXSCREEN); ScreenHeight = GetSystemMetrics(SM_CYSCREEN); // Move this icon to lower-right corner of screen MoveWindow(handle, ScreenWidth-IconWidth,ScreenHeight-IconHeight, IconWidth,IconHeight,TRUE); }