首页 > 代码库 > 【Win32】Windows
【Win32】Windows
#include <windows.h> LRESULT CALLBACK WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, uMsg, wParam, lParam); } int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { static TCHAR lpClassName[] = TEXT("Susake"); HWND hwnd; MSG msg; WNDCLASSEX wincl; wincl.cbSize = sizeof(WNDCLASSEX); wincl.style = NULL; wincl.lpfnWndProc = WindowProc; wincl.cbClsExtra = 0; wincl.cbWndExtra = 0; wincl.hInstance = hInstance; wincl.hIcon = NULL; wincl.hCursor = NULL; wincl.hbrBackground = NULL; wincl.lpszMenuName = NULL; wincl.lpszClassName = lpClassName; wincl.hIconSm = NULL; RegisterClassEx(&wincl); hwnd = CreateWindowEx(0, lpClassName, TEXT("Susake"), WS_OVERLAPPEDWINDOW, 0, 0, 800, 600, HWND_DESKTOP, NULL, hInstance, NULL); ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } UnregisterClass(lpClassName, wincl.hInstance); return msg.wParam; }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。