Hisworld.tistory.com
The hisWorld
(140)
hisworld_new
(0)
hisOld
(138)
Android
(7)
Computer Vision
(18)
JAVA
(4)
C/C++
(26)
열혈강의 C
(32)
TCP/IP socket
(12)
WinAPI
(16)
System Programming
(0)
etc
(23)
Plan
(0)
hisWorld
(0)
hiStory
(0)
hiStudy
(0)
hiSnap
(0)
홈
태그
미디어로그
위치로그
방명록
Windows Live Messenger
winapi
Join C
대학생 공모전
The Turing test page
훈스닷넷
C/C++ Reference
WIKI
/
/
블로그 내 검색
Timer Text2
URUZ-7
2009. 1. 2. 07:09
2009. 1. 2. 07:09
/*=============================================== Program Title : Timer Text2 Name : siro-y Date : 2009/01/02 Version : 1.0 E-Mail : ms08th@hotmail.com ===============================================*/ #include <windows.h> LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM); HINSTANCE g_hInst; LPCTSTR lpszClass = TEXT("Timer Text2"); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) { HWND hWnd; MSG Message; WNDCLASS WndClass; g_hInst=hInstance; WndClass.cbClsExtra=0; WndClass.cbWndExtra=0; WndClass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH); WndClass.hCursor=LoadCursor(NULL,IDC_CROSS); WndClass.hIcon=LoadIcon(NULL,IDI_APPLICATION); WndClass.hInstance=hInstance; WndClass.lpfnWndProc=WndProc; WndClass.lpszClassName=lpszClass; WndClass.lpszMenuName=NULL; WndClass.style=CS_HREDRAW|CS_VREDRAW; RegisterClass(&WndClass); hWnd=CreateWindow(lpszClass,lpszClass,WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,CW_USEDEFAULT,300,600, NULL,(HMENU)NULL,hInstance,NULL); ShowWindow(hWnd,nCmdShow); while(GetMessage(&Message,NULL,0,0)) { TranslateMessage(&Message); DispatchMessage(&Message); } return (int)Message.wParam; } LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { HDC hdc; PAINTSTRUCT ps; static TCHAR *str[] = { TEXT("환상속의 그대"), TEXT("난 알아요"), TEXT("교실이데아"), TEXT("시대유감"), TEXT("Live Wire"), TEXT("F.M Business"), TEXT("Victim"), TEXT("MOAI"), TEXT("T'ik T'ak"), TEXT("울트라맨이야") }; static int i,j; static int y=500; switch(iMessage) { case WM_CREATE: SetTimer(hWnd,1,1000,NULL); SetTimer(hWnd,2,2000,NULL); SendMessage(hWnd, WM_TIMER, 1, 0); return 0; case WM_TIMER: switch(wParam) { case 1: hdc=GetDC(hWnd); TextOut(hdc,10,y=y-10,str[i],lstrlen(str[i])); InvalidateRect(hWnd,NULL,TRUE); ReleaseDC(hWnd,hdc); break; case 2: hdc=GetDC(hWnd); TextOut(hdc,10,y,str[i],lstrlen(str[i])); InvalidateRect(hWnd,NULL,TRUE); ReleaseDC(hWnd,hdc); break; } case WM_PAINT: hdc=BeginPaint(hWnd,&ps); TextOut(hdc,10,y,str[i=rand()%10],lstrlen(str[i])); // SetWindowText(hWnd,TEXT("WM_PAINT")); EndPaint(hWnd,&ps); return 0; case WM_DESTROY: KillTimer(hWnd,1); KillTimer(hWnd,2); PostQuitMessage(0); return 0; } return(DefWindowProc(hWnd,iMessage,wParam,lParam)); }
공유하기
게시글 관리
Hisworld.tistory.com
+ Recent posts
Powered by
Tistory
, Designed by
wallel
Rss Feed
and
Twitter
,
Facebook
,
Youtube
,
Google+
티스토리툴바