#include "stdio.h" #include "windows.h" int main( void ) { MSG a; HWND h = GetConsoleWindow(); while( 1 ) { GetMessage(&a,h,0,0); printf("消息:%d\n", a.message ); Sleep(100); } return 0; }
控制台窗口对你的程序来说不是真正的窗口,没有消息循环的
69,371
社区成员
243,080
社区内容
加载中
试试用AI创作助手写篇文章吧