tamaoh.blogg.se

How to write a windows program
How to write a windows program













how to write a windows program

The first function we arrive at is the WndProc function. Sometimes you may want to include, which will give you a few useful macros to use in Windows development. This includes all the headers you need in this application. Moving on we come to the include line #include. This syntax prevents Visual C++ from linking modules that you aren't going to need in your application. Well isn't this a whole mess of code! The first thing that you may have noticed is #define WIN32_LEAN_AND_MEAN. * Translate and dispatch to event queue*/ If (msg.message = WM_QUIT) //check for a quit message PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE) Hwnd = CreateWindowEx(NULL, //extended styleĭone = false //initialize loop condition variable *Ĝlass registerd, so now create window*/ WindowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO) WindowClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH) WindowClass.hCursor = LoadCursor(NULL, IDC_ARROW) WindowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION) WindowClass.style = CS_HREDRAW | CS_VREDRAW Int APIENTRY WinMain(HINSTANCE hInstance,īool done //flag saying when app is complete Return (DefWindowProc(hwnd,message,wParam,lParam)) * Switch message, condition that is met will execute*/ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) #pragma comment(linker, "/subsystem:windows")















How to write a windows program