forked from Yuri213212/tetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defproc.h
41 lines (39 loc) · 876 Bytes
/
defproc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef DEFPROC_H_
#define DEFPROC_H_
//Fix bug of DefWindowProc
LRESULT myDefWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
switch (message){
case WM_NCRBUTTONDOWN:
return 0;
case WM_NCRBUTTONUP:
PostMessage(hwnd,WM_RBUTTONUP,0,lParam);
DefWindowProc(hwnd,WM_NCRBUTTONDOWN,wParam,lParam);
break;
case WM_NCLBUTTONDOWN:
switch (wParam){
case HTZOOM:
case HTREDUCE:
case HTCLOSE:
case HTHELP:
return 0;
}
break;
case WM_NCLBUTTONUP:
switch (wParam){
case HTZOOM:
case HTREDUCE:
case HTCLOSE:
case HTHELP:
PostMessage(hwnd,WM_LBUTTONUP,0,lParam);
DefWindowProc(hwnd,WM_NCLBUTTONDOWN,wParam,lParam);
}
break;
case WM_SYSCOMMAND:
if ((wParam&0xFFF0)==SC_MOVE&&(wParam&0x0F)){
return DefWindowProc(hwnd,message,SC_SIZE|9,lParam);
}
break;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}
#endif