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 |
case WM_CTLCOLORSTATIC: { ::HWND hWndCtrl = reinterpret_cast<::HWND>(lParam); if (hWndCtrl == hMyStaticCtrl) { ::HDC hDC = reinterpret_cast<::HDC>(wParam); ::RECT rcClient = { 0 }; ::GetClientRect(hWndCtrl, &rcClient); ::HBRUSH hBrush = ::CreateSolidBrush(RGB(103, 13, 14)); ::FillRect(hDC, &rcClient, hBrush); ::DeleteObject(hBrush); ::SetBkMode(hDC, TRANSPARENT); } } |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
case WM_CTLCOLOREDIT: { ::HWND hWndCtrl = reinterpret_cast<::HWND>(lParam); if (hWndCtrl == vText[1]) { ::HDC hDC = reinterpret_cast<::HDC>(wParam); ::RECT rcClient ; ::GetClientRect(vText[1],&rcClient); ::HBRUSH hBrush = ::CreateSolidBrush(RGB(250, 13, 14)); ::FillRect(hDC, &rcClient, hBrush); ::DeleteObject(hBrush); ::SetBkMode(hDC, TRANSPARENT); } }break; |
Quellcode |
|
1 2 3 4 5 6 7 8 9 |
Test = CreateWindow ("STATIC", "Blub", WS_VISIBLE | WS_CHILD, 200,200, 50,440, hWnd, (HMENU) ID_TEST, hInst, NULL); |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
case WM_CTLCOLORSTATIC: { ::HWND hWndCtrl = reinterpret_cast<::HWND>(lParam); if (hWndCtrl == Test) { ::HDC hDC = reinterpret_cast<::HDC>(wParam); ::RECT rcClient ; ::GetClientRect(Test,&rcClient); ::HBRUSH hBrush = ::CreateSolidBrush(RGB(250, 13, 14)); ::FillRect(hDC, &rcClient, hBrush); ::DeleteObject(hBrush); ::SetBkMode(hDC, TRANSPARENT); } }break; |
C-/C++-Quelltext |
|
1 2 3 |
hTest = ::CreateWindowA("STATIC", "Blub", WS_VISIBLE | WS_CHILD, 200, 200, 50, 440, hWnd, reinterpret_cast<::HMENU>(IDC_STC_TEST), hInstance, NULL); if (hTest == NULL) throw std::runtime_error("could not create controls"); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
case WM_CTLCOLORSTATIC: { const ::HWND hWndCtrl(reinterpret_cast<::HWND>(lParam)); if (hWndCtrl == ::GetDlgItem(hWnd, IDC_STC_TEST)) { ::HDC hDC(reinterpret_cast<::HDC>(wParam)); // get rect ::RECT rect; ::GetClientRect(hWndCtrl, &rect); // fill rect ::HBRUSH hBrush(::CreateSolidBrush(RGB(250, 13, 14))); ::FillRect(hDC, &rect, hBrush); ::DeleteObject(hBrush); ::SetBkMode(hDC, TRANSPARENT); } }break; |
Werbeanzeige