https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aeffa57ec7ceacdc69321…
commit aeffa57ec7ceacdc6932110c45d8d2e42d178272
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed May 31 13:21:01 2023 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Wed May 31 13:21:01 2023 +0900
[MSPAINT] Fix textbox background by using WM_CTLCOLOREDIT
CORE-18867
---
base/applications/mspaint/canvas.cpp | 7 +++++++
base/applications/mspaint/canvas.h | 2 ++
2 files changed, 9 insertions(+)
diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp
index 4ce162aa18a..38951215c42 100644
--- a/base/applications/mspaint/canvas.cpp
+++ b/base/applications/mspaint/canvas.cpp
@@ -766,3 +766,10 @@ VOID CCanvasWindow::EndSelectionDrag(POINT ptUnZoomed)
m_hitSelection = HIT_NONE;
Invalidate(FALSE);
}
+
+LRESULT CCanvasWindow::OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ SetTextColor((HDC)wParam, paletteModel.GetFgColor());
+ SetBkMode((HDC)wParam, TRANSPARENT);
+ return (LRESULT)GetStockObject(NULL_BRUSH);
+}
diff --git a/base/applications/mspaint/canvas.h b/base/applications/mspaint/canvas.h
index f932902b370..e884fa4df2a 100644
--- a/base/applications/mspaint/canvas.h
+++ b/base/applications/mspaint/canvas.h
@@ -31,6 +31,7 @@ public:
MESSAGE_HANDLER(WM_MOUSEWHEEL, OnMouseWheel)
MESSAGE_HANDLER(WM_CANCELMODE, OnCancelMode)
MESSAGE_HANDLER(WM_CAPTURECHANGED, OnCaptureChanged)
+ MESSAGE_HANDLER(WM_CTLCOLOREDIT, OnCtlColorEdit)
END_MSG_MAP()
CCanvasWindow();
@@ -81,6 +82,7 @@ protected:
LRESULT OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnCaptureChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
+ LRESULT OnCtlColorEdit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnLRButtonDown(BOOL bLeftButton, UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled);
LRESULT OnLRButtonDblClk(BOOL bLeftButton, UINT nMsg, WPARAM wParam, LPARAM lParam,
BOOL& bHandled);