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
Sheddex
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 |
LRESULT Dmd::Window::Proc(HWND Window, UINT Message, WPARAM WParam, LPARAM LParam) { for (std::map<std::wstring, ComboBox>::iterator i = ComboBoxes.begin(); i != ComboBoxes.end(); ++i) i->second.Changed = false; switch (Message) { case WM_COMMAND: { for (std::map<std::wstring, ComboBox>::iterator i = ComboBoxes.begin(); i != ComboBoxes.end(); ++i) { if (LParam == reinterpret_cast<LPARAM>(i->second.Handle) && HIWORD(WParam) == CBN_SELCHANGE) i->second.Changed = true; if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 1", MB_OK); if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 2", MB_OK); } } break; } return 0; } |
Sheddex
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
for (std::map<std::wstring, ComboBox>::iterator i = ComboBoxes.begin(); i != ComboBoxes.end(); ++i) { if (LParam == reinterpret_cast<LPARAM>(i->second.Handle) && HIWORD(WParam) == CBN_SELCHANGE) i->second.Changed = true; else i->second.Changed = false; if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 1", MB_OK); if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 2", MB_OK); } |
Zitat von »"DragonFlame"«
1. Warum?
Zitat von »"DragonFlame"«
2. Nein tue ich nicht, wobei ich auch nicht wirklich weiß was du genau meinst.
Zitat von »"DragonFlame"«
@David_pb: Sie müssen doch irgendwo auf false gesetzt werden.
Ich kann das natürlich auch so machen (ist auch viel schöner):
C-/C++-Quelltext
1 2 3 4 5 6 7 8 9 10 11 12 13 14 for (std::map<std::wstring, ComboBox>::iterator i = ComboBoxes.begin(); i != ComboBoxes.end(); ++i) { if (LParam == reinterpret_cast<LPARAM>(i->second.Handle) && HIWORD(WParam) == CBN_SELCHANGE) i->second.Changed = true; else i->second.Changed = false; if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 1", MB_OK); if (i->second.Changed == true) ::MessageBoxW(NULL, L"Changed ist true", L"Info 2", MB_OK); }
Zitat von »"DragonFlame"«
Ändert aber nichts am Resultat...
Zitat von »"DragonFlame"«
Und warum soll ich keine zwei Boxen brauchen? VS hat auch 3, die man sofort sieht...
Sheddex
unregistriert
Sheddex
unregistriert
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 |
for (std::map<std::wstring, ListBox>::iterator i = ListBoxes.begin(); i != ListBoxes.end(); ++i) { if (LParam == reinterpret_cast<LPARAM>(i->second.Handle) && HIWORD(WParam) == LBN_SELCHANGE) i->second.Changed = true; } for (std::map<std::wstring, ComboBox>::iterator i = ComboBoxes.begin(); i != ComboBoxes.end(); ++i) { if (LParam == reinterpret_cast<LPARAM>(i->second.Handle) && HIWORD(WParam) == CBN_SELCHANGE) i->second.Changed = true; } |
C-/C++-Quelltext |
|
1 2 3 4 5 |
if (Window.CB_HasChanged(L"TestComboBox")) ::MessageBoxW(NULL, L"ComboBox has changed", NULL, 0); if (Window.LB_HasChanged(L"TestListBox")) ::MessageBoxW(NULL, L"ListBox has changed", NULL, 0); |
Zitat
@Deviloper: 1. Warum?
Werbeanzeige