Win32SDK learning (1)

xiaoxiao2021-03-06  30

Write Win32 program using SDK

(1) Establish, register window. (2) Creating a window. (3) Display and update the window. (4) Creating a message loop. (5) Terminate the application. (6) window process. (7) Processing the message.

typedef struct {UINT style; WNDPROC lpfnWndProc; int cbClsExtra; int cbWndExtra; HINSTANCE hInstance; HICON hIcon; HCURSOR hCursor; HBRUSH hbrBackground; LPCTSTR lpszMenuName; LPCTSTR lpszClassName;} WNDCLASS, * PWNDCLASS; typedef struct {UINT cbSize; UINT style; WNDPROC lpfnWndProc ; int cbClsExtra; int cbWndExtra; hINSTANCE hInstance; HICON hIcon; hCURSOR hCursor; HBRUSH hbrBackground; LPCTSTR lpszMenuName; LPCTSTR lpszClassName; HICON hIconSm;} WNDCLASSEX, * PWNDCLASSEX; HWND CreateWindow (LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, hMENU hMenu, hINSTANCE hInstance, LPVOID lpParam); int WNDAPI WinMain (hINSTANCE hInstance, hINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow); LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) Aton RegisterClass (const wndclass * lpwndclass); Aton RegisterClassex (Const WndClassex) * Lpwcx); HWND CreateWindowEx (DWORD dwExStle, LPCTSTR IpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENUhMenu, HANDLE hlnstance, LPVOIDlpParam); LONG SetWindowLong (HWND hWnd, int nlndex , Long dwnewlong; modify the window properties. Modify the window properties.

About the use of the menu to create a modification delete

Menu in the window specified in the class specified LoadMenu CheckMenuItem EnableMenuItem ModifyMenu GetSystemMenu Menu System Menu Submenu TrackPopupMenu GetSubMenu createwindow the pop-up menu fast cut-click menu AppendMenu DeleteMenu InsertMenu ModifyMenu WM_COMMAND message transmission system transmits menu WM_SYSCOMMAND

Rundll.exe .., .., and rundll32.exe .., .., you can run functions in other DLLs.

转载请注明原文地址:https://www.9cbs.com/read-40572.html

New Post(0)