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 |
if(lParam ==(LPARAM)hwndbutton3) { if(HIWORD(wParam) ==BN_CLICKED) { hwndEdit=CreateWindow(TEXT("edit"), NULL, WS_CHILD|WS_VISIBLE||WS_BORDER|ES_LEFT, 21,40,21,100, hwnd, (HMENU) ID_EDIT, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); } } |
Anonymous
unregistriert
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HDC hdc; RECT rect; static HWND hwndbutton1; static HWND hwndbutton2; static HWND hwndbutton3; static HWND hwndbutton4; static HWND hwndbutton5; static HWND hwndbutton6; static HWND hwndbutton7; static HWND hwndbutton8; static HWND hwndbutton9; static HWND hwndEdit; switch (message) { case WM_CREATE: //Button1 hwndbutton1=CreateWindow( L"button", L"Schüler hinzufügen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 0,0,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button2 hwndbutton2=CreateWindow( L"button", L"Schüler bearbeiten", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 201,0,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button3 hwndbutton3=CreateWindow( L"button", L"Klasse hinzufügen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 401,0,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button4 hwndbutton4=CreateWindow( L"button", L"Klasse bearbeiten", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 601,0,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button5 hwndbutton5=CreateWindow( L"button", L"Noten eintragen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 0,21,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button6 hwndbutton6=CreateWindow( L"button", L"Arbeitsnoten eintragen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 201,21,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button7 hwndbutton7=CreateWindow( L"button", L"Schüler anzeigen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 401,21,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); //Button8 hwndbutton8=CreateWindow( L"button", L"Klasse anzeigen", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON , 601,21,200,20, hwnd, NULL, ((LPCREATESTRUCT) lParam)->hInstance, NULL); return 0; case WM_SETFOCUS: if(hwndEdit) { SetFocus (hwndEdit) ; return 0; } case WM_COMMAND: if (LOWORD (wParam) == ID_EDIT) if (HIWORD (wParam) ==EN_ERRSPACE || HIWORD (wParam) == EN_MAXTEXT) MessageBox (hwnd, TEXT ("Text zu lang!"), name, MB_OK | MB_ICONSTOP) ; if(lParam ==(LPARAM)hwndbutton1) { if(HIWORD(wParam) ==BN_CLICKED && anzahl_klassen==0) { MessageBox (hwnd ,TEXT("Hi Mama, du musst als erstes eine Klasse anlegen bevor du einen Schüler hinzufügst! Viele Grüße, Moritz") , TEXT ("Information von Moritz"), MB_ICONEXCLAMATION | MB_DEFBUTTON1 | MB_OK); } } if(lParam ==(LPARAM)hwndbutton3) { if(HIWORD(wParam) ==BN_CLICKED) { hwndEdit=CreateWindow(TEXT("edit"), NULL, WS_CHILD|WS_VISIBLE||WS_BORDER|ES_LEFT, 21,40,21,100, hwnd, (HMENU) ID_EDIT, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); } } return 0; case WM_DESTROY: PostQuitMessage (0); return 0; } return DefWindowProc (hwnd, message, wParam, lParam); } |
Zitat
Unhandled exception at 0x00401259 in win32api.exe: 0xC0000005: Access violation reading location 0x00030580.
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 |
case WM_SETFOCUS: if(hwndEdit) { SetFocus (hwndEdit) ; return 0; } case WM_COMMAND: |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
char buffer_klassenname[50]; int schüler; switch (message) { case WM_CREATE: //Editbox zur Eingabe des Klassennamens hwndEdit=CreateWindow(TEXT("edit"), buffer_klassenname, WS_CHILD|WS_BORDER|ES_LEFT, 21,100,100,21, hwnd, (HMENU) ID_EDIT, ((LPCREATESTRUCT) lParam) -> hInstance, NULL); |
Werbeanzeige