http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=901 [º¹»ç]
¿ä»õ °øºÎÇÏ´À¶ó ±Û ¸¹ÀÌ ¿Ã¸®°Ô µÇ´Âµ¥;;
¾Æ·¡ ¼Ò½º ¿Ã·È±¸¿ä... 5:00:00 ¿¡¼ 0:00:00 ±îÁö ³»·Á¿À´Â ŸÀ̸ӿ¡ ´ëÇÑ ¼Ò½º¸¦
³×À̹ö Áö½ÄÀο¡ ¿Ã·È´õ´Ï , ÀÌ·¸°Ô ´äº¯ Áּ˴µ¥...
¼Ò½º°¡ ¾î·Á¿ö¼¿ä...Çؼ®ÀÌ Àß ¾ÈµÇ³×¿ä...;
ÁÖ¼®´Þ¾Æ¼ ... ¼³¸í ÂÉ±Ý ºÎŹµå¸±²²¿ä...
Unit³ª static µîµî... ÀÌ·± °Å ´Â ¾È½áºÁ¼; Àß ¸ð¸£°Ú³×¿ä..
(´õ ½¬¿î ¹æ¹ýÀ̳ª ±×·±°Å ÀÖÀ¸½Ã¸é °¡¸£ÃÄ ÁÖ¼¼¿ä...)
#include < windows.h >
#include < iostream >
using namespace std;
UINT_PTR nIDEvent = 0; // ŸÀÌ¸Ó ID ÀúÀå
static int nTimeCnt = 5; // 5ÃÊ°£ ŸÀ̸Ӹ¦ ÀÛµ¿½Ãŵ´Ï´Ù..
VOID CALLBACK TimerProc( HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime )
{
nTimeCnt--;
if( 0 == nTimeCnt)
{
cout << "kill" << endl;
::KillTimer(NULL, nIDEvent);
return;
}
cout << nTimeCnt << endl;
}
int main()
{
nIDEvent = ::SetTimer( NULL, 10, 1000, TimerProc );
cout << "µ¿À۽ð£: " << nTimeCnt << endl;
MSG Msg;
while((0 != nTimeCnt) && ::GetMessage( &Msg, NULL, 0, 0 ))
{
::TranslateMessage( &Msg );
::DispatchMessage( &Msg );
}
return 0;
}
|
Hit : 3206 Date : 2005/10/08 12:23
|