Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
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 |
#include <windows.h> const char pcAppName[] = "Testapplication"; LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShowCmd) { HWND hWnd; MSG msg; WNDCLASSEX wc; wc.cbClsExtra = 0; wc.cbSize = sizeof(WNDCLASSEX); wc.cbWndExtra = 0; wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); wc.hCursor = LoadCursor(hInst, IDC_ARROW); wc.hIcon = LoadIcon(hInst, IDI_APPLICATION); wc.hIconSm = LoadIcon(hInst, IDI_APPLICATION); wc.hInstance = hInst; wc.lpfnWndProc = WndProc; wc.lpszClassName = pcAppName; wc.lpszMenuName = NULL; wc.style = CS_HREDRAW | CS_VREDRAW; if(!(RegisterClassEx(&wc))) { MessageBox(0, "Konnte Fensterklasse nicht initialisieren", pcAppName, MB_OK | MB_ICONASTERISK); return 0; } if(!(hWnd = CreateWindow(pcAppName, pcAppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, hInst, 0))) { MessageBox(0, "Konnte Fenster nicht erstellen", pcAppName, MB_OK | MB_ICONASTERISK); return 0; } ShowWindow(hWnd, nShowCmd); UpdateWindow(hWnd); while(GetMessage(&msg, hWnd, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: { return 0; } case WM_DESTROY: { PostQuitMessage(0); return 0; } } return DefWindowProc(hWnd, msg, wParam, lParam); } |
C-/C++-Quelltext |
|
1 2 3 4 5 |
case WM_DESTROY: { PostQuitMessage(0); return 0; } |
C-/C++-Quelltext |
|
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 |
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: { break; } case WM_PAINT: { break; } case WM_CLOSE: { PostQuitMessage(0); break; } default: { return DefWindowProc(hWnd, msg, wParam, lParam); } } } |
Sorry, war meine. Ich hab das nochmal ausprobiert und einige Punkte hatten sich da glaub ich eruebrigt. Aber ich hatte in etwa folgendes:Zitat von »"CW_Kovok"«
häh wieso ist denn deine Antwort verschwunden?
Werbeanzeige