📄 winuser.h
字号:
/* winuser.h*//* * Copyright (c) 1999, 2000 Greg Haerr <greg@censoft.com> * * Win32 USER structures and API */#include "winctl.h" /* required compatibility for resource compiler*//* moved from windef.h for resource compiler*/typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);typedef LRESULT (CALLBACK* DLGPROC)(HWND, UINT, WPARAM, LPARAM);/* win api*/LRESULT WINAPI DefWindowProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);/* Class styles*/#define CS_VREDRAW 0x0001#define CS_HREDRAW 0x0002#define CS_DBLCLKS 0x0008#define CS_OWNDC 0x0020#define CS_CLASSDC 0x0040#define CS_PARENTDC 0x0080#define CS_NOCLOSE 0x0200#define CS_SAVEBITS 0x0800#define CS_BYTEALIGNCLIENT 0x1000#define CS_BYTEALIGNWINDOW 0x2000#define CS_GLOBALCLASS 0x4000typedef struct tagWNDCLASSA { MWLIST link; /* microwin*/ UINT style; WNDPROC lpfnWndProc; int cbClsExtra; /* nyi*/ int cbWndExtra; HINSTANCE hInstance; /* nyi*/ HICON hIcon; /* nyi*/ HCURSOR hCursor; /* nyi*/ HBRUSH hbrBackground; LPCSTR lpszMenuName; /* nyi*/ LPCSTR lpszClassName; CHAR szClassName[40]; /* microwin*/} WNDCLASS, *PWNDCLASS, NEAR *NPWNDCLASS, FAR *LPWNDCLASS;ATOM WINAPI RegisterClass(CONST WNDCLASS *lpWndClass);/* * Message structure */typedef struct tagMSG { MWLIST link; /* microwin*/ HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; POINT pt;} MSG, *PMSG, NEAR *NPMSG, FAR *LPMSG;#define POINTSTOPOINT(pt, pts) \ { (pt).x = (LONG)(SHORT)LOWORD(*(LONG*)&pts); \ (pt).y = (LONG)(SHORT)HIWORD(*(LONG*)&pts); }#define POINTTOPOINTS(pt) (MAKELONG((short)((pt).x), (short)((pt).y)))#define MAKEWPARAM(l, h) (WPARAM)MAKELONG(l, h)#define MAKELPARAM(l, h) (LPARAM)MAKELONG(l, h)#define MAKELRESULT(l, h) (LRESULT)MAKELONG(l, h)/* window messages*/#define WM_NULL 0x0000#define WM_CREATE 0x0001#define WM_DESTROY 0x0002#define WM_MOVE 0x0003#define WM_SIZE 0x0005#define WM_ACTIVATE 0x0006#define WM_SETFOCUS 0x0007#define WM_KILLFOCUS 0x0008#define WM_ENABLE 0x000A#define WM_SETTEXT 0x000C#define WM_GETTEXT 0x000D#define WM_GETTEXTLENGTH 0x000E#define WM_PAINT 0x000F#define WM_CLOSE 0x0010#define WM_QUIT 0x0012#define WM_ERASEBKGND 0x0014#define WM_SHOWWINDOW 0x0018#define WM_SETFONT 0x0030#define WM_GETFONT 0x0031#define WM_WINDOWPOSCHANGED 0x0047#define WM_NCCALCSIZE 0x0083#define WM_NCHITTEST 0x0084#define WM_NCPAINT 0x0085#define WM_GETDLGCODE 0x0087#define WM_NCMOUSEMOVE 0x00A0#define WM_NCLBUTTONDOWN 0x00A1#define WM_NCLBUTTONUP 0x00A2#define WM_NCLBUTTONDBLCLK 0x00A3#define WM_NCRBUTTONDOWN 0x00A4#define WM_NCRBUTTONUP 0x00A5#define WM_NCRBUTTONDBLCLK 0x00A6#define WM_KEYFIRST 0x0100#define WM_KEYDOWN 0x0100#define WM_KEYUP 0x0101#define WM_CHAR 0x0102#define WM_DEADCHAR 0x0103 /* notimp*/#define WM_SYSKEYDOWN 0x0104 /* nyi*/#define WM_SYSKEYUP 0x0105 /* nyi*/#define WM_SYSCHAR 0x0106 /* nyi*/#define WM_SYSDEADCHAR 0x0107 /* notimp*/#define WM_KEYLAST 0x0108#define WM_COMMAND 0x0111#define WM_TIMER 0x0113#define WM_HSCROLL 0x0114#define WM_VSCROLL 0x0115#define WM_MOUSEFIRST 0x0200#define WM_MOUSEMOVE 0x0200#define WM_LBUTTONDOWN 0x0201#define WM_LBUTTONUP 0x0202#define WM_LBUTTONDBLCLK 0x0203#define WM_RBUTTONDOWN 0x0204#define WM_RBUTTONUP 0x0205#define WM_RBUTTONDBLCLK 0x0206#define WM_MBUTTONDOWN 0x0207#define WM_MBUTTONUP 0x0208#define WM_MBUTTONDBLCLK 0x0209#define WM_MOUSEWHEEL 0x020A#define WM_MOUSELAST 0x020A#define WM_CARET_CREATE 0x03E0 /* Microwindows only*/#define WM_CARET_DESTROY 0x03E1 /* Microwindows only*/#define WM_CARET_BLINK 0x03E2 /* Microwindows only*/#define WM_FDINPUT 0x03F0 /* Microwindows only*/#define WM_FDOUTPUT 0x03F1 /* Microwindows only*/#define WM_FDEXCEPT 0x03F2 /* Microwindows only*/#define WM_USER 0x0400/* WM_ACTIVATE state values*/#define WA_INACTIVE 0#define WA_ACTIVE 1#define WA_CLICKACTIVE 2/* WM_NCHITTEST codes*/#define HTERROR (-2)#define HTTRANSPARENT (-1)#define HTNOWHERE 0#define HTCLIENT 1#define HTCAPTION 2#define HTSYSMENU 3#define HTGROWBOX 4#define HTSIZE HTGROWBOX#define HTMENU 5#define HTHSCROLL 6#define HTVSCROLL 7#define HTMINBUTTON 8#define HTMAXBUTTON 9#define HTLEFT 10#define HTRIGHT 11#define HTTOP 12#define HTTOPLEFT 13#define HTTOPRIGHT 14#define HTBOTTOM 15#define HTBOTTOMLEFT 16#define HTBOTTOMRIGHT 17#define HTBORDER 18#define HTREDUCE HTMINBUTTON#define HTZOOM HTMAXBUTTON#define HTSIZEFIRST HTLEFT#define HTSIZELAST HTBOTTOMRIGHT#define HTOBJECT 19#define HTCLOSE 20#define HTHELP 21/* WM_SIZE wparam values*/#define SIZE_RESTORED 0#define SIZE_MINIMIZED 1#define SIZE_MAXIMIZED 2#define SIZE_MAXSHOW 3#define SIZE_MAXHIDE 4LRESULT WINAPI CallWindowProc(WNDPROC lpPrevWndFunc, HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);LRESULT WINAPI SendMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);BOOL WINAPI PostMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam);BOOL WINAPI PostThreadMessage(DWORD dwThreadId, UINT Msg, WPARAM wParam, LPARAM lParam);VOID WINAPI PostQuitMessage(int nExitCode);/* PeekMessage options*/#define PM_NOREMOVE 0x0000#define PM_REMOVE 0x0001#define PM_NOYIELD 0x0002BOOL WINAPI PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, UINT wRemoveMsg);BOOL WINAPI GetMessage(LPMSG lpMsg,HWND hwnd,UINT wMsgFilterMin, UINT wMsgFilterMax);BOOL WINAPI TranslateMessage(CONST MSG *lpMsg);LONG WINAPI DispatchMessage(CONST MSG *lpMsg);/* note: the following struct is in reverse order from the * microsoft version since WINAPI is cdecl in this implementation */typedef struct tagCREATESTRUCT { DWORD dwExStyle; LPCSTR lpszClass; LPCSTR lpszName; LONG style; int x; int y; int cx; int cy; HWND hwndParent; HMENU hMenu; HINSTANCE hInstance; LPVOID lpCreateParams;} CREATESTRUCT, *LPCREATESTRUCT;/* * Window Styles */#define WS_OVERLAPPED 0x00000000L#define WS_POPUP 0x80000000L#define WS_CHILD 0x40000000L#define WS_MINIMIZE 0x20000000L#define WS_VISIBLE 0x10000000L#define WS_DISABLED 0x08000000L#define WS_CLIPSIBLINGS 0x04000000L#define WS_CLIPCHILDREN 0x02000000L#define WS_MAXIMIZE 0x01000000L#define WS_CAPTION 0x00C00000L /* WS_BORDER | WS_DLGFRAME */#define WS_BORDER 0x00800000L#define WS_DLGFRAME 0x00400000L#define WS_VSCROLL 0x00200000L#define WS_HSCROLL 0x00100000L#define WS_SYSMENU 0x00080000L#define WS_THICKFRAME 0x00040000L#define WS_GROUP 0x00020000L#define WS_TABSTOP 0x00010000L#define WS_MINIMIZEBOX 0x00020000L#define WS_MAXIMIZEBOX 0x00010000L#define WS_TILED WS_OVERLAPPED#define WS_ICONIC WS_MINIMIZE#define WS_SIZEBOX WS_THICKFRAME#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW/* * Common Window Styles */#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | \ WS_CAPTION | \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -