reactos/reactos/dll/win32/shell32/shlmenu.c

986 lines
24 KiB
C
Raw Normal View History

/*
* see www.geocities.com/SiliconValley/4942/filemenu.html
*
* Copyright 1999, 2000 Juergen Schmied
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <precomp.h>
#ifdef FM_SEPARATOR
#undef FM_SEPARATOR
#endif
#define FM_SEPARATOR (LPCWSTR)1
static BOOL FileMenu_AppendItemW(HMENU hMenu, LPCWSTR lpText, UINT uID, int icon,
HMENU hMenuPopup, int nItemHeight);
typedef struct
{
BOOL bInitialized;
BOOL bFixedItems;
/* create */
COLORREF crBorderColor;
int nBorderWidth;
HBITMAP hBorderBmp;
/* insert using pidl */
LPITEMIDLIST pidl;
UINT uID;
UINT uFlags;
UINT uEnumFlags;
LPFNFMCALLBACK lpfnCallback;
} FMINFO, *LPFMINFO;
typedef struct
{ int cchItemText;
int iIconIndex;
HMENU hMenu;
WCHAR szItemText[1];
} FMITEM, * LPFMITEM;
static BOOL bAbortInit;
#define CCH_MAXITEMTEXT 256
WINE_DEFAULT_DEBUG_CHANNEL(shell);
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
static LPFMINFO FM_GetMenuInfo(HMENU hmenu)
{
MENUINFO MenuInfo;
LPFMINFO menudata;
MenuInfo.cbSize = sizeof(MENUINFO);
MenuInfo.fMask = MIM_MENUDATA;
if (! GetMenuInfo(hmenu, &MenuInfo))
return NULL;
menudata = (LPFMINFO)MenuInfo.dwMenuData;
if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO)))
{
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
ERR("menudata corrupt: %p %u\n", menudata, MenuInfo.cbSize);
return 0;
}
return menudata;
}
/*************************************************************************
* FM_SetMenuParameter [internal]
*
*/
static LPFMINFO FM_SetMenuParameter(
HMENU hmenu,
UINT uID,
LPCITEMIDLIST pidl,
UINT uFlags,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback)
{
LPFMINFO menudata;
TRACE("\n");
menudata = FM_GetMenuInfo(hmenu);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
SHFree(menudata->pidl);
menudata->uID = uID;
menudata->pidl = ILClone(pidl);
menudata->uFlags = uFlags;
menudata->uEnumFlags = uEnumFlags;
menudata->lpfnCallback = lpfnCallback;
return menudata;
}
/*************************************************************************
* FM_InitMenuPopup [internal]
*
*/
static int FM_InitMenuPopup(HMENU hmenu, LPCITEMIDLIST pAlternatePidl)
{ IShellFolder *lpsf, *lpsf2;
ULONG ulItemAttr = SFGAO_FOLDER;
UINT uID, uEnumFlags;
LPFNFMCALLBACK lpfnCallback;
LPCITEMIDLIST pidl;
WCHAR sTemp[MAX_PATH];
int NumberOfItems = 0, iIcon;
MENUINFO MenuInfo;
LPFMINFO menudata;
TRACE("%p %p\n", hmenu, pAlternatePidl);
MenuInfo.cbSize = sizeof(MENUINFO);
MenuInfo.fMask = MIM_MENUDATA;
if (! GetMenuInfo(hmenu, &MenuInfo))
return FALSE;
menudata = (LPFMINFO)MenuInfo.dwMenuData;
if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO)))
{
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
ERR("menudata corrupt: %p %u\n", menudata, MenuInfo.cbSize);
return 0;
}
if (menudata->bInitialized)
return 0;
pidl = (pAlternatePidl? pAlternatePidl: menudata->pidl);
if (!pidl)
return 0;
uID = menudata->uID;
uEnumFlags = menudata->uEnumFlags;
lpfnCallback = menudata->lpfnCallback;
menudata->bInitialized = FALSE;
SetMenuInfo(hmenu, &MenuInfo);
if (SUCCEEDED (SHGetDesktopFolder(&lpsf)))
{
if (SUCCEEDED(IShellFolder_BindToObject(lpsf, pidl,0,&IID_IShellFolder,(LPVOID *)&lpsf2)))
{
IEnumIDList *lpe = NULL;
if (SUCCEEDED (IShellFolder_EnumObjects(lpsf2, 0, uEnumFlags, &lpe )))
{
LPITEMIDLIST pidlTemp = NULL;
ULONG ulFetched;
while ((!bAbortInit) && (NOERROR == IEnumIDList_Next(lpe,1,&pidlTemp,&ulFetched)))
{
if (SUCCEEDED (IShellFolder_GetAttributesOf(lpsf, 1, (LPCITEMIDLIST*)&pidlTemp, &ulItemAttr)))
{
ILGetDisplayNameExW(NULL, pidlTemp, sTemp, ILGDN_FORPARSING);
if (! (PidlToSicIndex(lpsf, pidlTemp, FALSE, 0, &iIcon)))
iIcon = FM_BLANK_ICON;
if ( SFGAO_FOLDER & ulItemAttr)
{
LPFMINFO lpFmMi;
MENUINFO MenuInfo;
HMENU hMenuPopup = CreatePopupMenu();
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
lpFmMi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
lpFmMi->pidl = ILCombine(pidl, pidlTemp);
lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
MenuInfo.cbSize = sizeof(MENUINFO);
MenuInfo.fMask = MIM_MENUDATA;
Sync to Wine-20050930: Michael Jung <mjung@iss.tu-darmstadt.de> - Don't clone pidlLast in SHBindToParent. - Pass correct pointer to SHFree in case of failure in UNIXFS_path_to_pidl. - Return E_FAIL if we can't get the unix path in IPersistFolder3::InitializeEx. - Return E_NOAGGREGATION if non-NULL pUnkOuter is given to the constructor. Alexandre Julliard <julliard@winehq.org> - We are no longer generating .spec.c files. - Generate 16-bit spec files as assembly code too. - Use a more portable scheme for storing the name of a critical section. - Removed unused debug channels. - Specify 64-bit integers as double instead of long long in spec files so that we get the correct number of arguments. - We are no longer generating .dbg.c files. Milko Krachounov <milko@3mhz.net> - Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw, shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui, setupapi, wininet, regedit, uninstaller, notepad, winecfg and winhelp. Kevin Koltzau <kevin@plop.org> - Fix warnings in 64bit. Dmitry Timoshkov <dmitry@codeweavers.com> - Stop using a not initialized variable szTemp in _dbg_ILSimpleGetText, make _dbg_ILSimpleGetText return no value since nobody is using it. - Stop dereferencing a possible NULL in pdump since _dbg_ILGetDataPointer can potentially return NULL (for instance for root or desktop pidl). - Make shdebugstr_guid use standard wine_dbg_sprintf instead of the handmade solution. - Translate file name from unix to ANSI encoding in UnixFolder_IShellFolder2_GetDisplayNameOf. - Pass a locally modified version of SHELLEXECUTEINFO to IShellExecuteHookW_Execute, this should pass through at least sei_tmp.nShow retrieved from an .lnk file (fStartup). Alexander N. Sørnes <alex@thehandofagony.com> - Added Norwegian translation of comctl32 and shell32. Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com> - Update Finnish resources. svn path=/trunk/; revision=18348
2005-10-08 17:41:41 +00:00
MenuInfo.dwMenuData = (ULONG_PTR) lpFmMi;
SetMenuInfo (hMenuPopup, &MenuInfo);
FileMenu_AppendItemW (hmenu, sTemp, uID, iIcon, hMenuPopup, FM_DEFAULT_HEIGHT);
}
else
{
LPWSTR pExt = PathFindExtensionW(sTemp);
if (pExt)
*pExt = 0;
FileMenu_AppendItemW (hmenu, sTemp, uID, iIcon, 0, FM_DEFAULT_HEIGHT);
}
}
if (lpfnCallback)
{
TRACE("enter callback\n");
lpfnCallback ( pidl, pidlTemp);
TRACE("leave callback\n");
}
NumberOfItems++;
}
IEnumIDList_Release (lpe);
}
IShellFolder_Release(lpsf2);
}
IShellFolder_Release(lpsf);
}
if ( GetMenuItemCount (hmenu) == 0 )
{
static const WCHAR szEmpty[] = { '(','e','m','p','t','y',')',0 };
FileMenu_AppendItemW (hmenu, szEmpty, uID, FM_BLANK_ICON, 0, FM_DEFAULT_HEIGHT);
NumberOfItems++;
}
menudata->bInitialized = TRUE;
SetMenuInfo(hmenu, &MenuInfo);
return NumberOfItems;
}
/*************************************************************************
* FileMenu_Create [SHELL32.114]
*
* NOTES
* for non-root menus values are
* (ffffffff,00000000,00000000,00000000,00000000)
*/
HMENU WINAPI FileMenu_Create (
COLORREF crBorderColor,
int nBorderWidth,
HBITMAP hBorderBmp,
int nSelHeight,
UINT uFlags)
{
MENUINFO MenuInfo;
LPFMINFO menudata;
HMENU hMenu = CreatePopupMenu();
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("0x%08x 0x%08x %p 0x%08x 0x%08x hMenu=%p\n",
crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
menudata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
menudata->crBorderColor = crBorderColor;
menudata->nBorderWidth = nBorderWidth;
menudata->hBorderBmp = hBorderBmp;
MenuInfo.cbSize = sizeof(MENUINFO);
MenuInfo.fMask = MIM_MENUDATA;
Sync to Wine-20050930: Michael Jung <mjung@iss.tu-darmstadt.de> - Don't clone pidlLast in SHBindToParent. - Pass correct pointer to SHFree in case of failure in UNIXFS_path_to_pidl. - Return E_FAIL if we can't get the unix path in IPersistFolder3::InitializeEx. - Return E_NOAGGREGATION if non-NULL pUnkOuter is given to the constructor. Alexandre Julliard <julliard@winehq.org> - We are no longer generating .spec.c files. - Generate 16-bit spec files as assembly code too. - Use a more portable scheme for storing the name of a critical section. - Removed unused debug channels. - Specify 64-bit integers as double instead of long long in spec files so that we get the correct number of arguments. - We are no longer generating .dbg.c files. Milko Krachounov <milko@3mhz.net> - Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw, shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui, setupapi, wininet, regedit, uninstaller, notepad, winecfg and winhelp. Kevin Koltzau <kevin@plop.org> - Fix warnings in 64bit. Dmitry Timoshkov <dmitry@codeweavers.com> - Stop using a not initialized variable szTemp in _dbg_ILSimpleGetText, make _dbg_ILSimpleGetText return no value since nobody is using it. - Stop dereferencing a possible NULL in pdump since _dbg_ILGetDataPointer can potentially return NULL (for instance for root or desktop pidl). - Make shdebugstr_guid use standard wine_dbg_sprintf instead of the handmade solution. - Translate file name from unix to ANSI encoding in UnixFolder_IShellFolder2_GetDisplayNameOf. - Pass a locally modified version of SHELLEXECUTEINFO to IShellExecuteHookW_Execute, this should pass through at least sei_tmp.nShow retrieved from an .lnk file (fStartup). Alexander N. Sørnes <alex@thehandofagony.com> - Added Norwegian translation of comctl32 and shell32. Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com> - Update Finnish resources. svn path=/trunk/; revision=18348
2005-10-08 17:41:41 +00:00
MenuInfo.dwMenuData = (ULONG_PTR) menudata;
SetMenuInfo (hMenu, &MenuInfo);
return hMenu;
}
/*************************************************************************
* FileMenu_Destroy [SHELL32.118]
*
* NOTES
* exported by name
*/
void WINAPI FileMenu_Destroy (HMENU hmenu)
{
LPFMINFO menudata;
TRACE("%p\n", hmenu);
FileMenu_DeleteAllItems (hmenu);
menudata = FM_GetMenuInfo(hmenu);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
SHFree( menudata->pidl);
HeapFree(GetProcessHeap(), 0, menudata);
DestroyMenu (hmenu);
}
/*************************************************************************
* FileMenu_AppendItem [SHELL32.115]
*
*/
static BOOL FileMenu_AppendItemW(
HMENU hMenu,
LPCWSTR lpText,
UINT uID,
int icon,
HMENU hMenuPopup,
int nItemHeight)
{
MENUITEMINFOW mii;
LPFMITEM myItem;
LPFMINFO menudata;
MENUINFO MenuInfo;
TRACE("%p %s 0x%08x 0x%08x %p 0x%08x\n",
hMenu, (lpText!=FM_SEPARATOR) ? debugstr_w(lpText) : NULL,
uID, icon, hMenuPopup, nItemHeight);
ZeroMemory (&mii, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
if (lpText != FM_SEPARATOR)
{
int len = strlenW (lpText);
myItem = SHAlloc(sizeof(FMITEM) + len*sizeof(WCHAR));
strcpyW (myItem->szItemText, lpText);
myItem->cchItemText = len;
myItem->iIconIndex = icon;
myItem->hMenu = hMenu;
mii.fMask = MIIM_DATA;
Sync to Wine-20050930: Michael Jung <mjung@iss.tu-darmstadt.de> - Don't clone pidlLast in SHBindToParent. - Pass correct pointer to SHFree in case of failure in UNIXFS_path_to_pidl. - Return E_FAIL if we can't get the unix path in IPersistFolder3::InitializeEx. - Return E_NOAGGREGATION if non-NULL pUnkOuter is given to the constructor. Alexandre Julliard <julliard@winehq.org> - We are no longer generating .spec.c files. - Generate 16-bit spec files as assembly code too. - Use a more portable scheme for storing the name of a critical section. - Removed unused debug channels. - Specify 64-bit integers as double instead of long long in spec files so that we get the correct number of arguments. - We are no longer generating .dbg.c files. Milko Krachounov <milko@3mhz.net> - Bulgarian resources for mpr, msi, user, commdlg, oleaut32, shdocvw, shell32, comctl32, msrle32, mshtml, winspool, wineps, serialui, setupapi, wininet, regedit, uninstaller, notepad, winecfg and winhelp. Kevin Koltzau <kevin@plop.org> - Fix warnings in 64bit. Dmitry Timoshkov <dmitry@codeweavers.com> - Stop using a not initialized variable szTemp in _dbg_ILSimpleGetText, make _dbg_ILSimpleGetText return no value since nobody is using it. - Stop dereferencing a possible NULL in pdump since _dbg_ILGetDataPointer can potentially return NULL (for instance for root or desktop pidl). - Make shdebugstr_guid use standard wine_dbg_sprintf instead of the handmade solution. - Translate file name from unix to ANSI encoding in UnixFolder_IShellFolder2_GetDisplayNameOf. - Pass a locally modified version of SHELLEXECUTEINFO to IShellExecuteHookW_Execute, this should pass through at least sei_tmp.nShow retrieved from an .lnk file (fStartup). Alexander N. Sørnes <alex@thehandofagony.com> - Added Norwegian translation of comctl32 and shell32. Kimmo Myllyvirta <kimmo.myllyvirta@gmail.com> - Update Finnish resources. svn path=/trunk/; revision=18348
2005-10-08 17:41:41 +00:00
mii.dwItemData = (ULONG_PTR) myItem;
}
if ( hMenuPopup )
{ /* sub menu */
mii.fMask |= MIIM_TYPE | MIIM_SUBMENU;
mii.fType = MFT_OWNERDRAW;
mii.hSubMenu = hMenuPopup;
}
else if (lpText == FM_SEPARATOR )
{ mii.fMask |= MIIM_ID | MIIM_TYPE;
mii.fType = MFT_SEPARATOR;
}
else
{ /* normal item */
mii.fMask |= MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.fState = MFS_ENABLED | MFS_DEFAULT;
mii.fType = MFT_OWNERDRAW;
}
mii.wID = uID;
InsertMenuItemW (hMenu, (UINT)-1, TRUE, &mii);
/* set bFixedItems to true */
MenuInfo.cbSize = sizeof(MENUINFO);
MenuInfo.fMask = MIM_MENUDATA;
if (! GetMenuInfo(hMenu, &MenuInfo))
return FALSE;
menudata = (LPFMINFO)MenuInfo.dwMenuData;
if ((menudata == 0) || (MenuInfo.cbSize != sizeof(MENUINFO)))
{
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
ERR("menudata corrupt: %p %u\n", menudata, MenuInfo.cbSize);
return 0;
}
menudata->bFixedItems = TRUE;
SetMenuInfo(hMenu, &MenuInfo);
return TRUE;
}
/**********************************************************************/
BOOL WINAPI FileMenu_AppendItemAW(
HMENU hMenu,
LPCVOID lpText,
UINT uID,
int icon,
HMENU hMenuPopup,
int nItemHeight)
{
BOOL ret;
if (!lpText) return FALSE;
if (SHELL_OsIsUnicode() || lpText == FM_SEPARATOR)
ret = FileMenu_AppendItemW(hMenu, lpText, uID, icon, hMenuPopup, nItemHeight);
else
{
DWORD len = MultiByteToWideChar( CP_ACP, 0, lpText, -1, NULL, 0 );
LPWSTR lpszText = HeapAlloc ( GetProcessHeap(), 0, len*sizeof(WCHAR) );
if (!lpszText) return FALSE;
MultiByteToWideChar( CP_ACP, 0, lpText, -1, lpszText, len );
ret = FileMenu_AppendItemW(hMenu, lpszText, uID, icon, hMenuPopup, nItemHeight);
HeapFree( GetProcessHeap(), 0, lpszText );
}
return ret;
}
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
/*************************************************************************
* FileMenu_InsertUsingPidl [SHELL32.110]
*
* NOTES
* uEnumFlags any SHCONTF flag
*/
int WINAPI FileMenu_InsertUsingPidl (
HMENU hmenu,
UINT uID,
LPCITEMIDLIST pidl,
UINT uFlags,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback)
{
TRACE("%p 0x%08x %p 0x%08x 0x%08x %p\n",
hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
pdump (pidl);
bAbortInit = FALSE;
FM_SetMenuParameter(hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
return FM_InitMenuPopup(hmenu, NULL);
}
/*************************************************************************
* FileMenu_ReplaceUsingPidl [SHELL32.113]
*
* FIXME: the static items are deleted but won't be refreshed
*/
int WINAPI FileMenu_ReplaceUsingPidl(
HMENU hmenu,
UINT uID,
LPCITEMIDLIST pidl,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback)
{
TRACE("%p 0x%08x %p 0x%08x %p\n",
hmenu, uID, pidl, uEnumFlags, lpfnCallback);
FileMenu_DeleteAllItems (hmenu);
FM_SetMenuParameter(hmenu, uID, pidl, 0, uEnumFlags, lpfnCallback);
return FM_InitMenuPopup(hmenu, NULL);
}
/*************************************************************************
* FileMenu_Invalidate [SHELL32.111]
*/
void WINAPI FileMenu_Invalidate (HMENU hMenu)
{
FIXME("%p\n",hMenu);
}
/*************************************************************************
* FileMenu_FindSubMenuByPidl [SHELL32.106]
*/
HMENU WINAPI FileMenu_FindSubMenuByPidl(
HMENU hMenu,
LPCITEMIDLIST pidl)
{
FIXME("%p %p\n",hMenu, pidl);
return 0;
}
/*************************************************************************
* FileMenu_AppendFilesForPidl [SHELL32.124]
*/
int WINAPI FileMenu_AppendFilesForPidl(
HMENU hmenu,
LPCITEMIDLIST pidl,
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
BOOL bAddSeparator)
{
LPFMINFO menudata;
menudata = FM_GetMenuInfo(hmenu);
menudata->bInitialized = FALSE;
FM_InitMenuPopup(hmenu, pidl);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
if (bAddSeparator)
FileMenu_AppendItemW (hmenu, FM_SEPARATOR, 0, 0, 0, FM_DEFAULT_HEIGHT);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("%p %p 0x%08x\n",hmenu, pidl,bAddSeparator);
return 0;
}
/*************************************************************************
* FileMenu_AddFilesForPidl [SHELL32.125]
*
* NOTES
* uEnumFlags any SHCONTF flag
*/
int WINAPI FileMenu_AddFilesForPidl (
HMENU hmenu,
UINT uReserved,
UINT uID,
LPCITEMIDLIST pidl,
UINT uFlags,
UINT uEnumFlags,
LPFNFMCALLBACK lpfnCallback)
{
TRACE("%p 0x%08x 0x%08x %p 0x%08x 0x%08x %p\n",
hmenu, uReserved, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
return FileMenu_InsertUsingPidl ( hmenu, uID, pidl, uFlags, uEnumFlags, lpfnCallback);
}
/*************************************************************************
* FileMenu_TrackPopupMenuEx [SHELL32.116]
*/
BOOL WINAPI FileMenu_TrackPopupMenuEx (
HMENU hMenu,
UINT uFlags,
int x,
int y,
HWND hWnd,
LPTPMPARAMS lptpm)
{
TRACE("%p 0x%08x 0x%x 0x%x %p %p\n",
hMenu, uFlags, x, y, hWnd, lptpm);
return TrackPopupMenuEx(hMenu, uFlags, x, y, hWnd, lptpm);
}
/*************************************************************************
* FileMenu_GetLastSelectedItemPidls [SHELL32.107]
*/
BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
UINT uReserved,
LPCITEMIDLIST *ppidlFolder,
LPCITEMIDLIST *ppidlItem)
{
FIXME("0x%08x %p %p\n",uReserved, ppidlFolder, ppidlItem);
return 0;
}
#define FM_ICON_SIZE 16
#define FM_Y_SPACE 4
#define FM_SPACE1 4
#define FM_SPACE2 2
#define FM_LEFTBORDER 2
#define FM_RIGHTBORDER 8
/*************************************************************************
* FileMenu_MeasureItem [SHELL32.112]
*/
LRESULT WINAPI FileMenu_MeasureItem(
HWND hWnd,
LPMEASUREITEMSTRUCT lpmis)
{
LPFMITEM pMyItem = (LPFMITEM)(lpmis->itemData);
HDC hdc = GetDC(hWnd);
SIZE size;
LPFMINFO menuinfo;
TRACE("%p %p %s\n", hWnd, lpmis, debugstr_w(pMyItem->szItemText));
GetTextExtentPoint32W(hdc, pMyItem->szItemText, pMyItem->cchItemText, &size);
lpmis->itemWidth = size.cx + FM_LEFTBORDER + FM_ICON_SIZE + FM_SPACE1 + FM_SPACE2 + FM_RIGHTBORDER;
lpmis->itemHeight = (size.cy > (FM_ICON_SIZE + FM_Y_SPACE)) ? size.cy : (FM_ICON_SIZE + FM_Y_SPACE);
/* add the menubitmap */
menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
if (menuinfo->nBorderWidth)
lpmis->itemWidth += menuinfo->nBorderWidth;
TRACE("-- 0x%04x 0x%04x\n", lpmis->itemWidth, lpmis->itemHeight);
ReleaseDC (hWnd, hdc);
return 0;
}
/*************************************************************************
* FileMenu_DrawItem [SHELL32.105]
*/
LRESULT WINAPI FileMenu_DrawItem(
HWND hWnd,
LPDRAWITEMSTRUCT lpdis)
{
LPFMITEM pMyItem = (LPFMITEM)(lpdis->itemData);
COLORREF clrPrevText, clrPrevBkgnd;
int xi,yi,xt,yt;
HIMAGELIST hImageList;
RECT TextRect;
LPFMINFO menuinfo;
TRACE("%p %p %s\n", hWnd, lpdis, debugstr_w(pMyItem->szItemText));
if (lpdis->itemState & ODS_SELECTED)
{
clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHTTEXT));
clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_HIGHLIGHT));
}
else
{
clrPrevText = SetTextColor(lpdis->hDC, GetSysColor (COLOR_MENUTEXT));
clrPrevBkgnd = SetBkColor(lpdis->hDC, GetSysColor (COLOR_MENU));
}
CopyRect(&TextRect, &(lpdis->rcItem));
/* add the menubitmap */
menuinfo = FM_GetMenuInfo(pMyItem->hMenu);
if (menuinfo->nBorderWidth)
TextRect.left += menuinfo->nBorderWidth;
TextRect.left += FM_LEFTBORDER;
xi = TextRect.left + FM_SPACE1;
yi = TextRect.top + FM_Y_SPACE/2;
TextRect.bottom -= FM_Y_SPACE/2;
xt = xi + FM_ICON_SIZE + FM_SPACE2;
yt = yi;
ExtTextOutW (lpdis->hDC, xt , yt, ETO_OPAQUE, &TextRect, pMyItem->szItemText, pMyItem->cchItemText, NULL);
Shell_GetImageLists(0, &hImageList);
ImageList_Draw(hImageList, pMyItem->iIconIndex, lpdis->hDC, xi, yi, ILD_NORMAL);
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("-- 0x%04x 0x%04x 0x%04x 0x%04x\n", TextRect.left, TextRect.top, TextRect.right, TextRect.bottom);
SetTextColor(lpdis->hDC, clrPrevText);
SetBkColor(lpdis->hDC, clrPrevBkgnd);
return TRUE;
}
/*************************************************************************
* FileMenu_InitMenuPopup [SHELL32.109]
*
* NOTES
Sync to Wine-20050419: Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Mike McCormack <mike@codeweavers.com> - Remove an unused function. - Eliminate casts of the return value of HeapAlloc. - Convert path to unicode, rearrange to remove forward declaration. - Remove forward declarations of interface methods. - Remove some dead code and some ifdefs. - Use api definitions, remove duplicate code. - Fix usage of STGM_ enumerations, remove forward declaration. - Fix up PIDL dumping code. - Fix a regression in the file open dialog. Jon Griffiths <jon_p_griffiths@yahoo.com> - Use LMEM_ flags for LocalAlloc(), not GMEM_ (GlobalAlloc). Huw Davies <huw@codeweavers.com> - Fix the icon resource ids (most were off by one). - Fix IExtractIcon_{GetIconLocation,Extract} to use -ve icon resource ids and fix bugs relating to confusion between resource ids and the system imagelist indicies. - Extend the system imagelist initialization hack to load both +ve and -ve resource ids. - Add a printer icon (that'll be used by an upcoming printer folder patch). - When we're hiding file extensions then SetNameOf should append the original extension if SHGDN_FORPARSING isn't set. - The flags passed to SetNameOf refer to the dst string not the src pidl. - If ICommDlgBrowser_OnDefaultCommand returns anything other than S_OK then we should call the default handler. - Directory items should have the SFGOA_FILESYSANCESTOR attribute. Add a test for this and cleanup the shlfolder test a bit. - Better icon handling for some special folders. - Identify and add defines for a bunch of shell icons. - Add a unicode pidl type. - Improve support for PT_YAGUID. - Improve IShellLink debugging. Steven Edwards <steven_ed4153@yahoo.com> - Register Shell Drag and Drop Helper. Juan Lang <juan_lang@yahoo.com> - Use Unicode string result from GetDisplayNameOf if it isn't representable using ANSI. - Correct registering shell folders (values in Shell Folders key weren't getting written). Martin Fuchs <martin-fuchs@gmx.net> - switch to correct shell desktop context menu - launch desk.cpl when activating the desktop context menu entry "properties" - don't send WM_COMMAND if we didn't get a shell view window - Correct comments of some export ordinals. Peter Berg Larsen <pebl@math.ku.dk> - Replace strncpy with memcpy or lstrcpyn. Troy Rollo <wine@troy.rollo.name> - Fix SEGV for non-fully-qualified destination paths. - Don't fail ShFileOperationW if FOF_ALLOWUNDO is passed. Filip Navara <xnavara@volny.cz> - _dbg_ILGetNext returns NULL if pidl->mkid.cb is zero, fix the loops accordingly. Aric Stewart <aric@codeweavers.com> - For ShellExecuteExA we need to copy out the hProcess value from the W structure. svn path=/trunk/; revision=15024
2005-05-05 22:16:20 +00:00
* The filemenu is an ownerdrawn menu. Call this function responding to
* WM_INITPOPUPMENU
*
*/
BOOL WINAPI FileMenu_InitMenuPopup (HMENU hmenu)
{
FM_InitMenuPopup(hmenu, NULL);
return TRUE;
}
/*************************************************************************
* FileMenu_HandleMenuChar [SHELL32.108]
*/
LRESULT WINAPI FileMenu_HandleMenuChar(
HMENU hMenu,
WPARAM wParam)
{
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
FIXME("%p 0x%08lx\n",hMenu,wParam);
return 0;
}
/*************************************************************************
* FileMenu_DeleteAllItems [SHELL32.104]
*
* NOTES
* exported by name
*/
BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu)
{
MENUITEMINFOW mii;
LPFMINFO menudata;
int i;
TRACE("%p\n", hmenu);
ZeroMemory ( &mii, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_SUBMENU|MIIM_DATA;
for (i = 0; i < GetMenuItemCount( hmenu ); i++)
{ GetMenuItemInfoW(hmenu, i, TRUE, &mii );
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
SHFree((LPFMINFO)mii.dwItemData);
if (mii.hSubMenu)
FileMenu_Destroy(mii.hSubMenu);
}
while (DeleteMenu (hmenu, 0, MF_BYPOSITION)){};
menudata = FM_GetMenuInfo(hmenu);
menudata->bInitialized = FALSE;
return TRUE;
}
/*************************************************************************
* FileMenu_DeleteItemByCmd [SHELL32.117]
*
*/
BOOL WINAPI FileMenu_DeleteItemByCmd (HMENU hMenu, UINT uID)
{
MENUITEMINFOW mii;
TRACE("%p 0x%08x\n", hMenu, uID);
ZeroMemory ( &mii, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_SUBMENU;
GetMenuItemInfoW(hMenu, uID, FALSE, &mii );
if ( mii.hSubMenu )
{
/* FIXME: Do what? */
}
DeleteMenu(hMenu, MF_BYCOMMAND, uID);
return TRUE;
}
/*************************************************************************
* FileMenu_DeleteItemByIndex [SHELL32.140]
*/
BOOL WINAPI FileMenu_DeleteItemByIndex ( HMENU hMenu, UINT uPos)
{
MENUITEMINFOW mii;
TRACE("%p 0x%08x\n", hMenu, uPos);
ZeroMemory ( &mii, sizeof(MENUITEMINFOW));
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_SUBMENU;
GetMenuItemInfoW(hMenu, uPos, TRUE, &mii );
if ( mii.hSubMenu )
{
/* FIXME: Do what? */
}
DeleteMenu(hMenu, MF_BYPOSITION, uPos);
return TRUE;
}
/*************************************************************************
* FileMenu_DeleteItemByFirstID [SHELL32.141]
*/
BOOL WINAPI FileMenu_DeleteItemByFirstID(
HMENU hMenu,
UINT uID)
{
TRACE("%p 0x%08x\n", hMenu, uID);
return 0;
}
/*************************************************************************
* FileMenu_DeleteSeparator [SHELL32.142]
*/
BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu)
{
TRACE("%p\n", hMenu);
return 0;
}
/*************************************************************************
* FileMenu_EnableItemByCmd [SHELL32.143]
*/
BOOL WINAPI FileMenu_EnableItemByCmd(
HMENU hMenu,
UINT uID,
BOOL bEnable)
{
TRACE("%p 0x%08x 0x%08x\n", hMenu, uID,bEnable);
return 0;
}
/*************************************************************************
* FileMenu_GetItemExtent [SHELL32.144]
*
* NOTES
* if the menu is too big, entries are getting cut away!!
*/
DWORD WINAPI FileMenu_GetItemExtent (HMENU hMenu, UINT uPos)
{ RECT rect;
FIXME("%p 0x%08x\n", hMenu, uPos);
if (GetMenuItemRect(0, hMenu, uPos, &rect))
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
{ FIXME("0x%04x 0x%04x 0x%04x 0x%04x\n",
rect.right, rect.left, rect.top, rect.bottom);
return ((rect.right-rect.left)<<16) + (rect.top-rect.bottom);
}
return 0x00100010; /*FIXME*/
}
/*************************************************************************
* FileMenu_AbortInitMenu [SHELL32.120]
*
*/
void WINAPI FileMenu_AbortInitMenu (void)
{ TRACE("\n");
bAbortInit = TRUE;
}
/*************************************************************************
* SHFind_InitMenuPopup [SHELL32.149]
*
Vitaliy Margolen <wine-patch@kievinfo.com> - Michael Jung <mjung@iss.tu-darmstadt.de> Set all capability flags supported by the shellfolder, disregarding the flag mask given to GetAttributesOf. Unit tests to demonstrate this behaviour. Michael Jung <mjung@iss.tu-darmstadt.de> - Added some comments to document unixfs. - Fixed crash in unixfs shellfolder handling with winamp. - Implemented UnixFolder's IPersistPropertyBag::Load method. - Initialize COM prior to displaying the SHBrowseForFolder dialog. - More robust code for querying ShellFolder attributes (some ShellFolders ignore the flag mask in GetAttributesOf). - Remove iconcache pre-initialization hack, it's not necessary any more. - Move target folder initialization to a dedicated function. - Use this function in BindToObject (should be faster). - Special handling for FolderShortcut objects in Initialize method. - Removed a todo_wine from a no longer failing unit test. - Replaced tabs with spaces. Robert Shearman <rob@codeweavers.com> - Convert SHELL32_BindToChild to Unicode and fix up the callers. Vincent Bén <vberon@mecano.gme.usherb.ca> - Unicodify systray.c. - Move functions a bit to get rid of a static declaration. Dmitry Timoshkov <dmitry@codeweavers.com> - Correctly handle flags parameter in SHAddToRecentDocs. Martin Fuchs <martin-fuchs@gmx.net> - Correct WINAPI position for MSVC portability. Mike McCormack <mike@codeweavers.com> - Partially implement and test the shelllink object's IShellLinkDataList::CopyDataBlock and GetFlags methods. - Use advapi32.CommandLineFromMsiDescriptor to get msi component paths. - Pass the correct verb. Add a space between extra parameters. Wait for ShellExecute to complete. - Handle MSI advertised shortcuts in the shelllink object. - Implement IContextMenu::QueryContextMenu and IContextMenu::InvokeCommand. - Add the IObjectWithSite interface. - Invoke shortcuts through IContextMenu, rather than trying to access them directly. - Fix a problem spotted by Dmitry and another one stopping correctly formatted lnk files from being generated. svn path=/trunk/; revision=19356
2005-11-20 08:41:46 +00:00
* Get the IContextMenu instance for the submenu of options displayed
* for the Search entry in the Classic style Start menu.
*
* PARAMETERS
* hMenu [in] handle of menu previously created
* hWndParent [in] parent window
* w [in] no pointer (0x209 over here) perhaps menu IDs ???
* x [in] no pointer (0x226 over here)
*
* RETURNS
* LPXXXXX pointer to struct containing a func addr at offset 8
* or NULL at failure.
*/
IContextMenu * WINAPI SHFind_InitMenuPopup (HMENU hMenu, HWND hWndParent, UINT w, UINT x)
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
{
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
FIXME("hmenu=%p hwnd=%p 0x%08x 0x%08x stub\n",
hMenu,hWndParent,w,x);
return NULL; /* this is supposed to be a pointer */
}
/*************************************************************************
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
* _SHIsMenuSeparator (internal)
*/
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
static BOOL _SHIsMenuSeparator(HMENU hm, int i)
{
MENUITEMINFOW mii;
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_TYPE;
mii.cch = 0; /* WARNING: We MUST initialize it to 0*/
if (!GetMenuItemInfoW(hm, i, TRUE, &mii))
{
return(FALSE);
}
if (mii.fType & MFT_SEPARATOR)
{
return(TRUE);
}
return(FALSE);
}
Sync to Wine-20050628: Dmitry Timoshkov <dmitry@codeweavers.com> - Make remaining OLE interface vtables const. Mike McCormack <mike@codeweavers.com> - SHCreateStreamOnFileW is implemented in shlwapi, so we don't need another implementation in shell32. - Add a cast to get rid of a warning. - Warning fixes for -Wmissing-declarations and -Wwrite-strings. - Make functions static. - -Wpointer-sign fixes. - forward AddRef, Release, QueryInterface and GetClassID to internal implementations - implement GetClassID properly - Switch IShellLink to use shlwapi.SHCreateStreamOnFileW. - Remove some uses of wine/unicode.h functions. - Add the IContextMenu interface to the ShellLink object. - Implement ShellLink's IShellExtInit::Initialize() method. - add the IShellExtInit interface to the ShellLink object - use inline functions rather than macros to resolve the implementation pointer from an interface pointer - Add the IShellLinkDataList interface to the ShellLink object. Michael Jung <mjung@iss.tu-darmstadt.de> - Use the CallForAttributes registry value, instead of promoting the root folder's SFGAO_FILESYSTEM flag to the registry. - Return the correct attributes for the desktop folder. - Corresponding tests. - Support for shellfolder's CallForAttributes registry value. - Let BindToObject fail, if called with empty relative pidl. - Tests to show that it should do so. - Fix SHBrowseForFolder to not pass an empty pidl to BindToObject. - Fix a lurking infinite loop in SHGetPathFromIDList. - Support for shellfolder's CallForAttributes registry value. - Use SHGetPathFromIDList instead of SHELL32_GetPathFromIDList. - Implement SHGetPathFromIDList based on GetDisplayNameOf. Stefan Doesinger <stefandoesinger@gmx.at> - Handle cidl==0 in shfldr_desktop, shfldr_fs and shfldr_mycomp. - Remove the dwAttributes member from the IGenericSFImpl class, it's not needed and can't be initialised in Initialize and InitializeEx. Vitaly Lipatov <lav@etersoft.ru> - Realize DoEnvironmentSubstA via ExpandEnvironmentStringsA. - Fix types and return values. - Add prototype into shellapi.h. Aric Stewart <aric@codeweavers.com> - Fix the BrowseForFolder dialog so that when it does the callbacks it uses the correct message instead of always sending BEFM_INITIALIZED. Juan Lang <juan_lang@yahoo.com> - Const-ify a mask. - Set default for "My Documents" to $HOME, and "Desktop" to ~/Desktop. Alexandre Julliard <julliard@winehq.org> - Sort entry points in the same order as Windows. Francois Gouget <fgouget@free.fr> - Fix winapi_check documentation warnings. Marcus Meissner <marcus@jet.franken.de> - ExtractAssociatedIconA needs to allocate enough space to have EAIW fill in lpIconPathW. Huw Davies <huw@codeweavers.com> - Unquote the icon file path if it's quoted. svn path=/trunk/; revision=17060
2005-08-05 07:48:18 +00:00
/*************************************************************************
* Shell_MergeMenus [SHELL32.67]
*/
UINT WINAPI Shell_MergeMenus (HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
{ int nItem;
HMENU hmSubMenu;
BOOL bAlreadySeparated;
MENUITEMINFOW miiSrc;
WCHAR szName[256];
UINT uTemp, uIDMax = uIDAdjust;
----------------------------------------------------- autocomplete.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers Constify some variables. ----------------------------------------------------- dde.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- dragdrophelper.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. ----------------------------------------------------- enumidlist.h: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellreg.c: Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Detlef Riekenberg <wine.dev@web.de> Implement SHRegQueryValueA with RegQueryValueA. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shellstring.c: Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. ----------------------------------------------------- shlfsbind.c Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. Hans Leidekker <hans@it.vu.nl> shell32: Win64 printf format warning fixes. Andrew Talbot <Andrew.Talbot@talbotville.com> shell32: Exclude unused headers. ----------------------------------------------------- shlmenu.c: Dmitry Timoshkov <dmitry@codeweavers.com> Switch to using 'long' for INT_PTR type for 64-bit compatibility. Andrew Talbot <Andrew.Talbot@talbotville.com> Exclude unused headers. Hans Leidekker <hans@it.vu.nl> Win64 printf format warning fixes. James Hawkins <truiken@gmail.com> janitorial: Remove redundant NULL checks before SHFree. Francois Gouget <fgouget@free.fr> Fix spelling of a local variable. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. ----------------------------------------------------- shpolicy.c: Dmitry Timoshkov <dmitry@codeweavers.com> Make some data static and const. Jonathan Ernst <jonathan@ernstfamily.ch> Update the address of the Free Software Foundation. svn path=/trunk/; revision=29485
2007-10-10 22:39:44 +00:00
TRACE("hmenu1=%p hmenu2=%p 0x%04x 0x%04x 0x%04x 0x%04x\n",
hmDst, hmSrc, uInsert, uIDAdjust, uIDAdjustMax, uFlags);
if (!hmDst || !hmSrc)
return uIDMax;
nItem = GetMenuItemCount(hmDst);
if (nItem == -1)
return uIDMax;
if (uInsert >= (UINT)nItem) /* insert position inside menu? */
{
uInsert = (UINT)nItem; /* append on the end */
bAlreadySeparated = TRUE;
}
else
{
bAlreadySeparated = _SHIsMenuSeparator(hmDst, uInsert);
}
if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
{
/* Add a separator between the menus */
InsertMenuA(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
bAlreadySeparated = TRUE;
}
/* Go through the menu items and clone them*/
for (nItem = GetMenuItemCount(hmSrc) - 1; nItem >= 0; nItem--)
{
miiSrc.cbSize = sizeof(MENUITEMINFOW);
miiSrc.fMask = MIIM_STATE | MIIM_ID | MIIM_SUBMENU | MIIM_CHECKMARKS | MIIM_TYPE | MIIM_DATA;
/* We need to reset this every time through the loop in case menus DON'T have IDs*/
miiSrc.fType = MFT_STRING;
miiSrc.dwTypeData = szName;
miiSrc.dwItemData = 0;
miiSrc.cch = sizeof(szName)/sizeof(WCHAR);
if (!GetMenuItemInfoW(hmSrc, nItem, TRUE, &miiSrc))
{
continue;
}
/* TRACE("found menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmSrc, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask, miiSrc.hSubMenu);
*/
if (miiSrc.fType & MFT_SEPARATOR)
{
/* This is a separator; don't put two of them in a row */
if (bAlreadySeparated)
continue;
bAlreadySeparated = TRUE;
}
else if (miiSrc.hSubMenu)
{
if (uFlags & MM_SUBMENUSHAVEIDS)
{
miiSrc.wID += uIDAdjust; /* add uIDAdjust to the ID */
if (uIDAdjustMax != 0xFFFF && miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */
continue;
if (uIDMax <= miiSrc.wID) /* remember the highest ID */
uIDMax = miiSrc.wID + 1;
}
else
{
miiSrc.fMask &= ~MIIM_ID; /* Don't set IDs for submenus that didn't have them already */
}
hmSubMenu = miiSrc.hSubMenu;
miiSrc.hSubMenu = CreatePopupMenu();
if (!miiSrc.hSubMenu) return(uIDMax);
uTemp = Shell_MergeMenus(miiSrc.hSubMenu, hmSubMenu, 0, uIDAdjust, uIDAdjustMax, uFlags & MM_SUBMENUSHAVEIDS);
if (uIDMax <= uTemp)
uIDMax = uTemp;
bAlreadySeparated = FALSE;
}
else /* normal menu item */
{
miiSrc.wID += uIDAdjust; /* add uIDAdjust to the ID */
if (uIDAdjustMax != 0xFFFF && miiSrc.wID > uIDAdjustMax) /* skip ID's higher uIDAdjustMax */
continue;
if (uIDMax <= miiSrc.wID) /* remember the highest ID */
uIDMax = miiSrc.wID + 1;
bAlreadySeparated = FALSE;
}
/* TRACE("inserting menu=0x%04x %s id=0x%04x mask=0x%08x smenu=0x%04x\n", hmDst, debugstr_a(miiSrc.dwTypeData), miiSrc.wID, miiSrc.fMask, miiSrc.hSubMenu);
*/
if (!InsertMenuItemW(hmDst, uInsert, TRUE, &miiSrc))
{
return(uIDMax);
}
}
/* Ensure the correct number of separators at the beginning of the
inserted menu items*/
if (uInsert == 0)
{
if (bAlreadySeparated)
{
DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
}
}
else
{
if (_SHIsMenuSeparator(hmDst, uInsert-1))
{
if (bAlreadySeparated)
{
DeleteMenu(hmDst, uInsert, MF_BYPOSITION);
}
}
else
{
if ((uFlags & MM_ADDSEPARATOR) && !bAlreadySeparated)
{
/* Add a separator between the menus*/
InsertMenuW(hmDst, uInsert, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
}
}
}
return(uIDMax);
}