From 3c2ae53449c29925fe8b8911d6062c2343f8bb4f Mon Sep 17 00:00:00 2001 From: MusicalProgrammer <38636805+MusicalProgrammer@users.noreply.github.com> Date: Tue, 23 Oct 2018 18:35:23 -0400 Subject: [PATCH] Added a ComboBox --- PropertyWindow.cpp | 25 +++++++++++++++++++++---- PropertyWindow.h | 3 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp index df9f211..73b946a 100644 --- a/PropertyWindow.cpp +++ b/PropertyWindow.cpp @@ -58,6 +58,7 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc if (!createWindowClass("propHWND",PropProc,hThisInstance)) return false; + _hwndProp = CreateWindowEx( WS_EX_TOOLWINDOW, "propHWND", @@ -72,6 +73,21 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc hThisInstance, NULL ); + + _explorerComboBox = CreateWindowEx( + NULL, + "COMBOBOX", + "Combo", + WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST, + 0, + 0, + 280, + 20, + _hwndProp, // parent + NULL, // menu + hThisInstance, + NULL + ); _propGrid = New_PropertyGrid(_hwndProp,IDC_PROPERTYGRID); @@ -117,7 +133,7 @@ bool PropertyWindow::onCreate(int x, int y, int sx, int sy, HMODULE hThisInstanc PropGrid_ExpandAllCatalogs(_propGrid); SetWindowLongPtr(_hwndProp,GWL_USERDATA,(LONG)this); - _redraw(); + _resize(); return true; } @@ -128,14 +144,15 @@ PropertyWindow::PropertyWindow(int x, int y, int sx, int sy, HMODULE hThisInstan void PropertyWindow::onResize() { - _redraw(); + _resize(); } -void PropertyWindow::_redraw() +void PropertyWindow::_resize() { RECT rect; GetClientRect(_hwndProp,&rect); SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE); + SetWindowPos(_explorerComboBox, NULL, 0, 0, rect.right, 20, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); } void PropertyWindow::SetProperties(Instance * instance) @@ -153,7 +170,7 @@ void PropertyWindow::SetProperties(Instance * instance) } PropGrid_ExpandAllCatalogs(_propGrid); SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this); - _redraw(); + _resize(); } void PropertyWindow::ClearProperties() diff --git a/PropertyWindow.h b/PropertyWindow.h index 22f93f8..7cc06e7 100644 --- a/PropertyWindow.h +++ b/PropertyWindow.h @@ -11,5 +11,6 @@ public: HWND _hwndProp; private: HWND _propGrid; - void _redraw(); + HWND _explorerComboBox; + void _resize(); }; \ No newline at end of file