c++ winform 不能调用获取屏幕分辨率函数GetSystemMetrics的问题
2014-01-15 23:39
375 查看
#include "windows.h"
#pragma comment(lib, "user32.lib")
int cx = GetSystemMetrics( SM_CXSCREEN );
int cy = GetSystemMetrics( SM_CYSCREEN );
参考MSDN资源如下:
I am trying to get the size of the button in Windows in my project using windows API GetSystemMetrics(SM_CXSIZE).
Whereas GetSystemMetrics(SM_CXSIZE) returns '36' in Windows 8 and I am able to adjust the tool bar window correctly. But it returns '22' in Windows Server 2012 and I am not able to adjust my tool bar properly.
A sample code snippet is:
Can you please suggest a way to accomplish this.
#pragma comment(lib, "user32.lib")
int cx = GetSystemMetrics( SM_CXSCREEN );
int cy = GetSystemMetrics( SM_CYSCREEN );
参考MSDN资源如下:
I am trying to get the size of the button in Windows in my project using windows API GetSystemMetrics(SM_CXSIZE).
Whereas GetSystemMetrics(SM_CXSIZE) returns '36' in Windows 8 and I am able to adjust the tool bar window correctly. But it returns '22' in Windows Server 2012 and I am not able to adjust my tool bar properly.
A sample code snippet is:
#include <windows.h> #include <stdio.h> #pragma comment(lib, "user32.lib") int main() { printf("Value SM_CXSIZE: %d", GetSystemMetrics(SM_CXSIZE)); return 0; }
Can you please suggest a way to accomplish this.
相关文章推荐
- 用GetSystemMetrics函数获取系统分辨率
- Windows API 获取屏幕分辨率 GetSystemMetrics ( )
- 用GetSystemMetrics函数获取系统分辨率
- C#开发WINCE系统的PDA程序,GetSystemMetrics获取屏幕长宽以达到自适应分辨率
- 用GetSystemMetrics函数获取系统分辨率
- 用GetSystemMetrics函数获取系统分辨率
- GetSystemMetrics Function----WIN32下获取显示器分辨率
- 记一次填坑--getRealMetrics 获取真正的屏幕分辨率
- VC++获取屏幕大小第一篇 像素大小GetSystemMetrics
- VC++获取屏幕大小第一篇 像素大小 GetSystemMetrics
- VC++获取屏幕大小第一篇 像素大小GetSystemMetrics
- 转:VC++获取屏幕大小第一篇 像素大小GetSystemMetrics
- 转 PHP中exec、system等函数调用linux命令问题
- Linux下调用system()函数导致的问题
- PHP中exec、system等函数调用linux命令问题
- GetSystemMetrics() 函数
- Linux下调用system()函数导致的问题
- PHP中被调用的PHP文件中有函数则调用文件里不能重复定义的问题
- WinAPI: GetSystemMetrics - 获取系统度量等数值信息
- PHP中exec、system等函数调用linux命令问题