rendered paste body#include <windows.h>LRESULT CALLBACK ViestinKasittelija( HWND hWnd, UINT Viesti, WPARAM wParam, LPARAM lParam );HRESULT LuoIkkuna( HINSTANCE hInstance, int nCmdShow); MSG viesti;int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPreviousInstance, LPSTR lpCmdLine, int nCmdShow ) { LuoIkkuna( hInstance, nCmdShow ); while(viesti.message != WM_QUIT) { if( PeekMessage( &viesti, NULL, 0U, 0U, PM_REMOVE ) ) { TranslateMessage( &viesti ); DispatchMessage( &viesti ); } else { } UnregisterClass( "IkkunaLuokanNimi", hInstance ); return 0;}HRESULT LuoIkkuna( HINSTANCE hInstance, int nCmdShow){ HWND hWnd; /* WindowHandle, kahva ikkunan ilmentymään */ WNDCLASS wc; /* Ikkunaluokka */ wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = ViestinKasittelija; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon((HINSTANCE) NULL, IDI_APPLICATION); wc.hCursor = LoadCursor((HINSTANCE) NULL,IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName = "IkkunaLuokanNimi"; if(!RegisterClass(&wc)) return FALSE; hWnd = CreateWindow( "IkkunaLuokanNimi", "Esimerkkiohjelma", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, (HWND) NULL, (HMENU) NULL, hInstance, (LPVOID) NULL ); if( !hWnd ) { return FALSE; } ShowWindow( hWnd, nCmdShow ); UpdateWindow( hWnd ); return S_OK;}LRESULT CALLBACK ViestinKasittelija( HWND hWnd, UINT viesti, WPARAM wParam, LPARAM lParam ){ switch( viesti ) { case WM_DESTROY: { PostQuitMessage( 0 ); return TRUE; break; } } return DefWindowProc( hWnd, viesti, wParam, lParam );}}