1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include <windows.h>
#include <iostream>
using namespace std;
LRESULT CALLBACK P(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE A,HINSTANCE B,LPSTR C,int d){
string title="Window";
char *b;
for(int i=0;i<title.length();i++)
b[i]=title[i];
HWND E;
MSG G;
WNDCLASS F={0};
F.hInstance=A;
F.lpszClassName=b;
F.lpfnWndProc=P;
F.hbrBackground=GetSysColorBrush(COLOR_3DFACE);
RegisterClass(&F);
CreateWindow(F.lpszClassName,b,0xcf0000|WS_VISIBLE,50,150,600,450,0,0,A,0);
while(GetMessage(&G,NULL,0,0)){
TranslateMessage(0);
DispatchMessage(0);
}return G.wParam;
}
LRESULT CALLBACK P(HWND A,UINT B,WPARAM C,LPARAM D){
switch(B){
case 0x2:
PostQuitMessage(0);
break;
default:
return DefWindowProc(A,B,C,D);
}
return 0;
}
|