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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
int APIENTRY WinMain(HINSTANCE DERP,
HINSTANCE hp,
LPSTR CmdLine,
int cmdshow ){
//shortining up and tagging everything.
//first up the class of the window.
WNDCLASSEX WC;
// The windows handle is next
HWND hwnd;
// Now the messages sent back and forth telling the window what to do and when to do it (etc)
MSG mesg;
// I am not sure what the bool valye is for.
// Now on to making the Window
WC.cbSize = sizeof(WNDCLASSEX);
// Size of the window in pixels
WC.style = CS_BYTEALIGNCLIENT||CS_HREDRAW||CS_VREDRAW;
// The windows style
WC.lpfnWndProc = WndProc;
WC.cbClsExtra = 0;
WC.cbWndExtra = 0;
WC.hInstance = DERP;
WC.hIcon = LoadIcon(NULL, IDI_ASTERISK);
WC.hCursor = LoadCursor(NULL, IDC_CROSS);
WC.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WC.lpszMenuName = "Prototype(In Progress)";
WC.lpszClassName = "Class";
WC.hIconSm = LoadIcon(NULL, IDI_WARNING);
//Register the window class
if(!RegisterClassEx(&WC)){
return 0;
}
//class registered so now create the window
hwnd = CreateWindowEx(NULL,
"Class",
"Prototype(In Progress)",
WS_OVERLAPPEDWINDOW|
WS_VISIBLE|
WS_SYSMENU,
0,0,
950,500,
NULL,
NULL,
DERP,
NULL);
// We now check if the window creation was succsessful or a failure.
if(!hwnd){
return 0;
d = "false";// loop condition variable needs to be initialized
}
while(!d){
PeekMessage(&mesg, NULL, NULL, NULL, PM_REMOVE);
if (mesg.message - WM_QUIT){ // Check for the quit message
d = "true";
}else{ // otherwise send it to the library of events fired
TranslateMessage(&mesg);
DispatchMessage(&mesg);
}
}
}
|