Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

99 lines
2.4 KiB

/*++
Copyright (c) 1990-1999 Microsoft Corporation, All Rights Reserved
Module Name:
mmonitor.c
this file contains functions which support Multiple Monitors
++*/
#include <windows.h>
#include <immdev.h>
#include <imedefs.h>
#ifdef MUL_MONITOR
/**********************************************************************/
/* ImeMonitorWorkAreaFromWindow() */
/**********************************************************************/
RECT PASCAL ImeMonitorWorkAreaFromWindow( HWND hAppWnd)
{
HMONITOR hMonitor;
hMonitor = MonitorFromWindow(hAppWnd, MONITOR_DEFAULTTONEAREST);
if (hMonitor) {
MONITORINFO sMonitorInfo;
sMonitorInfo.cbSize = sizeof(sMonitorInfo);
// init a default value to avoid GetMonitorInfo fails
sMonitorInfo.rcWork = sImeG.rcWorkArea;
GetMonitorInfo(hMonitor, &sMonitorInfo);
return sMonitorInfo.rcWork;
} else
return sImeG.rcWorkArea;
}
/**********************************************************************/
/* ImeMonitorWorkAreaFromPoint() */
/**********************************************************************/
RECT PASCAL ImeMonitorWorkAreaFromPoint(
POINT ptPoint)
{
HMONITOR hMonitor;
hMonitor = MonitorFromPoint(ptPoint, MONITOR_DEFAULTTONEAREST);
if (hMonitor) {
MONITORINFO sMonitorInfo;
sMonitorInfo.cbSize = sizeof(sMonitorInfo);
// init a default value to avoid GetMonitorInfo fails
sMonitorInfo.rcWork = sImeG.rcWorkArea;
GetMonitorInfo(hMonitor, &sMonitorInfo);
return sMonitorInfo.rcWork;
} else
return sImeG.rcWorkArea;
}
/**********************************************************************/
/* ImeMonitorWorkAreaFromRect() */
/**********************************************************************/
RECT PASCAL ImeMonitorWorkAreaFromRect(
LPRECT lprcRect)
{
HMONITOR hMonitor;
hMonitor = MonitorFromRect(lprcRect, MONITOR_DEFAULTTONEAREST);
if (hMonitor) {
MONITORINFO sMonitorInfo;
sMonitorInfo.cbSize = sizeof(sMonitorInfo);
// init a default value to avoid GetMonitorInfo fails
sMonitorInfo.rcWork = sImeG.rcWorkArea;
GetMonitorInfo(hMonitor, &sMonitorInfo);
return sMonitorInfo.rcWork;
} else
return sImeG.rcWorkArea;
}
#endif // MUL_MONITOR