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
/
/
블로그 내 검색
윈도우 타이틀 바
윈도우 타이틀바에 이벤트 표시하기
2009.01.01
윈도우 타이틀바에 이벤트 표시하기
URUZ-7
2009. 1. 1. 06:51
2009. 1. 1. 06:51
LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { TCHAR str1[]=TEXT("마우스 왼쪽 버튼을 눌렀습니다."); TCHAR str2[]=TEXT("마우스 오른쪽 버튼을 눌렀습니다."); TCHAR str3[128]; static int cnt_L = 0; static int cnt_R = 0; switch(iMessage) { case WM_DESTROY: PostQuitMessage(0); return 0; case WM_LBUTTONDOWN: { MessageBeep(MB_ICONHAND); wsprintf(str3,TEXT("Left Button Down Counter = %d"),cnt_L=cnt_L+1); SetWindowText(hWnd,str3); if(MessageBox(hWnd,str1,TEXT("메시지 박스"),MB_YESNO)==IDYES) { MessageBox(hWnd,TEXT("YES를 눌렀습니다."),TEXT("확인"),MB_OK); } else { MessageBox(hWnd,TEXT("NO를 눌렀습니다."),TEXT("확인"),MB_OK); } return 0; } case WM_RBUTTONDOWN: { MessageBeep(MB_ICONHAND); wsprintf(str3,TEXT("Right Button Down Counter = %d"),cnt_R=cnt_R+1); SetWindowText(hWnd,str3); if(MessageBox(hWnd,str2,TEXT("메시지 박스"),MB_YESNO)==IDYES) { MessageBox(hWnd,TEXT("YES를 눌렀습니다."),TEXT("확인"),MB_OK); } else { MessageBox(hWnd,TEXT("NO를 눌렀습니다."),TEXT("확인"),MB_OK); } return 0; } } return(DefWindowProc(hWnd,iMessage,wParam,lParam)); }
LBUTTONDOWN 의 cnt와 RBUTTONDOWN 의 cnt를 윈도우 타이틀 바에 보여준다.
단지 그것 뿐이야~
공유하기
게시글 관리
구독하기
Hisworld.tistory.com
PREV
이전
1
NEXT
다음
+ Recent posts
Powered by
Tistory
, Designed by
wallel
Rss Feed
and
Twitter
,
Facebook
,
Youtube
,
Google+
티스토리툴바