本文整理汇总了C++中MonitorFromWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ MonitorFromWindow函数的具体用法?C++ MonitorFromWindow怎么用?C++ MonitorFromWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MonitorFromWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetWindowPlacement
void ViewerWindow::setSizeFullScreenWindow()
{
// Save position of window.
GetWindowPlacement(m_hWnd, &m_workArea);
// Get size of desktop.
HMONITOR hmon = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO mi;
mi.cbSize = sizeof(mi);
RECT fullScreenWindowsRect;
if (!!GetMonitorInfo(hmon, &mi)) {
fullScreenWindowsRect = mi.rcMonitor;
}
else {
m_logWriter.warning(_T("Get monitor info is failed. Use second method (no multi-screen)."));
GetWindowRect(GetDesktopWindow(), &fullScreenWindowsRect);
}
Rect fullScreenRect;
fullScreenRect.fromWindowsRect(&fullScreenWindowsRect);
m_logWriter.detail(_T("full screen window rect: %d, %d; %d, %d"),
fullScreenRect.left, fullScreenRect.top,
fullScreenRect.getWidth(), fullScreenRect.getHeight());
setStyle((getStyle() | WS_MAXIMIZE) & ~(WS_CAPTION | WS_BORDER | WS_THICKFRAME | WS_MAXIMIZEBOX));
setExStyle(getExStyle() | WS_EX_TOPMOST);
SetWindowPos(m_hWnd, 0,
fullScreenRect.left, fullScreenRect.top,
fullScreenRect.getWidth(), fullScreenRect.getHeight(),
SWP_SHOWWINDOW);
}
开发者ID:Aliceljm1,项目名称:TightVNC-1,代码行数:32,代码来源:ViewerWindow.cpp
示例2: Manage
static void Manage(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
CommonManage(vd);
if (sys->changes & DX_POSITION_CHANGE) {
/* Update overlay */
if (sys->use_overlay)
DirectXUpdateOverlay(vd, NULL);
/* Check if we are still on the same monitor */
HMONITOR hmon = MonitorFromWindow(sys->hwnd, MONITOR_DEFAULTTONEAREST);
if (sys->hmonitor != hmon) {
vout_display_SendEventPicturesInvalid(vd);
}
/* */
sys->changes &= ~DX_POSITION_CHANGE;
}
/* Wallpaper mode change */
vlc_mutex_lock(&sys->lock);
const bool ch_wallpaper = sys->ch_wallpaper;
const bool wallpaper_requested = sys->wallpaper_requested;
sys->ch_wallpaper = false;
vlc_mutex_unlock(&sys->lock);
if (ch_wallpaper)
WallpaperChange(vd, wallpaper_requested);
/* */
if (sys->restore_overlay)
DirectXUpdateOverlay(vd, NULL);
}
开发者ID:bluebarnacles,项目名称:vlc-2.1,代码行数:34,代码来源:directx.c
示例3: SetRect
void D3D9RenderWindow::adjustWindow(unsigned int clientWidth, unsigned int clientHeight,
unsigned int* winWidth, unsigned int* winHeight)
{
// NB only call this for non full screen
RECT rc;
SetRect(&rc, 0, 0, clientWidth, clientHeight);
AdjustWindowRect(&rc, WS_VISIBLE | WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW, false);
*winWidth = rc.right - rc.left;
*winHeight = rc.bottom - rc.top;
// adjust to monitor
HMONITOR hMonitor = MonitorFromWindow(mHWnd, MONITOR_DEFAULTTONEAREST);
// Get monitor info
MONITORINFO monitorInfo;
memset(&monitorInfo, 0, sizeof(MONITORINFO));
monitorInfo.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(hMonitor, &monitorInfo);
LONG maxW = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
LONG maxH = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
if (*winWidth > (unsigned int)maxW)
*winWidth = maxW;
if (*winHeight > (unsigned int)maxH)
*winHeight = maxH;
}
开发者ID:gbruce,项目名称:ogre3d_trunk,代码行数:29,代码来源:OgreD3D9RenderWindow.cpp
示例4: MonitorFromWindow
BOOL CMonitorManager::GetMonitorResolution(HWND hWnd, long *lResoluteW, long *lResoluteH)
{
HMONITOR hm = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
BOOL bFindMonitor = FALSE;
for(int i = 0; i < m_MonitorList.size(); i++)
{
if (hm == m_MonitorList[i].hMonitor)
{
bFindMonitor = TRUE;
break;
}
}
if (!bFindMonitor) return FALSE;
DISPLAY_DEVICE dd;
ZeroMemory(&dd, sizeof(DISPLAY_DEVICE));
dd.cb = sizeof(DISPLAY_DEVICE);
bFindMonitor = EnumDisplayDevices(NULL, i, &dd, 0);
if (!bFindMonitor) return FALSE;
DEVMODE dm;
ZeroMemory(&dm, sizeof(DEVMODE));
dm.dmSize = sizeof(dm);
bFindMonitor = EnumDisplaySettings((char*)dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm);
if (!bFindMonitor) return FALSE;
*lResoluteW = dm.dmPelsWidth;
*lResoluteH = dm.dmPelsHeight;
return TRUE;
}
开发者ID:crashatom,项目名称:phoebemail,代码行数:34,代码来源:MonitorManager.cpp
示例5: d3d_free
static void d3d_free(void *data)
{
d3d_video_t *d3d = (d3d_video_t*)data;
d3d_deinitialize(d3d);
#ifdef _XBOX
if (d3d->ctx_driver && d3d->ctx_driver->destroy)
d3d->ctx_driver->destroy(d3d);
d3d->ctx_driver = NULL;
#endif
if (d3d->dev)
d3d->dev->Release();
if (d3d->g_pD3D)
d3d->g_pD3D->Release();
#ifdef HAVE_MONITOR
Monitor::last_hm = MonitorFromWindow(d3d->hWnd, MONITOR_DEFAULTTONEAREST);
DestroyWindow(d3d->hWnd);
#endif
if (d3d)
delete d3d;
#ifndef _XBOX
UnregisterClass("RetroArch", GetModuleHandle(NULL));
#endif
}
开发者ID:ChowZenki,项目名称:RetroArch,代码行数:26,代码来源:xdk_d3d.cpp
示例6: gfx_ctx_destroy
static void gfx_ctx_destroy(void)
{
if (g_hrc)
{
wglMakeCurrent(NULL, NULL);
wglDeleteContext(g_hrc);
g_hrc = NULL;
}
if (g_hwnd && g_hdc)
{
ReleaseDC(g_hwnd, g_hdc);
g_hdc = NULL;
}
if (g_hwnd)
{
g_last_hm = MonitorFromWindow(g_hwnd, MONITOR_DEFAULTTONEAREST);
DestroyWindow(g_hwnd);
UnregisterClass("RetroArch", GetModuleHandle(NULL));
g_hwnd = NULL;
}
if (g_restore_desktop)
{
MONITORINFOEX current_mon;
memset(¤t_mon, 0, sizeof(current_mon));
current_mon.cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(g_last_hm, (MONITORINFO*)¤t_mon);
ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL);
g_restore_desktop = false;
}
g_inited = false;
}
开发者ID:Jalle19,项目名称:RetroArch,代码行数:35,代码来源:wgl_ctx.c
示例7: sizeof
void ConfigFileManager::CreateInstallerWindow(const std::wstring& title)
{
if (m_pInstallerWindow != NULL)
{
delete m_pInstallerWindow;
m_pInstallerWindow = NULL;
}
MONITORINFO mi = { 0 };
mi.cbSize = sizeof(mi);
CHECK_WIN32_BOOL(GetMonitorInfo(MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY), & mi),
L"GetMonitorInfo");
int cx = 640;
int cy = 480;
m_pInstallerWindow = new InstallerWindow(); // deletes itself
m_pInstallerWindow->Create(
(mi.rcWork.left + mi.rcWork.right) / 2 - cx / 2,
(mi.rcWork.top + mi.rcWork.bottom) / 2 - cy / 2,
cx, cy, title.c_str());
CHECK_BOOL(m_pInstallerWindow->hwnd != NULL,
L"InstallerWindow::Create");
}
开发者ID:AllanDragoon,项目名称:dotnetinstaller,代码行数:25,代码来源:ConfigFileManager.cpp
示例8: SetWindowMode
static void
SetWindowMode(window_data Data, int Width, int Height)
{
MONITORINFO MonitorInfo = {};
MonitorInfo.cbSize = sizeof(MonitorInfo);
if(GetMonitorInfo(MonitorFromWindow(Data.Window, MONITOR_DEFAULTTONEAREST), &MonitorInfo)) {
RECT Rect = MonitorInfo.rcMonitor;
int MonitorWidth = Rect.right - Rect.left;
int MonitorHeight = Rect.bottom - Rect.top;
int X = Rect.left;
int Y = Rect.top;
if(MonitorWidth > Width) {
X = (MonitorWidth - Width) / 2;
}
if(MonitorHeight > Height) {
Y = (MonitorHeight - Height) / 2;
}
SetWindowDimensions(Data, X, Y, Width, Height);
}
else {
PRINT_ERR("Could not get monitor info.\n");
}
SetBorderlessWindowStyle(Data);
}
开发者ID:Bl00drav3n,项目名称:FSWindow,代码行数:25,代码来源:fswindow.cpp
示例9: MonitorFromWindow
void WindowManager::toggleBorderlessFullscreen() {
borderlessFullscreen = !borderlessFullscreen;
HWND hwnd = ::GetActiveWindow();
if(borderlessFullscreen) {
// store previous rect
::GetClientRect(hwnd, &prevWindowRect);
// set styles
LONG lStyle = ::GetWindowLong(hwnd, GWL_STYLE);
prevStyle = lStyle;
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);
::SetWindowLong(hwnd, GWL_STYLE, lStyle);
LONG lExStyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
prevExStyle = lExStyle;
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);
::SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle);
// adjust size & position
HMONITOR monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO info;
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(monitor, &info);
int monitorWidth = info.rcMonitor.right - info.rcMonitor.left;
int monitorHeight = info.rcMonitor.bottom - info.rcMonitor.top;
::SetWindowPos(hwnd, NULL, info.rcMonitor.left, info.rcMonitor.top, monitorWidth, monitorHeight, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER);
} else {
// restore previous window
::SetWindowLong(hwnd, GWL_STYLE, prevStyle);
::SetWindowLong(hwnd, GWL_EXSTYLE, prevExStyle);
RECT desiredRect = prevWindowRect;
::AdjustWindowRect(&desiredRect, prevStyle, false);
int wWidth = desiredRect.right - desiredRect.left, wHeight = desiredRect.bottom - desiredRect.top;
::SetWindowPos(hwnd, NULL, prevWindowRect.left, prevWindowRect.top, wWidth, wHeight, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOOWNERZORDER);
}
}
开发者ID:Asmodean-,项目名称:dsfix,代码行数:33,代码来源:WindowManager.cpp
示例10: Win32FullscreenToggle
// Thank you Raymond Chen!!
void Win32FullscreenToggle(HWND window)
{
DWORD style = GetWindowLong(window, GWL_STYLE);
if (style & WS_OVERLAPPEDWINDOW)
{
MONITORINFO monitorInfo = { sizeof(monitorInfo) };
if (GetWindowPlacement(window, &globalWindowPos) &&
GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY), &monitorInfo))
{//NOT BITWISE OPERATOR
SetWindowLong(window, GWL_STYLE, style & ~WS_OVERLAPPEDWINDOW);
SetWindowPos(window, HWND_TOP,
monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top,
monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left,
monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top,
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
}
}
else
{
SetWindowLong(window, GWL_STYLE, style | WS_OVERLAPPEDWINDOW);
SetWindowPlacement(window, &globalWindowPos);
SetWindowPos(window, NULL, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
SWP_NOOWNERZORDER | SWP_FRAMECHANGED);
}
}
开发者ID:gwulfers88,项目名称:2DGame_GroupProject,代码行数:27,代码来源:sys_win.cpp
示例11: MonitorFromWindow
void DXContext::MinimizeWinamp(HMONITOR hPluginMonitor)
{
// minimize Winamp window
HMONITOR hWinampMon = MonitorFromWindow(m_hwnd_winamp, MONITOR_DEFAULTTONEAREST);
HMONITOR hPluginMon = hPluginMonitor;//MonitorFromWindow(m_hwnd, MONITOR_DEFAULTTONEAREST);//m_lpD3D->GetAdapterMonitor(ordinal_adapter);
if ((m_current_mode.screenmode == FULLSCREEN || m_current_mode.screenmode == FAKE_FULLSCREEN) &&
(m_minimize_winamp) &&
(hWinampMon && hPluginMon && hPluginMon==hWinampMon) &&
(!m_winamp_minimized)
)
{
// nitpicky check: if we're in fake fullscreen mode
// and are only going to display on half the screen,
// don't minimize Winamp.
if (m_current_mode.screenmode == FAKE_FULLSCREEN)
{
int x = m_monitor_rect.right - m_monitor_rect.left;
int y = m_monitor_rect.bottom - m_monitor_rect.top;
if ((x >= y*2 && m_current_mode.m_dualhead_horz != 0) ||
(y > x*4/3 && m_current_mode.m_dualhead_vert != 0))
{
return;
}
}
ShowWindow(m_hwnd_winamp, SW_MINIMIZE);
// also restore the focus to the plugin window, since this will steal it:
SetFocus(m_hwnd);
SetActiveWindow(m_hwnd);
SetForegroundWindow(m_hwnd);
m_winamp_minimized = 1;
}
}
开发者ID:mstrange86,项目名称:milkdrop2_mmport,代码行数:35,代码来源:dxcontext.cpp
示例12: MonitorFromWindow
bool D3D9Device::validateDisplayMonitor(D3D9RenderWindowCore* renderWindow)
{
// Ignore full screen since it doesn't really move and it is possible
// that it created using multi-head adapter so for a subordinate the
// native monitor handle and this device handle will be different.
if (renderWindow->getProperties().isFullScreen())
return true;
HMONITOR hRenderWindowMonitor = NULL;
// Find the monitor this render window belongs to.
hRenderWindowMonitor = MonitorFromWindow(renderWindow->_getWindowHandle(), MONITOR_DEFAULTTONULL);
// This window doesn't intersect with any of the display monitor
if (hRenderWindowMonitor == NULL)
return false;
// Case this window changed monitor.
if (hRenderWindowMonitor != mMonitor)
{
// Lock access to rendering device.
D3D9RenderAPI::getResourceManager()->lockDeviceAccess();
mpDeviceManager->linkRenderWindow(renderWindow);
// UnLock access to rendering device.
D3D9RenderAPI::getResourceManager()->unlockDeviceAccess();
return false;
}
return true;
}
开发者ID:AlfHub,项目名称:BansheeEngine,代码行数:34,代码来源:BsD3D9Device.cpp
示例13: CorrectConsolePos
void CorrectConsolePos(HWND hConWnd)
{
RECT rcNew = {};
if (GetWindowRect(hConWnd, &rcNew))
{
HMONITOR hMon = MonitorFromWindow(hConWnd, MONITOR_DEFAULTTOPRIMARY);
MONITORINFO mi = {sizeof(mi)};
//int nMaxX = 0, nMaxY = 0;
if (GetMonitorInfo(hMon, &mi))
{
int newW = (rcNew.right-rcNew.left), newH = (rcNew.bottom-rcNew.top);
int newX = rcNew.left, newY = rcNew.top;
if (newX < mi.rcWork.left)
newX = mi.rcWork.left;
else if (rcNew.right > mi.rcWork.right)
newX = max(mi.rcWork.left,(mi.rcWork.right-newW));
if (newY < mi.rcWork.top)
newY = mi.rcWork.top;
else if (rcNew.bottom > mi.rcWork.bottom)
newY = max(mi.rcWork.top,(mi.rcWork.bottom-newH));
if ((newX != rcNew.left) || (newY != rcNew.top))
SetWindowPos(hConWnd, HWND_TOP, newX, newY,0,0, SWP_NOSIZE);
}
}
}
开发者ID:qyqx,项目名称:ConEmu,代码行数:28,代码来源:EmergencyShow.cpp
示例14: SystemParametersInfo
void Dialog::SnapToEdges(LPWINDOWPOS window_pos) {
if (!snap_gap_)
return;
RECT rc_monitor = {0};
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc_monitor, 0);
if (GetSystemMetrics(SM_CMONITORS) > 1) {
HMONITOR monitor = MonitorFromWindow(window_, MONITOR_DEFAULTTONEAREST);
if (monitor) {
MONITORINFO mi;
mi.cbSize = sizeof(mi);
GetMonitorInfo(monitor, &mi);
rc_monitor = mi.rcWork;
}
}
// Snap X axis
if (abs(window_pos->x - rc_monitor.left) <= snap_gap_) {
window_pos->x = rc_monitor.left;
} else if (abs(window_pos->x + window_pos->cx - rc_monitor.right) <= snap_gap_) {
window_pos->x = rc_monitor.right - window_pos->cx;
}
// Snap Y axis
if (abs(window_pos->y - rc_monitor.top) <= snap_gap_) {
window_pos->y = rc_monitor.top;
} else if (abs(window_pos->y + window_pos->cy - rc_monitor.bottom) <= snap_gap_) {
window_pos->y = rc_monitor.bottom - window_pos->cy;
}
}
开发者ID:Hydro8182,项目名称:taiga,代码行数:29,代码来源:win_dialog.cpp
示例15: MonitorFromWindow
void CDpiAware::GetCenteredRect(HWND hWnd, RECT& rcCentered, HMONITOR hDefault /*= NULL*/)
{
bool lbCentered = false;
HMONITOR hMon;
if (hWnd)
hMon = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
else
hMon = MonitorFromRect(&rcCentered, MONITOR_DEFAULTTONEAREST);
MONITORINFO mi = {};
GetNearestMonitorInfo(&mi, hDefault, hWnd ? NULL : &rcCentered, hWnd);
int iWidth = rcCentered.right - rcCentered.left;
int iHeight = rcCentered.bottom - rcCentered.top;
RECT rcNew = {
(mi.rcWork.left + mi.rcWork.right - iWidth)/2,
(mi.rcWork.top + mi.rcWork.bottom - iHeight)/2
};
rcNew.right = rcNew.left + iWidth;
rcNew.bottom = rcNew.top + iHeight;
rcCentered = rcNew;
}
开发者ID:robovod,项目名称:ConEmu,代码行数:25,代码来源:DpiAware.cpp
示例16: MonitorFromWindow
void Win32WindowManager::lowerCurtain()
{
if(mCurtainWindow)
return;
// For now just grab monitor of the first window... we may need to
// beef this up later on, maybe by passing in the window that's entering
// leaving full-screen to lowerCurtain.
HMONITOR hMon = MonitorFromWindow(mWindowListHead->getHWND(), MONITOR_DEFAULTTOPRIMARY);
// Get the monitor's extents.
MONITORINFO monInfo;
dMemset(&monInfo, 0, sizeof MONITORINFO);
monInfo.cbSize = sizeof MONITORINFO;
GetMonitorInfo(hMon, &monInfo);
mCurtainWindow = CreateWindow(Win32Window::getCurtainWindowClassName(),
dT(""), (WS_POPUP | WS_MAXIMIZE | WS_VISIBLE),
monInfo.rcWork.left, monInfo.rcWork.top,
monInfo.rcWork.right - monInfo.rcWork.left,
monInfo.rcWork.bottom - monInfo.rcWork.top,
NULL, NULL, NULL, NULL);
if (!mOffscreenRender)
SetWindowPos(mCurtainWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
}
开发者ID:souxiaosou,项目名称:OmniEngine.Net,代码行数:27,代码来源:win32WindowMgr.cpp
示例17: GetWindowRect
void CResizableStandAloneDialog::OnNcMButtonUp(UINT nHitTest, CPoint point)
{
WINDOWPLACEMENT windowPlacement;
if ((nHitTest == HTMAXBUTTON) && GetWindowPlacement(&windowPlacement) && windowPlacement.showCmd == SW_SHOWNORMAL)
{
CRect rcWindowRect;
GetWindowRect(&rcWindowRect);
MONITORINFO mi = {0};
mi.cbSize = sizeof(MONITORINFO);
if (m_bVertical)
{
rcWindowRect.top = m_rcOrgWindowRect.top;
rcWindowRect.bottom = m_rcOrgWindowRect.bottom;
}
else if (GetMonitorInfo(MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST), &mi))
{
m_rcOrgWindowRect.top = rcWindowRect.top;
m_rcOrgWindowRect.bottom = rcWindowRect.bottom;
rcWindowRect.top = mi.rcWork.top;
rcWindowRect.bottom = mi.rcWork.bottom;
}
m_bVertical = !m_bVertical;
//m_bHorizontal = m_bHorizontal;
MoveWindow(&rcWindowRect);
}
CStandAloneDialogTmpl<CResizableDialog>::OnNcMButtonUp(nHitTest, point);
}
开发者ID:Kasper8660,项目名称:tortoisesvn,代码行数:29,代码来源:StandAloneDlg.cpp
示例18: ScreenForNativeWidget
NS_IMETHODIMP
nsScreenManagerWin :: ScreenForNativeWidget(void *aWidget, nsIScreen **outScreen)
{
HMONITOR mon = MonitorFromWindow ((HWND) aWidget, MONITOR_DEFAULTTOPRIMARY);
*outScreen = CreateNewScreenObject (mon);
return NS_OK;
}
开发者ID:FunkyVerb,项目名称:devtools-window,代码行数:7,代码来源:nsScreenManagerWin.cpp
示例19: win32_monitor_info
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id)
{
unsigned i, fs_monitor;
settings_t *settings = config_get_ptr();
MONITORINFOEX *mon = (MONITORINFOEX*)data;
HMONITOR *hm_to_use = (HMONITOR*)hm_data;
if (!win32_monitor_last)
win32_monitor_last = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTONEAREST);
*hm_to_use = win32_monitor_last;
fs_monitor = settings->video.monitor_index;
if (fs_monitor && fs_monitor <= win32_monitor_count
&& win32_monitor_all[fs_monitor - 1])
{
*hm_to_use = win32_monitor_all[fs_monitor - 1];
*mon_id = fs_monitor - 1;
}
else
{
for (i = 0; i < win32_monitor_count; i++)
{
if (win32_monitor_all[i] != *hm_to_use)
continue;
*mon_id = i;
break;
}
}
memset(mon, 0, sizeof(*mon));
mon->cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
}
开发者ID:IlDucci,项目名称:RetroArch,代码行数:35,代码来源:win32_common.cpp
示例20: toggleFullscreen
void toggleFullscreen(bool isFullscreen)
{
MONITORINFO monitorInfo;
dwStyle = GetWindowLong(hWindow, GWL_STYLE);
if(isFullscreen)
{
if(dwStyle & WS_OVERLAPPEDWINDOW)
{
monitorInfo = { sizeof(MONITORINFO) };
if(GetWindowPlacement(hWindow, &wpPrev) && GetMonitorInfo(MonitorFromWindow(hWindow, MONITORINFOF_PRIMARY), &monitorInfo))
{
SetWindowLong(hWindow, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW);
SetWindowPos(hWindow, HWND_TOP, monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.top, monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left, monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top, SWP_NOZORDER | SWP_FRAMECHANGED);
}
}
ShowCursor(FALSE);
}
else
{
SetWindowLong(hWindow, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW);
SetWindowPlacement(hWindow, &wpPrev);
SetWindowPos(hWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_FRAMECHANGED);
ShowCursor(TRUE);
}
}
开发者ID:ChetanGandhi,项目名称:vulkan,代码行数:28,代码来源:win32Window.cpp
注:本文中的MonitorFromWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论