All pastes #407617 Raw Edit

Untitled

public c v1 · immutable
#407617 ·published 2007-03-24 04:58 UTC
rendered paste body
#include <stdarg.h>#include <windef.h>#include <winbase.h>#include <winuser.h>void MessageLoop(MSG*, HWND)int main(void){   MSG msg;   HWND hwnd;   WNDCLASS wndclass;   HINSTANCE hInst = GetCurrentProcess();   wndclass.style = CS_VREDRAW | CS_HREDRAW;   wndclass.lpfnWndProc = &DefWindowProc;   wndclass.cbClsExtra = 0;   wndclass.cbWndExtra = 0;   wndclass.hInstance = hInst;   wndclass.hIcon = NULL;   wndclass.hCursor = GetCursor();   wndclass.hbrBackground = GetSysColorBrush(0);   wndclass.lpszMenuName = NULL;   wndclass.lpszClassName = "Sample window";   RegisterClass(&wndclass);   hwnd = CreateWindow(	"Sample window",	"Sample",	WS_OVERLAPPEDWINDOW,	35,	35,	765,	505,	NULL,	NULL,	hInst,	NULL   );   ShowWindow(hwnd,SW_SHOWDEFAULT);   MessageLoop(&msg,hwnd);   UnregisterClass("Sample window", hInst);}void MessageLoop(MSG* msg, HWND hwnd){   while(GetMessage(msg, hwnd, 0, 0) > 0)){	TranslateMessage(msg);	DispatchMessage(msg);   }}