作者vocaloid (vocaloid)
看板C_and_CPP
标题Re: [问题] 十分钟结束的程式???
时间Tue Feb 3 15:23:49 2009
http://tinyurl.com/ct5vsr
※ 引述《james732 (好人超)》之铭言:
: 刚刚写了一个小程式:
: #include <windows.h>
: #include <iostream>
:
: using namespace std;
:
: int main()
: {
: int stopflag = 0;
MSG ggc;
: cout << SetTimer(NULL, 0, 100, (TIMERPROC)NULL) << endl;
: while (!stopflag)
: {
while (GetMessage(&ggc, NULL, 0, 0)
{
if (ggc.message == WM_TIMER) {
stopflag = 1;
break;
}
// TranslateMessage(&ggc);
// DispatchMessage(&ggc);
}
: }
:
: cout << "ya" << endl;
:
: return 0;
: }
: 印出 SetTimer 的回传值并不是 0,应该是成功了
: 但是却一直等不到函式执行。
: 请问,它的问题出在哪里呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.0.65