mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[MSPAINT] Don't allow to set image as wallpaper if it has the wrong format (#4924)
CORE-18661 Our Paint allows user to try to set a .ico file as a wallpaper, which isn't possible. Different Windows versions have different behaviour, so it was decided that the simplest fix would be to just grey out "Set as wallpaper" buttons as in 2K3 (See the Jira ticket).
This commit is contained in:
parent
bfe06cbfca
commit
d395c30967
1 changed files with 7 additions and 3 deletions
|
@ -280,14 +280,18 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO
|
|||
BOOL trueSelection =
|
||||
(::IsWindowVisible(selectionWindow) &&
|
||||
((toolsModel.GetActiveTool() == TOOL_FREESEL) || (toolsModel.GetActiveTool() == TOOL_RECTSEL)));
|
||||
BOOL isBMP;
|
||||
switch (lParam)
|
||||
{
|
||||
case 0: /* File menu */
|
||||
if ((HMENU)wParam != GetSubMenu(menu, 0))
|
||||
break;
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(isAFile));
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(isAFile));
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(isAFile));
|
||||
|
||||
isBMP = _wcsicmp(PathFindExtensionW(filepathname), L".bmp") == 0;
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERPLANE, ENABLED_IF(isAFile && isBMP));
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERCENTERED, ENABLED_IF(isAFile && isBMP));
|
||||
EnableMenuItem(menu, IDM_FILEASWALLPAPERSTRETCHED, ENABLED_IF(isAFile && isBMP));
|
||||
|
||||
RemoveMenu(menu, IDM_FILE1, MF_BYCOMMAND);
|
||||
RemoveMenu(menu, IDM_FILE2, MF_BYCOMMAND);
|
||||
RemoveMenu(menu, IDM_FILE3, MF_BYCOMMAND);
|
||||
|
|
Loading…
Reference in a new issue