mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 12:02:02 +00:00
[OSK] Set also the large icon (that appears in the App Switcher) and move the code in OSK_DlgInitDialog().
This commit is contained in:
parent
12fdc129cf
commit
92763e2901
1 changed files with 11 additions and 29 deletions
|
@ -58,32 +58,6 @@ int OSK_SetImage(int IdDlgItem, int IdResource)
|
||||||
return TRUE;
|
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
|
* OSK_WarningProc
|
||||||
|
@ -134,7 +108,8 @@ INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPar
|
||||||
*/
|
*/
|
||||||
int OSK_DlgInitDialog(HWND hDlg)
|
int OSK_DlgInitDialog(HWND hDlg)
|
||||||
{
|
{
|
||||||
HMONITOR monitor;
|
HICON hIcon, hIconSm;
|
||||||
|
HMONITOR monitor;
|
||||||
MONITORINFO info;
|
MONITORINFO info;
|
||||||
POINT Pt;
|
POINT Pt;
|
||||||
RECT rcWindow;
|
RECT rcWindow;
|
||||||
|
@ -146,11 +121,18 @@ int OSK_DlgInitDialog(HWND hDlg)
|
||||||
LoadDataFromRegistry();
|
LoadDataFromRegistry();
|
||||||
|
|
||||||
/* Set the application's icon */
|
/* Set the application's icon */
|
||||||
OSK_SetAppIcon();
|
hIcon = LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDI_OSK), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE);
|
||||||
|
hIconSm = CopyImage(hIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_COPYFROMRESOURCE);
|
||||||
|
if (hIcon || hIconSm)
|
||||||
|
{
|
||||||
|
/* Set the window icons (they are deleted when the process terminates) */
|
||||||
|
SendMessageW(Globals.hMainWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
SendMessageW(Globals.hMainWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIconSm);
|
||||||
|
}
|
||||||
|
|
||||||
/* Get screen info */
|
/* Get screen info */
|
||||||
memset(&Pt, 0, sizeof(Pt));
|
memset(&Pt, 0, sizeof(Pt));
|
||||||
monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY );
|
monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
|
||||||
info.cbSize = sizeof(info);
|
info.cbSize = sizeof(info);
|
||||||
GetMonitorInfoW(monitor, &info);
|
GetMonitorInfoW(monitor, &info);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue