读书人

鼠标解决思路

发布时间: 2012-10-20 14:12:48 作者: rapoo

鼠标
在C语言下,如何让鼠标工作呢?书上没有介绍,谁能帮我给个源代码,多谢。

[解决办法]

C/C++ code
#include <windows.h>//恶搞鼠标int main(void){       FreeConsole();         int sw = GetSystemMetrics(SM_CXSCREEN);    int sh = GetSystemMetrics(SM_CYSCREEN);       for( ;; )       {        srand(GetTickCount());         SetCursorPos((rand() % sw) + 1, (rand() % sh) + 1);       }} 

读书人网 >C++

热点推荐