如果获取桌面区域大小,除去任务栏,注意任务栏是否隐藏?
解决方案 »
- 请教!如何修改vc工具条按键中的文字颜色
- ActiveX控件怎么把二进制数据传给C#
- 不动声色的注入你的dll
- 关于GetWindowRect/GetClientRect/SetFocus的2个问题
- 编写多线程需要牢牢记住的知识。
- 分别产生两个随机数x 0.0-1.0之间,y 0.01-0.15之间,怎么调用函数?
- 谁能介绍一本学习SDK的书,我想弄明白子类化的含义和运用!
- CTreeCtrl点击实时捕获check项
- 做一个内嵌应用程序(如嵌入一个ipod播放器)的网页都需要什么技术,求牛人指点
- 简单问题: 在VC中怎样改WINDOW的标题?
- 请指点迷津:关于windows设备管理原理?
- 如何解决这个重复编译的问题?
int cx = GetSystemMetrics(SM_CXSCREEN);
int cy = GetSystemMetrics(SM_CYSCREEN);
或
HDC hdcScreen = GetDC( NULL );
int cx = GetDeviceCaps( hdcScreen, HORZRES );
int cy = GetDeviceCaps( hdcScreen, VERTRES );
DeleteObject( hdcScreen );任务栏:
CWnd* pTaskWnd = FindWindow( _T("Shell_TrayWnd"), NULL );
if( pTaskWnd ) pTaskWnd->ShowWindow( FALSE );
SystemParametersInfo(SPI_GETWORKAREA, 0, (PVOID) &rc, 0);
LONG lStyle = GetWindowLong( pTaskWnd->GetSafeHwnd(), GWL_STYLE );
if( lStyle & WS_VISIBLE )
{
//可见
}
else
{
//隐藏
}
To get the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function.
LPDEVMODE gpCurrentMode;
gpCurrentMode = new DEVMODE;
flag = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, gpCurrentMode);
gpCurrentMode->dmFields = DM_BITSPERPEL | DM_PELSWIDTH |
DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY ; //格式化字符串
m_CurrentColorMode.Format(
"%d",gpCurrentMode->dmBitsPerPel);
m_CurrentDifferency.Format(
"%d * %d",
gpCurrentMode->dmPelsWidth,
gpCurrentMode->dmPelsHeight);
m_CurrentFrequency.Format(
"%d",gpCurrentMode->dmDisplayFrequency);
AfxMessageBox(m_CurrentDifferency); //显示分辨率
AfxMessageBox(m_CurrentColorMode); //色彩位数
delete gpCurrentMode;
gpCurrentMode=NULL;
我有说他的方法错吗?
可在我的机器上得到的RECT是错的,上下左右都是-858993460,何故?
已经OK了。