⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getdisplayworkarea.cpp

📁 hl2 source code. Do not use it illegal.
💻 CPP
字号:
/*----------------------------------------------------------------------
Copyright (c) 1998,1999 Gipsysoft. All Rights Reserved.
Please see the file "licence.txt" for licencing details.
File:	GetDisplayWorkArea.cpp
Owner:	russf@gipsysoft.com
Purpose:	<Description of module>.
----------------------------------------------------------------------*/
#include "stdafx.h"
#pragma warning( disable: 4706 )
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>

extern void GetDisplayWorkArea( HWND hwnd, RECT &rc );
extern void GetDisplayWorkArea( POINT pt, RECT &rc );

void GetDisplayWorkArea( HWND hwnd, RECT &rc )
{
	HMONITOR hMon = MonitorFromWindow( hwnd, MONITOR_DEFAULTTONEAREST );
	if( hMon )
	{
		MONITORINFO m = { sizeof( m ) };
		if( GetMonitorInfo( hMon, &m ) )
		{
			rc = m.rcWork;
		}
	}
}


void GetDisplayWorkArea( POINT pt, RECT &rc )
{
	HMONITOR hMon = MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST );
	if( hMon )
	{
		MONITORINFO m = { sizeof( m ) };
		if( GetMonitorInfo( hMon, &m ) )
		{
			rc = m.rcWork;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -