https://git.reactos.org/?p=reactos.git;a=commitdiff;h=42ddd011ce7d6dad470484...
commit 42ddd011ce7d6dad470484bc8a0a579f60219e4a Author: Bișoc George fraizeraust99@gmail.com AuthorDate: Sun Dec 9 20:13:17 2018 +0100 Commit: Hermès BÉLUSCA - MAÏTO hermes.belusca-maito@reactos.org CommitDate: Sun Dec 9 20:13:17 2018 +0100
[OSK] Display the correct icon of the application. (#1105) --- base/applications/osk/main.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/base/applications/osk/main.c b/base/applications/osk/main.c index 6c1793353c..7f5a5e9869 100644 --- a/base/applications/osk/main.c +++ b/base/applications/osk/main.c @@ -58,6 +58,32 @@ int OSK_SetImage(int IdDlgItem, int IdResource) return TRUE; }
+/*********************************************************************** + * + * OSK_SetAppIcon + * + * Set the application's icon + */ +BOOL OSK_SetAppIcon() +{ + HICON hIconSmall; + + /* Load the icon */ + hIconSmall = LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDI_OSK), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE); + + /* Send a message window indicating that the icon has to be set */ + SendMessageW(Globals.hMainWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall); + + if (!hIconSmall) + { + /* If we fail then return FALSE and bail out */ + DestroyIcon(hIconSmall); + return FALSE; + } + + return TRUE; +} + /*********************************************************************** * * OSK_WarningProc @@ -119,6 +145,9 @@ int OSK_DlgInitDialog(HWND hDlg) /* Load the settings from the registry hive */ LoadDataFromRegistry();
+ /* Set the application's icon */ + OSK_SetAppIcon(); + /* Get screen info */ memset(&Pt, 0, sizeof(Pt)); monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY );