1、获取屏幕分辨率
Windows API 获取屏幕分辨率 GetSystemMetrics ( )
int cxScreen = GetSystemMetrics (SM_CXSCREEN) ; // wide
int cyScreen = GetSystemMetrics (SM_CYSCREEN) ; // high
2、获取鼠标位置
#include "stdafx.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <locale.h>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
VOID CALLBACK Timer(HWND, UINT, UINT_PTR, DWORD)
{
POINT p;
GetCursorPos(&p);
cout<<p.x <<" "<<p.y<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
SetTimer(NULL, 1, 1000, Timer);
MessageBox(NULL, NULL, NULL, 0);
return 0;
}