ReactOS 0.4.15-dev-7907-g95bf896
itemdlg.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "winreg.h"
#include "shlwapi.h"
#include "commdlg.h"
#include "cdlg.h"
#include "filedlgbrowser.h"
#include "wine/debug.h"
#include "wine/list.h"
#include <initguid.h>
Include dependency graph for itemdlg.c:

Go to the source code of this file.

Classes

struct  cctrl_item
 
struct  customctrl
 
struct  events_client
 
struct  FileDialogImpl
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define IDC_NAV_TOOLBAR   200
 
#define IDC_NAVBACK   201
 
#define IDC_NAVFORWARD   202
 

Typedefs

typedef struct cctrl_item cctrl_item
 
typedef struct FileDialogImpl FileDialogImpl
 

Enumerations

enum  ITEMDLG_TYPE { ITEMDLG_TYPE_OPEN , ITEMDLG_TYPE_SAVE }
 
enum  ITEMDLG_CCTRL_TYPE {
  IDLG_CCTRL_MENU , IDLG_CCTRL_PUSHBUTTON , IDLG_CCTRL_COMBOBOX , IDLG_CCTRL_RADIOBUTTONLIST ,
  IDLG_CCTRL_CHECKBUTTON , IDLG_CCTRL_EDITBOX , IDLG_CCTRL_SEPARATOR , IDLG_CCTRL_TEXT ,
  IDLG_CCTRL_OPENDROPDOWN , IDLG_CCTRL_VISUALGROUP
}
 

Functions

 DEFINE_GUID (IID_IFileDialogCustomizeAlt, 0x8016B7B3, 0x3D49, 0x4504, 0xA0, 0xAA, 0x2A, 0x37, 0x49, 0x4E, 0x60, 0x6F)
 
 WINE_DEFAULT_DEBUG_CHANNEL (commdlg)
 
static HRESULT events_OnFileOk (FileDialogImpl *This)
 
static HRESULT events_OnFolderChanging (FileDialogImpl *This, IShellItem *folder)
 
static void events_OnFolderChange (FileDialogImpl *This)
 
static void events_OnSelectionChange (FileDialogImpl *This)
 
static void events_OnTypeChange (FileDialogImpl *This)
 
static HRESULT events_OnOverwrite (FileDialogImpl *This, IShellItem *shellitem)
 
static HRESULT get_cctrl_event (IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce)
 
static HRESULT cctrl_event_OnButtonClicked (FileDialogImpl *This, DWORD ctl_id)
 
static HRESULT cctrl_event_OnItemSelected (FileDialogImpl *This, DWORD ctl_id, DWORD item_id)
 
static HRESULT cctrl_event_OnCheckButtonToggled (FileDialogImpl *This, DWORD ctl_id, BOOL checked)
 
static HRESULT cctrl_event_OnControlActivating (FileDialogImpl *This, DWORD ctl_id)
 
static UINT get_file_name (FileDialogImpl *This, LPWSTR *str)
 
static BOOL set_file_name (FileDialogImpl *This, LPCWSTR str)
 
static void fill_filename_from_selection (FileDialogImpl *This)
 
static LPWSTR get_first_ext_from_spec (LPWSTR buf, LPCWSTR spec)
 
static BOOL shell_item_exists (IShellItem *shellitem)
 
static HRESULT on_default_action (FileDialogImpl *This)
 
static void show_opendropdown (FileDialogImpl *This)
 
static void item_free (cctrl_item *item)
 
static cctrl_itemget_item (customctrl *parent, DWORD itemid, CDCONTROLSTATEF visible_flags, DWORD *position)
 
static cctrl_itemget_first_item (customctrl *parent)
 
static HRESULT add_item (customctrl *parent, DWORD itemid, LPCWSTR label, cctrl_item **result)
 
static customctrlget_cctrl_from_dlgid (FileDialogImpl *This, DWORD dlgid)
 
static customctrlget_cctrl (FileDialogImpl *This, DWORD ctlid)
 
static void ctrl_resize (HWND hctrl, UINT min_width, UINT max_width, BOOL multiline)
 
static UINT ctrl_get_height (customctrl *ctrl)
 
static void ctrl_free (customctrl *ctrl)
 
static void customctrl_resize (FileDialogImpl *This, customctrl *ctrl)
 
static LRESULT notifysink_on_create (HWND hwnd, CREATESTRUCTW *crs)
 
static LRESULT notifysink_on_bn_clicked (FileDialogImpl *This, HWND hwnd, WPARAM wparam)
 
static LRESULT notifysink_on_cbn_selchange (FileDialogImpl *This, HWND hwnd, WPARAM wparam)
 
static LRESULT notifysink_on_tvn_dropdown (FileDialogImpl *This, LPARAM lparam)
 
static LRESULT notifysink_on_wm_command (FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
 
static LRESULT notifysink_on_wm_notify (FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK notifysink_proc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
static HRESULT cctrl_create_new (FileDialogImpl *This, DWORD id, LPCWSTR text, LPCWSTR wndclass, DWORD ctrl_wsflags, DWORD ctrl_exflags, UINT height, customctrl **ppctrl)
 
static UINT ctrl_container_resize (FileDialogImpl *This, UINT container_width)
 
static void ctrl_set_font (customctrl *ctrl, HFONT font)
 
static void ctrl_container_reparent (FileDialogImpl *This, HWND parent)
 
static LRESULT ctrl_container_on_create (HWND hwnd, CREATESTRUCTW *crs)
 
static LRESULT ctrl_container_on_wm_destroy (FileDialogImpl *This)
 
static LRESULT CALLBACK ctrl_container_wndproc (HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
 
static void radiobuttonlist_set_selected_item (FileDialogImpl *This, customctrl *ctrl, cctrl_item *item)
 
static LRESULT radiobuttonlist_on_bn_clicked (FileDialogImpl *This, HWND hwnd, HWND child)
 
static LRESULT radiobuttonlist_on_wm_command (FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK radiobuttonlist_proc (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
 
static HRESULT init_custom_controls (FileDialogImpl *This)
 
static BOOL update_open_dropdown (FileDialogImpl *This)
 
static void update_layout (FileDialogImpl *This)
 
static HRESULT init_explorerbrowser (FileDialogImpl *This)
 
static void init_toolbar (FileDialogImpl *This, HWND hwnd)
 
static void update_control_text (FileDialogImpl *This)
 
static LRESULT CALLBACK dropdown_subclass_proc (HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
 
static LRESULT on_wm_initdialog (HWND hwnd, LPARAM lParam)
 
static LRESULT on_wm_size (FileDialogImpl *This)
 
static LRESULT on_wm_getminmaxinfo (FileDialogImpl *This, LPARAM lparam)
 
static LRESULT on_wm_destroy (FileDialogImpl *This)
 
static LRESULT on_idok (FileDialogImpl *This)
 
static LRESULT on_idcancel (FileDialogImpl *This)
 
static LRESULT on_command_opendropdown (FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
 
static LRESULT on_browse_back (FileDialogImpl *This)
 
static LRESULT on_browse_forward (FileDialogImpl *This)
 
static LRESULT on_command_filetype (FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
 
static LRESULT on_wm_command (FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK itemdlg_dlgproc (HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
 
static HRESULT create_dialog (FileDialogImpl *This, HWND parent)
 
static FileDialogImplimpl_from_IFileDialog2 (IFileDialog2 *iface)
 
static HRESULT WINAPI IFileDialog2_fnQueryInterface (IFileDialog2 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IFileDialog2_fnAddRef (IFileDialog2 *iface)
 
static ULONG WINAPI IFileDialog2_fnRelease (IFileDialog2 *iface)
 
static HRESULT WINAPI IFileDialog2_fnShow (IFileDialog2 *iface, HWND hwndOwner)
 
static HRESULT WINAPI IFileDialog2_fnSetFileTypes (IFileDialog2 *iface, UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec)
 
static HRESULT WINAPI IFileDialog2_fnSetFileTypeIndex (IFileDialog2 *iface, UINT iFileType)
 
static HRESULT WINAPI IFileDialog2_fnGetFileTypeIndex (IFileDialog2 *iface, UINT *piFileType)
 
static HRESULT WINAPI IFileDialog2_fnAdvise (IFileDialog2 *iface, IFileDialogEvents *pfde, DWORD *pdwCookie)
 
static HRESULT WINAPI IFileDialog2_fnUnadvise (IFileDialog2 *iface, DWORD dwCookie)
 
static HRESULT WINAPI IFileDialog2_fnSetOptions (IFileDialog2 *iface, FILEOPENDIALOGOPTIONS fos)
 
static HRESULT WINAPI IFileDialog2_fnGetOptions (IFileDialog2 *iface, FILEOPENDIALOGOPTIONS *pfos)
 
static HRESULT WINAPI IFileDialog2_fnSetDefaultFolder (IFileDialog2 *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileDialog2_fnSetFolder (IFileDialog2 *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileDialog2_fnGetFolder (IFileDialog2 *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileDialog2_fnGetCurrentSelection (IFileDialog2 *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileDialog2_fnSetFileName (IFileDialog2 *iface, LPCWSTR pszName)
 
static HRESULT WINAPI IFileDialog2_fnGetFileName (IFileDialog2 *iface, LPWSTR *pszName)
 
static HRESULT WINAPI IFileDialog2_fnSetTitle (IFileDialog2 *iface, LPCWSTR pszTitle)
 
static HRESULT WINAPI IFileDialog2_fnSetOkButtonLabel (IFileDialog2 *iface, LPCWSTR pszText)
 
static HRESULT WINAPI IFileDialog2_fnSetFileNameLabel (IFileDialog2 *iface, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialog2_fnGetResult (IFileDialog2 *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileDialog2_fnAddPlace (IFileDialog2 *iface, IShellItem *psi, FDAP fdap)
 
static HRESULT WINAPI IFileDialog2_fnSetDefaultExtension (IFileDialog2 *iface, LPCWSTR pszDefaultExtension)
 
static HRESULT WINAPI IFileDialog2_fnClose (IFileDialog2 *iface, HRESULT hr)
 
static HRESULT WINAPI IFileDialog2_fnSetClientGuid (IFileDialog2 *iface, REFGUID guid)
 
static HRESULT WINAPI IFileDialog2_fnClearClientData (IFileDialog2 *iface)
 
static HRESULT WINAPI IFileDialog2_fnSetFilter (IFileDialog2 *iface, IShellItemFilter *pFilter)
 
static HRESULT WINAPI IFileDialog2_fnSetCancelButtonLabel (IFileDialog2 *iface, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialog2_fnSetNavigationRoot (IFileDialog2 *iface, IShellItem *psi)
 
static FileDialogImplimpl_from_IFileOpenDialog (IFileOpenDialog *iface)
 
static HRESULT WINAPI IFileOpenDialog_fnQueryInterface (IFileOpenDialog *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IFileOpenDialog_fnAddRef (IFileOpenDialog *iface)
 
static ULONG WINAPI IFileOpenDialog_fnRelease (IFileOpenDialog *iface)
 
static HRESULT WINAPI IFileOpenDialog_fnShow (IFileOpenDialog *iface, HWND hwndOwner)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFileTypes (IFileOpenDialog *iface, UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFileTypeIndex (IFileOpenDialog *iface, UINT iFileType)
 
static HRESULT WINAPI IFileOpenDialog_fnGetFileTypeIndex (IFileOpenDialog *iface, UINT *piFileType)
 
static HRESULT WINAPI IFileOpenDialog_fnAdvise (IFileOpenDialog *iface, IFileDialogEvents *pfde, DWORD *pdwCookie)
 
static HRESULT WINAPI IFileOpenDialog_fnUnadvise (IFileOpenDialog *iface, DWORD dwCookie)
 
static HRESULT WINAPI IFileOpenDialog_fnSetOptions (IFileOpenDialog *iface, FILEOPENDIALOGOPTIONS fos)
 
static HRESULT WINAPI IFileOpenDialog_fnGetOptions (IFileOpenDialog *iface, FILEOPENDIALOGOPTIONS *pfos)
 
static HRESULT WINAPI IFileOpenDialog_fnSetDefaultFolder (IFileOpenDialog *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFolder (IFileOpenDialog *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileOpenDialog_fnGetFolder (IFileOpenDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileOpenDialog_fnGetCurrentSelection (IFileOpenDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFileName (IFileOpenDialog *iface, LPCWSTR pszName)
 
static HRESULT WINAPI IFileOpenDialog_fnGetFileName (IFileOpenDialog *iface, LPWSTR *pszName)
 
static HRESULT WINAPI IFileOpenDialog_fnSetTitle (IFileOpenDialog *iface, LPCWSTR pszTitle)
 
static HRESULT WINAPI IFileOpenDialog_fnSetOkButtonLabel (IFileOpenDialog *iface, LPCWSTR pszText)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFileNameLabel (IFileOpenDialog *iface, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileOpenDialog_fnGetResult (IFileOpenDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileOpenDialog_fnAddPlace (IFileOpenDialog *iface, IShellItem *psi, FDAP fdap)
 
static HRESULT WINAPI IFileOpenDialog_fnSetDefaultExtension (IFileOpenDialog *iface, LPCWSTR pszDefaultExtension)
 
static HRESULT WINAPI IFileOpenDialog_fnClose (IFileOpenDialog *iface, HRESULT hr)
 
static HRESULT WINAPI IFileOpenDialog_fnSetClientGuid (IFileOpenDialog *iface, REFGUID guid)
 
static HRESULT WINAPI IFileOpenDialog_fnClearClientData (IFileOpenDialog *iface)
 
static HRESULT WINAPI IFileOpenDialog_fnSetFilter (IFileOpenDialog *iface, IShellItemFilter *pFilter)
 
static HRESULT WINAPI IFileOpenDialog_fnGetResults (IFileOpenDialog *iface, IShellItemArray **ppenum)
 
static HRESULT WINAPI IFileOpenDialog_fnGetSelectedItems (IFileOpenDialog *iface, IShellItemArray **ppsai)
 
static FileDialogImplimpl_from_IFileSaveDialog (IFileSaveDialog *iface)
 
static HRESULT WINAPI IFileSaveDialog_fnQueryInterface (IFileSaveDialog *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IFileSaveDialog_fnAddRef (IFileSaveDialog *iface)
 
static ULONG WINAPI IFileSaveDialog_fnRelease (IFileSaveDialog *iface)
 
static HRESULT WINAPI IFileSaveDialog_fnShow (IFileSaveDialog *iface, HWND hwndOwner)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFileTypes (IFileSaveDialog *iface, UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFileTypeIndex (IFileSaveDialog *iface, UINT iFileType)
 
static HRESULT WINAPI IFileSaveDialog_fnGetFileTypeIndex (IFileSaveDialog *iface, UINT *piFileType)
 
static HRESULT WINAPI IFileSaveDialog_fnAdvise (IFileSaveDialog *iface, IFileDialogEvents *pfde, DWORD *pdwCookie)
 
static HRESULT WINAPI IFileSaveDialog_fnUnadvise (IFileSaveDialog *iface, DWORD dwCookie)
 
static HRESULT WINAPI IFileSaveDialog_fnSetOptions (IFileSaveDialog *iface, FILEOPENDIALOGOPTIONS fos)
 
static HRESULT WINAPI IFileSaveDialog_fnGetOptions (IFileSaveDialog *iface, FILEOPENDIALOGOPTIONS *pfos)
 
static HRESULT WINAPI IFileSaveDialog_fnSetDefaultFolder (IFileSaveDialog *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFolder (IFileSaveDialog *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileSaveDialog_fnGetFolder (IFileSaveDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileSaveDialog_fnGetCurrentSelection (IFileSaveDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFileName (IFileSaveDialog *iface, LPCWSTR pszName)
 
static HRESULT WINAPI IFileSaveDialog_fnGetFileName (IFileSaveDialog *iface, LPWSTR *pszName)
 
static HRESULT WINAPI IFileSaveDialog_fnSetTitle (IFileSaveDialog *iface, LPCWSTR pszTitle)
 
static HRESULT WINAPI IFileSaveDialog_fnSetOkButtonLabel (IFileSaveDialog *iface, LPCWSTR pszText)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFileNameLabel (IFileSaveDialog *iface, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileSaveDialog_fnGetResult (IFileSaveDialog *iface, IShellItem **ppsi)
 
static HRESULT WINAPI IFileSaveDialog_fnAddPlace (IFileSaveDialog *iface, IShellItem *psi, FDAP fdap)
 
static HRESULT WINAPI IFileSaveDialog_fnSetDefaultExtension (IFileSaveDialog *iface, LPCWSTR pszDefaultExtension)
 
static HRESULT WINAPI IFileSaveDialog_fnClose (IFileSaveDialog *iface, HRESULT hr)
 
static HRESULT WINAPI IFileSaveDialog_fnSetClientGuid (IFileSaveDialog *iface, REFGUID guid)
 
static HRESULT WINAPI IFileSaveDialog_fnClearClientData (IFileSaveDialog *iface)
 
static HRESULT WINAPI IFileSaveDialog_fnSetFilter (IFileSaveDialog *iface, IShellItemFilter *pFilter)
 
static HRESULT WINAPI IFileSaveDialog_fnSetSaveAsItem (IFileSaveDialog *iface, IShellItem *psi)
 
static HRESULT WINAPI IFileSaveDialog_fnSetProperties (IFileSaveDialog *iface, IPropertyStore *pStore)
 
static HRESULT WINAPI IFileSaveDialog_fnSetCollectedProperties (IFileSaveDialog *iface, IPropertyDescriptionList *pList, BOOL fAppendDefault)
 
static HRESULT WINAPI IFileSaveDialog_fnGetProperties (IFileSaveDialog *iface, IPropertyStore **ppStore)
 
static HRESULT WINAPI IFileSaveDialog_fnApplyProperties (IFileSaveDialog *iface, IShellItem *psi, IPropertyStore *pStore, HWND hwnd, IFileOperationProgressSink *pSink)
 
static FileDialogImplimpl_from_IExplorerBrowserEvents (IExplorerBrowserEvents *iface)
 
static HRESULT WINAPI IExplorerBrowserEvents_fnQueryInterface (IExplorerBrowserEvents *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IExplorerBrowserEvents_fnAddRef (IExplorerBrowserEvents *iface)
 
static ULONG WINAPI IExplorerBrowserEvents_fnRelease (IExplorerBrowserEvents *iface)
 
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationPending (IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
 
static HRESULT WINAPI IExplorerBrowserEvents_fnOnViewCreated (IExplorerBrowserEvents *iface, IShellView *psv)
 
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationComplete (IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
 
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationFailed (IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
 
static FileDialogImplimpl_from_IServiceProvider (IServiceProvider *iface)
 
static HRESULT WINAPI IServiceProvider_fnQueryInterface (IServiceProvider *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IServiceProvider_fnAddRef (IServiceProvider *iface)
 
static ULONG WINAPI IServiceProvider_fnRelease (IServiceProvider *iface)
 
static HRESULT WINAPI IServiceProvider_fnQueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
static FileDialogImplimpl_from_ICommDlgBrowser3 (ICommDlgBrowser3 *iface)
 
static HRESULT WINAPI ICommDlgBrowser3_fnQueryInterface (ICommDlgBrowser3 *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ICommDlgBrowser3_fnAddRef (ICommDlgBrowser3 *iface)
 
static ULONG WINAPI ICommDlgBrowser3_fnRelease (ICommDlgBrowser3 *iface)
 
static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand (ICommDlgBrowser3 *iface, IShellView *shv)
 
static HRESULT WINAPI ICommDlgBrowser3_fnOnStateChange (ICommDlgBrowser3 *iface, IShellView *shv, ULONG uChange)
 
static HRESULT WINAPI ICommDlgBrowser3_fnIncludeObject (ICommDlgBrowser3 *iface, IShellView *shv, LPCITEMIDLIST pidl)
 
static HRESULT WINAPI ICommDlgBrowser3_fnNotify (ICommDlgBrowser3 *iface, IShellView *ppshv, DWORD dwNotifyType)
 
static HRESULT WINAPI ICommDlgBrowser3_fnGetDefaultMenuText (ICommDlgBrowser3 *iface, IShellView *pshv, LPWSTR pszText, int cchMax)
 
static HRESULT WINAPI ICommDlgBrowser3_fnGetViewFlags (ICommDlgBrowser3 *iface, DWORD *pdwFlags)
 
static HRESULT WINAPI ICommDlgBrowser3_fnOnColumnClicked (ICommDlgBrowser3 *iface, IShellView *pshv, int iColumn)
 
static HRESULT WINAPI ICommDlgBrowser3_fnGetCurrentFilter (ICommDlgBrowser3 *iface, LPWSTR pszFileSpec, int cchFileSpec)
 
static HRESULT WINAPI ICommDlgBrowser3_fnOnPreviewCreated (ICommDlgBrowser3 *iface, IShellView *pshv)
 
static FileDialogImplimpl_from_IOleWindow (IOleWindow *iface)
 
static HRESULT WINAPI IOleWindow_fnQueryInterface (IOleWindow *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IOleWindow_fnAddRef (IOleWindow *iface)
 
static ULONG WINAPI IOleWindow_fnRelease (IOleWindow *iface)
 
static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp (IOleWindow *iface, BOOL fEnterMOde)
 
static HRESULT WINAPI IOleWindow_fnGetWindow (IOleWindow *iface, HWND *phwnd)
 
static FileDialogImplimpl_from_IFileDialogCustomize (IFileDialogCustomize *iface)
 
static HRESULT WINAPI IFileDialogCustomize_fnQueryInterface (IFileDialogCustomize *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI IFileDialogCustomize_fnAddRef (IFileDialogCustomize *iface)
 
static ULONG WINAPI IFileDialogCustomize_fnRelease (IFileDialogCustomize *iface)
 
static HRESULT WINAPI IFileDialogCustomize_fnEnableOpenDropDown (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddMenu (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddPushButton (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddComboBox (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddRadioButtonList (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddCheckButton (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszLabel, BOOL bChecked)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddEditBox (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszText)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddSeparator (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddText (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszText)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetControlLabel (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialogCustomize_fnGetControlState (IFileDialogCustomize *iface, DWORD dwIDCtl, CDCONTROLSTATEF *pdwState)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetControlState (IFileDialogCustomize *iface, DWORD dwIDCtl, CDCONTROLSTATEF dwState)
 
static HRESULT WINAPI IFileDialogCustomize_fnGetEditBoxText (IFileDialogCustomize *iface, DWORD dwIDCtl, WCHAR **ppszText)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetEditBoxText (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszText)
 
static HRESULT WINAPI IFileDialogCustomize_fnGetCheckButtonState (IFileDialogCustomize *iface, DWORD dwIDCtl, BOOL *pbChecked)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetCheckButtonState (IFileDialogCustomize *iface, DWORD dwIDCtl, BOOL bChecked)
 
static UINT get_combobox_index_from_id (HWND cb_hwnd, DWORD dwIDItem)
 
static HRESULT WINAPI IFileDialogCustomize_fnAddControlItem (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialogCustomize_fnRemoveControlItem (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem)
 
static HRESULT WINAPI IFileDialogCustomize_fnRemoveAllControlItems (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnGetControlItemState (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem, CDCONTROLSTATEF *pdwState)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemState (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem, CDCONTROLSTATEF dwState)
 
static HRESULT WINAPI IFileDialogCustomize_fnGetSelectedControlItem (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD *pdwIDItem)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetSelectedControlItem (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem)
 
static HRESULT WINAPI IFileDialogCustomize_fnStartVisualGroup (IFileDialogCustomize *iface, DWORD dwIDCtl, LPCWSTR pszLabel)
 
static HRESULT WINAPI IFileDialogCustomize_fnEndVisualGroup (IFileDialogCustomize *iface)
 
static HRESULT WINAPI IFileDialogCustomize_fnMakeProminent (IFileDialogCustomize *iface, DWORD dwIDCtl)
 
static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemText (IFileDialogCustomize *iface, DWORD dwIDCtl, DWORD dwIDItem, LPCWSTR pszLabel)
 
static HRESULT FileDialog_constructor (IUnknown *pUnkOuter, REFIID riid, void **ppv, enum ITEMDLG_TYPE type)
 
HRESULT FileOpenDialog_Constructor (IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
HRESULT FileSaveDialog_Constructor (IUnknown *pUnkOuter, REFIID riid, void **ppv)
 

Variables

static const WCHAR notifysink_childW [] = {'n','f','s','_','c','h','i','l','d',0}
 
static const WCHAR floatnotifysinkW [] = {'F','l','o','a','t','N','o','t','i','f','y','S','i','n','k',0}
 
static const WCHAR radiobuttonlistW [] = {'R','a','d','i','o','B','u','t','t','o','n','L','i','s','t',0}
 
static const IFileDialog2Vtbl vt_IFileDialog2
 
static const IFileOpenDialogVtbl vt_IFileOpenDialog
 
static const IFileSaveDialogVtbl vt_IFileSaveDialog
 
static const IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents
 
static const IServiceProviderVtbl vt_IServiceProvider
 
static const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3
 
static const IOleWindowVtbl vt_IOleWindow
 
static const IFileDialogCustomizeVtbl vt_IFileDialogCustomize
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 25 of file itemdlg.c.

◆ IDC_NAV_TOOLBAR

#define IDC_NAV_TOOLBAR   200

Definition at line 42 of file itemdlg.c.

◆ IDC_NAVBACK

#define IDC_NAVBACK   201

Definition at line 43 of file itemdlg.c.

◆ IDC_NAVFORWARD

#define IDC_NAVFORWARD   202

Definition at line 44 of file itemdlg.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 26 of file itemdlg.c.

Typedef Documentation

◆ cctrl_item

◆ FileDialogImpl

Enumeration Type Documentation

◆ ITEMDLG_CCTRL_TYPE

Enumerator
IDLG_CCTRL_MENU 
IDLG_CCTRL_PUSHBUTTON 
IDLG_CCTRL_COMBOBOX 
IDLG_CCTRL_RADIOBUTTONLIST 
IDLG_CCTRL_CHECKBUTTON 
IDLG_CCTRL_EDITBOX 
IDLG_CCTRL_SEPARATOR 
IDLG_CCTRL_TEXT 
IDLG_CCTRL_OPENDROPDOWN 
IDLG_CCTRL_VISUALGROUP 

Definition at line 62 of file itemdlg.c.

62 {
73};
@ IDLG_CCTRL_OPENDROPDOWN
Definition: itemdlg.c:71
@ IDLG_CCTRL_RADIOBUTTONLIST
Definition: itemdlg.c:66
@ IDLG_CCTRL_TEXT
Definition: itemdlg.c:70
@ IDLG_CCTRL_PUSHBUTTON
Definition: itemdlg.c:64
@ IDLG_CCTRL_SEPARATOR
Definition: itemdlg.c:69
@ IDLG_CCTRL_MENU
Definition: itemdlg.c:63
@ IDLG_CCTRL_COMBOBOX
Definition: itemdlg.c:65
@ IDLG_CCTRL_EDITBOX
Definition: itemdlg.c:68
@ IDLG_CCTRL_VISUALGROUP
Definition: itemdlg.c:72
@ IDLG_CCTRL_CHECKBUTTON
Definition: itemdlg.c:67

◆ ITEMDLG_TYPE

Enumerator
ITEMDLG_TYPE_OPEN 
ITEMDLG_TYPE_SAVE 

Definition at line 57 of file itemdlg.c.

57 {
60};
@ ITEMDLG_TYPE_SAVE
Definition: itemdlg.c:59
@ ITEMDLG_TYPE_OPEN
Definition: itemdlg.c:58

Function Documentation

◆ add_item()

static HRESULT add_item ( customctrl parent,
DWORD  itemid,
LPCWSTR  label,
cctrl_item **  result 
)
static

Definition at line 785 of file itemdlg.c.

786{
788 LPWSTR label_copy;
789
790 if (get_item(parent, itemid, 0, NULL))
791 return E_INVALIDARG;
792
793 item = HeapAlloc(GetProcessHeap(), 0, sizeof(*item));
794 label_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(label)+1)*sizeof(WCHAR));
795
796 if (!item || !label_copy)
797 {
799 HeapFree(GetProcessHeap(), 0, label_copy);
800 return E_OUTOFMEMORY;
801 }
802
803 item->id = itemid;
804 item->parent_id = parent->id;
805 lstrcpyW(label_copy, label);
806 item->label = label_copy;
807 item->cdcstate = CDCS_VISIBLE|CDCS_ENABLED;
808 item->hwnd = NULL;
809 list_add_tail(&parent->sub_items, &item->entry);
810
811 *result = item;
812
813 return S_OK;
814}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
static cctrl_item * get_item(customctrl *parent, DWORD itemid, CDCONTROLSTATEF visible_flags, DWORD *position)
Definition: itemdlg.c:751
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
r parent
Definition: btrfs.c:3010
GLuint64EXT * result
Definition: glext.h:11304
#define S_OK
Definition: intsafe.h:52
static const WCHAR label[]
Definition: itemdlg.c:1546
static ATOM item
Definition: dde.c:856
v1_enum CDCS_ENABLED
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by IFileDialogCustomize_fnAddControlItem().

◆ cctrl_create_new()

static HRESULT cctrl_create_new ( FileDialogImpl This,
DWORD  id,
LPCWSTR  text,
LPCWSTR  wndclass,
DWORD  ctrl_wsflags,
DWORD  ctrl_exflags,
UINT  height,
customctrl **  ppctrl 
)
static

Definition at line 1140 of file itemdlg.c.

1143{
1144 HWND ns_hwnd, control_hwnd, parent_hwnd;
1147
1148 if(get_cctrl(This, id))
1149 return E_UNEXPECTED; /* Duplicate id */
1150
1151 if(This->cctrl_active_vg)
1152 parent_hwnd = This->cctrl_active_vg->wrapper_hwnd;
1153 else
1154 parent_hwnd = This->cctrls_hwnd;
1155
1156 ns_hwnd = CreateWindowExW(0, floatnotifysinkW, NULL, wsflags,
1157 0, 0, This->cctrl_width, height, parent_hwnd,
1158 (HMENU)This->cctrl_next_dlgid, COMDLG32_hInstance, This);
1159 control_hwnd = CreateWindowExW(ctrl_exflags, wndclass, text, wsflags | ctrl_wsflags,
1160 0, 0, This->cctrl_width, height, ns_hwnd,
1161 (HMENU)This->cctrl_next_dlgid, COMDLG32_hInstance, 0);
1162
1163 if(!ns_hwnd || !control_hwnd)
1164 {
1165 ERR("Failed to create wrapper (%p) or control (%p)\n", ns_hwnd, control_hwnd);
1166 DestroyWindow(ns_hwnd);
1167 DestroyWindow(control_hwnd);
1168
1169 return E_FAIL;
1170 }
1171
1172 SetPropW(ns_hwnd, notifysink_childW, control_hwnd);
1173
1175 if(!ctrl)
1176 return E_OUTOFMEMORY;
1177
1178 ctrl->hwnd = control_hwnd;
1179 ctrl->wrapper_hwnd = ns_hwnd;
1180 ctrl->id = id;
1181 ctrl->dlgid = This->cctrl_next_dlgid;
1182 ctrl->cdcstate = CDCS_ENABLED | CDCS_VISIBLE;
1183 list_init(&ctrl->sub_cctrls);
1184 list_init(&ctrl->sub_items);
1185
1186 if(This->cctrl_active_vg)
1187 list_add_tail(&This->cctrl_active_vg->sub_cctrls, &ctrl->sub_cctrls_entry);
1188 else
1189 list_add_tail(&This->cctrls, &ctrl->entry);
1190
1192
1193 if(ppctrl) *ppctrl = ctrl;
1194
1195 This->cctrl_next_dlgid++;
1196 return S_OK;
1197}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define ERR(fmt,...)
Definition: debug.h:110
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
#define E_FAIL
Definition: ddrawi.h:102
static const WCHAR notifysink_childW[]
Definition: itemdlg.c:53
static const WCHAR floatnotifysinkW[]
Definition: itemdlg.c:54
static customctrl * get_cctrl(FileDialogImpl *This, DWORD ctlid)
Definition: itemdlg.c:837
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
const WCHAR * text
Definition: package.c:1799
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint id
Definition: glext.h:5910
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define ctrl
Definition: input.c:1756
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
v1_enum CDCS_VISIBLE
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define E_UNEXPECTED
Definition: winerror.h:2456
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define SetWindowLongPtrW
Definition: winuser.h:5346
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by IFileDialogCustomize_fnAddCheckButton(), IFileDialogCustomize_fnAddComboBox(), IFileDialogCustomize_fnAddEditBox(), IFileDialogCustomize_fnAddMenu(), IFileDialogCustomize_fnAddPushButton(), IFileDialogCustomize_fnAddRadioButtonList(), IFileDialogCustomize_fnAddSeparator(), IFileDialogCustomize_fnAddText(), and IFileDialogCustomize_fnStartVisualGroup().

◆ cctrl_event_OnButtonClicked()

static HRESULT cctrl_event_OnButtonClicked ( FileDialogImpl This,
DWORD  ctl_id 
)
static

Definition at line 281 of file itemdlg.c.

282{
284 TRACE("%p\n", This);
285
287 {
288 IFileDialogControlEvents *pfdce;
289 if(SUCCEEDED(get_cctrl_event(cursor->pfde, &pfdce)))
290 {
291 TRACE("Notifying %p\n", cursor);
292 IFileDialogControlEvents_OnButtonClicked(pfdce, &This->IFileDialogCustomize_iface, ctl_id);
293 IFileDialogControlEvents_Release(pfdce);
294 }
295 }
296
297 return S_OK;
298}
static HRESULT get_cctrl_event(IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce)
Definition: itemdlg.c:276
const char cursor[]
Definition: icontest.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:50
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by notifysink_on_bn_clicked().

◆ cctrl_event_OnCheckButtonToggled()

static HRESULT cctrl_event_OnCheckButtonToggled ( FileDialogImpl This,
DWORD  ctl_id,
BOOL  checked 
)
static

Definition at line 319 of file itemdlg.c.

320{
322 TRACE("%p\n", This);
323
325 {
326 IFileDialogControlEvents *pfdce;
327 if(SUCCEEDED(get_cctrl_event(cursor->pfde, &pfdce)))
328 {
329 TRACE("Notifying %p\n", cursor);
330 IFileDialogControlEvents_OnCheckButtonToggled(pfdce, &This->IFileDialogCustomize_iface, ctl_id, checked);
331 IFileDialogControlEvents_Release(pfdce);
332 }
333 }
334
335 return S_OK;
336}

Referenced by notifysink_on_bn_clicked().

◆ cctrl_event_OnControlActivating()

static HRESULT cctrl_event_OnControlActivating ( FileDialogImpl This,
DWORD  ctl_id 
)
static

Definition at line 338 of file itemdlg.c.

340{
342 TRACE("%p\n", This);
343
345 {
346 IFileDialogControlEvents *pfdce;
347 if(SUCCEEDED(get_cctrl_event(cursor->pfde, &pfdce)))
348 {
349 TRACE("Notifying %p\n", cursor);
350 IFileDialogControlEvents_OnControlActivating(pfdce, &This->IFileDialogCustomize_iface, ctl_id);
351 IFileDialogControlEvents_Release(pfdce);
352 }
353 }
354
355 return S_OK;
356}

Referenced by notifysink_on_tvn_dropdown().

◆ cctrl_event_OnItemSelected()

static HRESULT cctrl_event_OnItemSelected ( FileDialogImpl This,
DWORD  ctl_id,
DWORD  item_id 
)
static

Definition at line 300 of file itemdlg.c.

301{
303 TRACE("%p %i %i\n", This, ctl_id, item_id);
304
306 {
307 IFileDialogControlEvents *pfdce;
308 if(SUCCEEDED(get_cctrl_event(cursor->pfde, &pfdce)))
309 {
310 TRACE("Notifying %p\n", cursor);
311 IFileDialogControlEvents_OnItemSelected(pfdce, &This->IFileDialogCustomize_iface, ctl_id, item_id);
312 IFileDialogControlEvents_Release(pfdce);
313 }
314 }
315
316 return S_OK;
317}

Referenced by notifysink_on_cbn_selchange(), notifysink_on_tvn_dropdown(), and radiobuttonlist_on_bn_clicked().

◆ create_dialog()

static HRESULT create_dialog ( FileDialogImpl This,
HWND  parent 
)
static

Definition at line 2257 of file itemdlg.c.

2258{
2259 INT_PTR res;
2260
2261 SetLastError(0);
2263 MAKEINTRESOURCEW(NEWFILEOPENV3ORD),
2265 This->dlg_hwnd = NULL;
2266 if(res == -1)
2267 {
2268 ERR("Failed to show dialog (LastError: %d)\n", GetLastError());
2269 return E_FAIL;
2270 }
2271
2272 TRACE("Returning 0x%08x\n", (HRESULT)res);
2273 return (HRESULT)res;
2274}
static LRESULT CALLBACK itemdlg_dlgproc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:2241
#define SetLastError(x)
Definition: compat.h:752
GLuint res
Definition: glext.h:9613
int32_t INT_PTR
Definition: typedefs.h:64
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by IFileDialog2_fnShow().

◆ ctrl_container_on_create()

static LRESULT ctrl_container_on_create ( HWND  hwnd,
CREATESTRUCTW crs 
)
static

Definition at line 1387 of file itemdlg.c.

1388{
1389 FileDialogImpl *This = crs->lpCreateParams;
1390 TRACE("%p\n", This);
1391
1393 return TRUE;
1394}
#define TRUE
Definition: types.h:120
static const WCHAR crs[]
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by ctrl_container_wndproc().

◆ ctrl_container_on_wm_destroy()

static LRESULT ctrl_container_on_wm_destroy ( FileDialogImpl This)
static

Definition at line 1396 of file itemdlg.c.

1397{
1398 customctrl *cur1, *cur2;
1399 TRACE("%p\n", This);
1400
1401 LIST_FOR_EACH_ENTRY_SAFE(cur1, cur2, &This->cctrls, customctrl, entry)
1402 {
1403 list_remove(&cur1->entry);
1404 ctrl_free(cur1);
1405 }
1406
1407 return TRUE;
1408}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void ctrl_free(customctrl *ctrl)
Definition: itemdlg.c:910
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
struct list entry
Definition: itemdlg.c:88

Referenced by ctrl_container_wndproc().

◆ ctrl_container_reparent()

static void ctrl_container_reparent ( FileDialogImpl This,
HWND  parent 
)
static

Definition at line 1346 of file itemdlg.c.

1347{
1348 LONG wndstyle;
1349
1350 if(parent)
1351 {
1353 HFONT font;
1354
1355 wndstyle = GetWindowLongW(This->cctrls_hwnd, GWL_STYLE);
1356 wndstyle &= ~(WS_POPUP);
1357 wndstyle |= WS_CHILD;
1358 SetWindowLongW(This->cctrls_hwnd, GWL_STYLE, wndstyle);
1359
1360 SetParent(This->cctrls_hwnd, parent);
1361 ShowWindow(This->cctrls_hwnd, TRUE);
1362
1363 /* Set the fonts to match the dialog font. */
1365 if(!font)
1366 ERR("Failed to get font handle from dialog.\n");
1367
1369 {
1372 }
1373 }
1374 else
1375 {
1376 ShowWindow(This->cctrls_hwnd, FALSE);
1377
1378 wndstyle = GetWindowLongW(This->cctrls_hwnd, GWL_STYLE);
1379 wndstyle &= ~(WS_CHILD);
1380 wndstyle |= WS_POPUP;
1381 SetWindowLongW(This->cctrls_hwnd, GWL_STYLE, wndstyle);
1382
1383 SetParent(This->cctrls_hwnd, NULL);
1384 }
1385}
#define FALSE
Definition: types.h:117
static void ctrl_set_font(customctrl *ctrl, HFONT font)
Definition: itemdlg.c:1325
static void customctrl_resize(FileDialogImpl *This, customctrl *ctrl)
Definition: itemdlg.c:939
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: mk_font.cpp:20
#define WS_POPUP
Definition: pedump.c:616
long LONG
Definition: pedump.c:60
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define WM_GETFONT
Definition: winuser.h:1651
#define GWL_STYLE
Definition: winuser.h:852
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by on_wm_destroy(), and on_wm_initdialog().

◆ ctrl_container_resize()

static UINT ctrl_container_resize ( FileDialogImpl This,
UINT  container_width 
)
static

Definition at line 1202 of file itemdlg.c.

1203{
1204 UINT container_height;
1205 UINT column_width;
1206 UINT nr_of_cols;
1207 UINT max_control_height, total_height = 0;
1208 UINT cur_col_pos, cur_row_pos;
1210 BOOL fits_height;
1211 UINT cspacing = MulDiv(90, This->dpi_x, USER_DEFAULT_SCREEN_DPI); /* Columns are spaced with 90px */
1212 UINT rspacing = MulDiv(4, This->dpi_y, USER_DEFAULT_SCREEN_DPI); /* Rows are spaced with 4 px. */
1213
1214 /* Given the new width of the container, this function determines the
1215 * needed height of the container and places the controls according to
1216 * the new layout. Returns the new height.
1217 */
1218
1219 TRACE("%p\n", This);
1220
1221 column_width = This->cctrl_width + cspacing;
1222 nr_of_cols = (container_width - This->cctrl_indent + cspacing) / column_width;
1223
1224 /* We don't need to do anything unless the number of visible columns has changed. */
1225 if(nr_of_cols == This->cctrls_cols)
1226 {
1227 RECT rc;
1228 GetWindowRect(This->cctrls_hwnd, &rc);
1229 return rc.bottom - rc.top;
1230 }
1231
1232 This->cctrls_cols = nr_of_cols;
1233
1234 /* Get the size of the tallest control, and the total size of
1235 * all the controls to figure out the number of slots we need.
1236 */
1237 max_control_height = 0;
1239 {
1240 if(ctrl->cdcstate & CDCS_VISIBLE)
1241 {
1242 UINT control_height = ctrl_get_height(ctrl);
1243 max_control_height = max(max_control_height, control_height);
1244
1245 total_height += control_height + rspacing;
1246 }
1247 }
1248
1249 if(!total_height)
1250 return 0;
1251
1252 container_height = max(total_height / nr_of_cols, max_control_height + rspacing);
1253 TRACE("Guess: container_height: %d\n",container_height);
1254
1255 /* Incrementally increase container_height until all the controls
1256 * fit.
1257 */
1258 do {
1259 UINT columns_needed = 1;
1260 cur_row_pos = 0;
1261
1262 fits_height = TRUE;
1264 {
1265 if(ctrl->cdcstate & CDCS_VISIBLE)
1266 {
1267 UINT control_height = ctrl_get_height(ctrl);
1268
1269 if(cur_row_pos + control_height > container_height)
1270 {
1271 if(++columns_needed > nr_of_cols)
1272 {
1273 container_height += 1;
1274 fits_height = FALSE;
1275 break;
1276 }
1277 cur_row_pos = 0;
1278 }
1279
1280 cur_row_pos += control_height + rspacing;
1281 }
1282 }
1283 } while(!fits_height);
1284
1285 TRACE("Final container height: %d\n", container_height);
1286
1287 /* Move the controls to their final destination
1288 */
1289 cur_col_pos = 0; cur_row_pos = 0;
1291 {
1292 if(ctrl->cdcstate & CDCS_VISIBLE)
1293 {
1294 RECT rc;
1295 UINT control_height, control_indent;
1296 GetWindowRect(ctrl->wrapper_hwnd, &rc);
1297 control_height = rc.bottom - rc.top;
1298
1299 if(cur_row_pos + control_height > container_height)
1300 {
1301 cur_row_pos = 0;
1302 cur_col_pos += This->cctrl_width + cspacing;
1303 }
1304
1305
1306 if(ctrl->type == IDLG_CCTRL_VISUALGROUP)
1307 control_indent = 0;
1308 else
1309 control_indent = This->cctrl_indent;
1310
1311 SetWindowPos(ctrl->wrapper_hwnd, NULL, cur_col_pos + control_indent, cur_row_pos, 0, 0,
1313
1314 cur_row_pos += control_height + rspacing;
1315 }
1316 }
1317
1318 /* Sanity check */
1319 if(cur_row_pos + This->cctrl_width > container_width)
1320 ERR("-- Failed to place controls properly.\n");
1321
1322 return container_height;
1323}
static UINT ctrl_get_height(customctrl *ctrl)
Definition: itemdlg.c:904
unsigned int BOOL
Definition: ntddk_ex.h:94
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
unsigned int UINT
Definition: ndis.h:50
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
#define max(a, b)
Definition: svc.c:63
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1245
#define USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2893
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by update_layout().

◆ ctrl_container_wndproc()

static LRESULT CALLBACK ctrl_container_wndproc ( HWND  hwnd,
UINT  umessage,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1410 of file itemdlg.c.

1411{
1413
1414 switch(umessage)
1415 {
1418 default: return DefWindowProcW(hwnd, umessage, wparam, lparam);
1419 }
1420
1421 return FALSE;
1422}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
static LRESULT ctrl_container_on_create(HWND hwnd, CREATESTRUCTW *crs)
Definition: itemdlg.c:1387
static LRESULT ctrl_container_on_wm_destroy(FileDialogImpl *This)
Definition: itemdlg.c:1396
#define GetWindowLongPtrW
Definition: winuser.h:4829
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NCCREATE
Definition: winuser.h:1683
#define WM_DESTROY
Definition: winuser.h:1609

Referenced by init_custom_controls().

◆ ctrl_free()

static void ctrl_free ( customctrl ctrl)
static

Definition at line 910 of file itemdlg.c.

911{
912 customctrl *sub_cur1, *sub_cur2;
913 cctrl_item *item_cur1, *item_cur2;
914
915 TRACE("Freeing control %p\n", ctrl);
916 if(ctrl->type == IDLG_CCTRL_MENU)
917 {
918 TBBUTTON tbb;
919 SendMessageW(ctrl->hwnd, TB_GETBUTTON, 0, (LPARAM)&tbb);
921 }
922
923 LIST_FOR_EACH_ENTRY_SAFE(sub_cur1, sub_cur2, &ctrl->sub_cctrls, customctrl, sub_cctrls_entry)
924 {
925 list_remove(&sub_cur1->sub_cctrls_entry);
926 ctrl_free(sub_cur1);
927 }
928
929 LIST_FOR_EACH_ENTRY_SAFE(item_cur1, item_cur2, &ctrl->sub_items, cctrl_item, entry)
930 {
931 list_remove(&item_cur1->entry);
932 item_free(item_cur1);
933 }
934
935 DestroyWindow(ctrl->hwnd);
937}
static void item_free(cctrl_item *item)
Definition: itemdlg.c:744
#define TB_GETBUTTON
Definition: commctrl.h:1109
DWORD_PTR dwData
Definition: commctrl.h:958
struct list entry
Definition: itemdlg.c:80
struct list sub_cctrls_entry
Definition: itemdlg.c:91
BOOL WINAPI DestroyMenu(_In_ HMENU)

Referenced by ctrl_container_on_wm_destroy(), and ctrl_free().

◆ ctrl_get_height()

static UINT ctrl_get_height ( customctrl ctrl)
static

Definition at line 904 of file itemdlg.c.

904 {
905 RECT rc;
906 GetWindowRect(ctrl->wrapper_hwnd, &rc);
907 return rc.bottom - rc.top;
908}

Referenced by ctrl_container_resize(), and customctrl_resize().

◆ ctrl_resize()

static void ctrl_resize ( HWND  hctrl,
UINT  min_width,
UINT  max_width,
BOOL  multiline 
)
static

Definition at line 858 of file itemdlg.c.

859{
860 LPWSTR text;
861 UINT len, final_width;
862 UINT lines, final_height;
863 SIZE size;
864 RECT rc;
865 HDC hdc;
866 WCHAR *c;
867 HFONT font;
868
869 TRACE("\n");
870
871 len = SendMessageW(hctrl, WM_GETTEXTLENGTH, 0, 0);
872 text = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(len+1));
873 if(!text) return;
875
876 hdc = GetDC(hctrl);
877 font = (HFONT)SendMessageW(hctrl, WM_GETFONT, 0, 0);
881 ReleaseDC(hctrl, hdc);
882
883 if(len && multiline)
884 {
885 /* FIXME: line-wrap */
886 for(lines = 1, c = text; *c != '\0'; c++)
887 if(*c == '\n') lines++;
888
889 final_height = size.cy*lines + 2*4;
890 }
891 else
892 {
893 GetWindowRect(hctrl, &rc);
894 final_height = rc.bottom - rc.top;
895 }
896
897 final_width = min(max(size.cx, min_width) + 4, max_width);
898 SetWindowPos(hctrl, NULL, 0, 0, final_width, final_height,
900
902}
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLenum GLsizei len
Definition: glext.h:6722
#define c
Definition: ke_i.h:80
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
#define min(a, b)
Definition: monoChain.cc:55
eMaj lines
Definition: tritemp.h:206
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_GETTEXTLENGTH
Definition: winuser.h:1619
#define SWP_NOMOVE
Definition: winuser.h:1244
#define WM_GETTEXT
Definition: winuser.h:1618
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by customctrl_resize(), and update_control_text().

◆ ctrl_set_font()

static void ctrl_set_font ( customctrl ctrl,
HFONT  font 
)
static

Definition at line 1325 of file itemdlg.c.

1326{
1327 customctrl *sub_ctrl;
1329
1331
1332 LIST_FOR_EACH_ENTRY(sub_ctrl, &ctrl->sub_cctrls, customctrl, sub_cctrls_entry)
1333 {
1334 ctrl_set_font(sub_ctrl, font);
1335 }
1336
1337 if (ctrl->type == IDLG_CCTRL_RADIOBUTTONLIST)
1338 {
1340 {
1342 }
1343 }
1344}
UINT_PTR WPARAM
Definition: windef.h:207
#define WM_SETFONT
Definition: winuser.h:1650

Referenced by ctrl_container_reparent(), and ctrl_set_font().

◆ customctrl_resize()

static void customctrl_resize ( FileDialogImpl This,
customctrl ctrl 
)
static

Definition at line 939 of file itemdlg.c.

940{
941 RECT rc;
942 UINT total_height;
943 UINT max_width, size;
944 customctrl *sub_ctrl;
945
946 switch(ctrl->type)
947 {
951 case IDLG_CCTRL_TEXT:
952 size = MulDiv(160, This->dpi_x, USER_DEFAULT_SCREEN_DPI);
953 ctrl_resize(ctrl->hwnd, size, size, TRUE);
954 GetWindowRect(ctrl->hwnd, &rc);
955 SetWindowPos(ctrl->wrapper_hwnd, NULL, 0, 0, rc.right-rc.left, rc.bottom-rc.top,
957 break;
959 total_height = 0;
960 ctrl_resize(ctrl->hwnd, 0, This->cctrl_indent, TRUE);
961
962 LIST_FOR_EACH_ENTRY(sub_ctrl, &ctrl->sub_cctrls, customctrl, sub_cctrls_entry)
963 {
964 customctrl_resize(This, sub_ctrl);
965 SetWindowPos(sub_ctrl->wrapper_hwnd, NULL, This->cctrl_indent, total_height, 0, 0,
967
968 total_height += ctrl_get_height(sub_ctrl);
969 }
970
971 /* The label should be right adjusted */
972 {
974
975 GetWindowRect(ctrl->hwnd, &rc);
976 width = rc.right - rc.left;
977 height = rc.bottom - rc.top;
978
979 SetWindowPos(ctrl->hwnd, NULL, This->cctrl_indent - width, 0, width, height, SWP_NOZORDER);
980 }
981
982 /* Resize the wrapper window to fit all the sub controls */
983 SetWindowPos(ctrl->wrapper_hwnd, NULL, 0, 0, This->cctrl_width + This->cctrl_indent, total_height,
985 break;
987 {
989
990 total_height = 0;
991 max_width = 0;
992
994 {
995 size = MulDiv(160, This->dpi_x, USER_DEFAULT_SCREEN_DPI);
996 ctrl_resize(item->hwnd, size, size, TRUE);
997 SetWindowPos(item->hwnd, NULL, 0, total_height, 0, 0,
999
1000 GetWindowRect(item->hwnd, &rc);
1001
1002 total_height += rc.bottom - rc.top;
1003 max_width = max(rc.right - rc.left, max_width);
1004 }
1005
1006 SetWindowPos(ctrl->hwnd, NULL, 0, 0, max_width, total_height,
1008
1009 SetWindowPos(ctrl->wrapper_hwnd, NULL, 0, 0, max_width, total_height,
1011
1012 break;
1013 }
1014 case IDLG_CCTRL_EDITBOX:
1016 case IDLG_CCTRL_MENU:
1018 /* Nothing */
1019 break;
1020 }
1021}
static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multiline)
Definition: itemdlg.c:858
GLint GLint GLsizei width
Definition: gl.h:1546
HWND wrapper_hwnd
Definition: itemdlg.c:84
LONG right
Definition: windef.h:308
LONG left
Definition: windef.h:306

Referenced by ctrl_container_reparent(), and customctrl_resize().

◆ DEFINE_GUID()

DEFINE_GUID ( IID_IFileDialogCustomizeAlt  ,
0x8016B7B3  ,
0x3D49  ,
0x4504  ,
0xA0  ,
0xAA  ,
0x2A  ,
0x37  ,
0x49  ,
0x4E  ,
0x60  ,
0x6F   
)

◆ dropdown_subclass_proc()

static LRESULT CALLBACK dropdown_subclass_proc ( HWND  hwnd,
UINT  umessage,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1973 of file itemdlg.c.

1974{
1975 static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0};
1976 static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0};
1977
1978 if (umessage == WM_LBUTTONDOWN)
1979 {
1980 FileDialogImpl *This = GetPropW(hwnd, prop_this);
1981
1985
1986 return 0;
1987 }
1988
1989 return CallWindowProcW((WNDPROC)GetPropW(hwnd, prop_oldwndproc), hwnd, umessage, wparam, lparam);
1990}
static void show_opendropdown(FileDialogImpl *This)
Definition: itemdlg.c:711
#define BST_UNCHECKED
Definition: winuser.h:199
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define BM_SETCHECK
Definition: winuser.h:1921
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197

Referenced by on_wm_initdialog().

◆ events_OnFileOk()

static HRESULT events_OnFileOk ( FileDialogImpl This)
static

Definition at line 159 of file itemdlg.c.

160{
162 HRESULT hr = S_OK;
163 TRACE("%p\n", This);
164
166 {
167 TRACE("Notifying %p\n", cursor);
168 hr = IFileDialogEvents_OnFileOk(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
169 if(FAILED(hr) && hr != E_NOTIMPL)
170 break;
171 }
172
173 if(hr == E_NOTIMPL)
174 hr = S_OK;
175
176 return hr;
177}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183

Referenced by on_default_action().

◆ events_OnFolderChange()

static void events_OnFolderChange ( FileDialogImpl This)
static

Definition at line 199 of file itemdlg.c.

200{
202 TRACE("%p\n", This);
203
205 {
206 TRACE("Notifying %p\n", cursor);
207 IFileDialogEvents_OnFolderChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
208 }
209}

Referenced by IExplorerBrowserEvents_fnOnNavigationComplete().

◆ events_OnFolderChanging()

static HRESULT events_OnFolderChanging ( FileDialogImpl This,
IShellItem folder 
)
static

Definition at line 179 of file itemdlg.c.

180{
182 HRESULT hr = S_OK;
183 TRACE("%p (%p)\n", This, folder);
184
186 {
187 TRACE("Notifying %p\n", cursor);
188 hr = IFileDialogEvents_OnFolderChanging(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface, folder);
189 if(FAILED(hr) && hr != E_NOTIMPL)
190 break;
191 }
192
193 if(hr == E_NOTIMPL)
194 hr = S_OK;
195
196 return hr;
197}
Definition: fci.c:116

Referenced by IExplorerBrowserEvents_fnOnNavigationPending().

◆ events_OnOverwrite()

static HRESULT events_OnOverwrite ( FileDialogImpl This,
IShellItem shellitem 
)
static

Definition at line 235 of file itemdlg.c.

236{
238 HRESULT hr = S_OK;
240 TRACE("%p %p\n", This, shellitem);
241
243 {
244 TRACE("Notifying %p\n", cursor);
245 hr = IFileDialogEvents_OnOverwrite(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface, shellitem, &response);
246 TRACE("<-- hr=%x response=%u\n", hr, response);
247 if(FAILED(hr) && hr != E_NOTIMPL)
248 break;
249 }
250
251 if(hr == E_NOTIMPL)
252 hr = S_OK;
253
254 if(SUCCEEDED(hr))
255 {
256 if (response == FDEOR_DEFAULT)
257 {
258 WCHAR buf[100];
259 int answer;
260
262 answer = MessageBoxW(This->dlg_hwnd, buf, This->custom_title,
264 if (answer == IDNO || answer == IDCANCEL)
265 {
266 hr = E_FAIL;
267 }
268 }
269 else if (response == FDEOR_REFUSE)
270 hr = E_FAIL;
271 }
272
273 return hr;
274}
#define IDS_OVERWRITEFILE
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
FDE_OVERWRITE_RESPONSE
Definition: shobjidl.idl:3424
@ FDEOR_DEFAULT
Definition: shobjidl.idl:3425
@ FDEOR_REFUSE
Definition: shobjidl.idl:3427
#define IDCANCEL
Definition: winuser.h:831
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MB_YESNO
Definition: winuser.h:817
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define IDNO
Definition: winuser.h:836
#define MB_ICONEXCLAMATION
Definition: winuser.h:785

Referenced by on_default_action().

◆ events_OnSelectionChange()

static void events_OnSelectionChange ( FileDialogImpl This)
static

Definition at line 211 of file itemdlg.c.

212{
214 TRACE("%p\n", This);
215
217 {
218 TRACE("Notifying %p\n", cursor);
219 IFileDialogEvents_OnSelectionChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
220 }
221}

Referenced by ICommDlgBrowser3_fnOnStateChange().

◆ events_OnTypeChange()

static void events_OnTypeChange ( FileDialogImpl This)
static

Definition at line 223 of file itemdlg.c.

224{
226 TRACE("%p\n", This);
227
229 {
230 TRACE("Notifying %p\n", cursor);
231 IFileDialogEvents_OnTypeChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
232 }
233}

Referenced by on_command_filetype(), and on_wm_initdialog().

◆ FileDialog_constructor()

static HRESULT FileDialog_constructor ( IUnknown pUnkOuter,
REFIID  riid,
void **  ppv,
enum ITEMDLG_TYPE  type 
)
static

Definition at line 4600 of file itemdlg.c.

4601{
4602 FileDialogImpl *fdimpl;
4603 HRESULT hr;
4604 IShellFolder *psf;
4605 TRACE("%p, %s, %p\n", pUnkOuter, debugstr_guid(riid), ppv);
4606
4607 if(!ppv)
4608 return E_POINTER;
4609 if(pUnkOuter)
4610 return CLASS_E_NOAGGREGATION;
4611
4613 if(!fdimpl)
4614 return E_OUTOFMEMORY;
4615
4616 fdimpl->ref = 1;
4617 fdimpl->IFileDialog2_iface.lpVtbl = &vt_IFileDialog2;
4621 fdimpl->IOleWindow_iface.lpVtbl = &vt_IOleWindow;
4623
4624 if(type == ITEMDLG_TYPE_OPEN)
4625 {
4626 fdimpl->dlg_type = ITEMDLG_TYPE_OPEN;
4627 fdimpl->u.IFileOpenDialog_iface.lpVtbl = &vt_IFileOpenDialog;
4628 fdimpl->options = FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST | FOS_NOCHANGEDIR;
4629 fdimpl->custom_title = fdimpl->custom_okbutton = NULL;
4630 }
4631 else
4632 {
4633 WCHAR buf[16];
4634 fdimpl->dlg_type = ITEMDLG_TYPE_SAVE;
4635 fdimpl->u.IFileSaveDialog_iface.lpVtbl = &vt_IFileSaveDialog;
4636 fdimpl->options = FOS_OVERWRITEPROMPT | FOS_NOREADONLYRETURN | FOS_PATHMUSTEXIST | FOS_NOCHANGEDIR;
4637
4639 fdimpl->custom_title = StrDupW(buf);
4640 fdimpl->custom_okbutton = StrDupW(buf);
4641 }
4642
4643 list_init(&fdimpl->events_clients);
4644
4645 /* FIXME: The default folder setting should be restored for the
4646 * application if it was previously set. */
4647 SHGetDesktopFolder(&psf);
4648 SHGetItemFromObject((IUnknown*)psf, &IID_IShellItem, (void**)&fdimpl->psi_defaultfolder);
4649 IShellFolder_Release(psf);
4650
4651 hr = init_custom_controls(fdimpl);
4652 if(FAILED(hr))
4653 {
4654 ERR("Failed to initialize custom controls (0x%08x).\n", hr);
4655 IFileDialog2_Release(&fdimpl->IFileDialog2_iface);
4656 return E_FAIL;
4657 }
4658
4659 hr = IFileDialog2_QueryInterface(&fdimpl->IFileDialog2_iface, riid, ppv);
4660 IFileDialog2_Release(&fdimpl->IFileDialog2_iface);
4661 return hr;
4662}
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define ARRAY_SIZE(A)
Definition: main.h:33
#define IDS_SAVE
Definition: cdlg.h:179
static const IFileSaveDialogVtbl vt_IFileSaveDialog
Definition: itemdlg.c:3266
static const IFileDialog2Vtbl vt_IFileDialog2
Definition: itemdlg.c:2781
static const IOleWindowVtbl vt_IOleWindow
Definition: itemdlg.c:3702
static HRESULT init_custom_controls(FileDialogImpl *This)
Definition: itemdlg.c:1493
static const IFileOpenDialogVtbl vt_IFileOpenDialog
Definition: itemdlg.c:3018
static const IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents
Definition: itemdlg.c:3396
static const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3
Definition: itemdlg.c:3646
static const IServiceProviderVtbl vt_IServiceProvider
Definition: itemdlg.c:3456
static const IFileDialogCustomizeVtbl vt_IFileDialogCustomize
Definition: itemdlg.c:4567
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1093
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv)
IShellItem * psi_defaultfolder
Definition: itemdlg.c:125
IFileDialogCustomize IFileDialogCustomize_iface
Definition: itemdlg.c:112
struct list events_clients
Definition: itemdlg.c:120
union FileDialogImpl::@349 u
LPWSTR custom_title
Definition: itemdlg.c:135
IOleWindow IOleWindow_iface
Definition: itemdlg.c:111
FILEOPENDIALOGOPTIONS options
Definition: itemdlg.c:115
LPWSTR custom_okbutton
Definition: itemdlg.c:136
enum ITEMDLG_TYPE dlg_type
Definition: itemdlg.c:107
IServiceProvider IServiceProvider_iface
Definition: itemdlg.c:109
IFileDialog2 IFileDialog2_iface
Definition: itemdlg.c:102
IExplorerBrowserEvents IExplorerBrowserEvents_iface
Definition: itemdlg.c:108
ICommDlgBrowser3 ICommDlgBrowser3_iface
Definition: itemdlg.c:110
IFileOpenDialog IFileOpenDialog_iface
Definition: itemdlg.c:104
IFileSaveDialog IFileSaveDialog_iface
Definition: itemdlg.c:105
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define E_POINTER
Definition: winerror.h:2365

Referenced by FileOpenDialog_Constructor(), and FileSaveDialog_Constructor().

◆ FileOpenDialog_Constructor()

HRESULT FileOpenDialog_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)

Definition at line 4664 of file itemdlg.c.

4665{
4666 return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_OPEN);
4667}
static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv, enum ITEMDLG_TYPE type)
Definition: itemdlg.c:4600

Referenced by DllGetClassObject().

◆ FileSaveDialog_Constructor()

HRESULT FileSaveDialog_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)

Definition at line 4669 of file itemdlg.c.

4670{
4671 return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE);
4672}

Referenced by DllGetClassObject().

◆ fill_filename_from_selection()

static void fill_filename_from_selection ( FileDialogImpl This)
static

Definition at line 397 of file itemdlg.c.

398{
399 IShellItem *psi;
400 LPWSTR *names;
401 HRESULT hr;
402 UINT item_count, valid_count;
403 UINT len_total, i;
404
405 if(!This->psia_selection)
406 return;
407
408 hr = IShellItemArray_GetCount(This->psia_selection, &item_count);
409 if(FAILED(hr) || !item_count)
410 return;
411
412 names = HeapAlloc(GetProcessHeap(), 0, item_count*sizeof(LPWSTR));
413
414 /* Get names of the selected items */
415 valid_count = 0; len_total = 0;
416 for(i = 0; i < item_count; i++)
417 {
418 hr = IShellItemArray_GetItemAt(This->psia_selection, i, &psi);
419 if(SUCCEEDED(hr))
420 {
421 UINT attr;
422
423 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER, &attr);
424 if(SUCCEEDED(hr) &&
425 (( (This->options & FOS_PICKFOLDERS) && !(attr & SFGAO_FOLDER)) ||
426 (!(This->options & FOS_PICKFOLDERS) && (attr & SFGAO_FOLDER))))
427 continue;
428
429 hr = IShellItem_GetDisplayName(psi, (This->options & FOS_PICKFOLDERS) ? SIGDN_FILESYSPATH : SIGDN_PARENTRELATIVEPARSING, &names[valid_count]);
430 if(SUCCEEDED(hr))
431 {
432 len_total += lstrlenW(names[valid_count]) + 3;
433 valid_count++;
434 }
435 IShellItem_Release(psi);
436 }
437 }
438
439 if(valid_count == 1)
440 {
443 }
444 else if(valid_count > 1)
445 {
446 LPWSTR string = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*len_total);
447 LPWSTR cur_point = string;
448
449 for(i = 0; i < valid_count; i++)
450 {
451 LPWSTR file = names[i];
452 *cur_point++ = '\"';
453 lstrcpyW(cur_point, file);
454 cur_point += lstrlenW(file);
455 *cur_point++ = '\"';
456 *cur_point++ = ' ';
458 }
459 *(cur_point-1) = '\0';
460
461 set_file_name(This, string);
462 HeapFree(GetProcessHeap(), 0, string);
463 }
464
466 return;
467}
static BOOL set_file_name(FileDialogImpl *This, LPCWSTR str)
Definition: itemdlg.c:387
GLuint GLuint * names
Definition: glext.h:11545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
char string[160]
Definition: util.h:11
Definition: cookie.c:202
Definition: fci.c:127

Referenced by ICommDlgBrowser3_fnOnStateChange().

◆ get_cctrl()

static customctrl * get_cctrl ( FileDialogImpl This,
DWORD  ctlid 
)
inlinestatic

◆ get_cctrl_event()

static HRESULT get_cctrl_event ( IFileDialogEvents pfde,
IFileDialogControlEvents **  pfdce 
)
inlinestatic

Definition at line 276 of file itemdlg.c.

277{
278 return IFileDialogEvents_QueryInterface(pfde, &IID_IFileDialogControlEvents, (void**)pfdce);
279}

Referenced by cctrl_event_OnButtonClicked(), cctrl_event_OnCheckButtonToggled(), cctrl_event_OnControlActivating(), and cctrl_event_OnItemSelected().

◆ get_cctrl_from_dlgid()

static customctrl * get_cctrl_from_dlgid ( FileDialogImpl This,
DWORD  dlgid 
)
inlinestatic

Definition at line 819 of file itemdlg.c.

820{
821 customctrl *ctrl, *sub_ctrl;
822
824 {
825 if(ctrl->dlgid == dlgid)
826 return ctrl;
827
828 LIST_FOR_EACH_ENTRY(sub_ctrl, &ctrl->sub_cctrls, customctrl, sub_cctrls_entry)
829 if(sub_ctrl->dlgid == dlgid)
830 return sub_ctrl;
831 }
832
833 ERR("Failed to find control with dialog id %d\n", dlgid);
834 return NULL;
835}
UINT dlgid
Definition: itemdlg.c:85

Referenced by notifysink_on_bn_clicked(), notifysink_on_cbn_selchange(), notifysink_on_tvn_dropdown(), and radiobuttonlist_on_bn_clicked().

◆ get_combobox_index_from_id()

static UINT get_combobox_index_from_id ( HWND  cb_hwnd,
DWORD  dwIDItem 
)
static

Definition at line 4060 of file itemdlg.c.

4061{
4062 UINT count = SendMessageW(cb_hwnd, CB_GETCOUNT, 0, 0);
4063 UINT i;
4064 if(!count || (count == CB_ERR))
4065 return -1;
4066
4067 for(i = 0; i < count; i++)
4068 if(SendMessageW(cb_hwnd, CB_GETITEMDATA, i, 0) == dwIDItem)
4069 return i;
4070
4071 TRACE("Item with id %d not found in combobox %p (item count: %d)\n", dwIDItem, cb_hwnd, count);
4072 return -1;
4073}
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define CB_ERR
Definition: winuser.h:2435
#define CB_GETCOUNT
Definition: winuser.h:1942
#define CB_GETITEMDATA
Definition: winuser.h:1950

Referenced by IFileDialogCustomize_fnSetSelectedControlItem().

◆ get_file_name()

static UINT get_file_name ( FileDialogImpl This,
LPWSTR str 
)
static

Definition at line 361 of file itemdlg.c.

362{
363 HWND hwnd_edit = GetDlgItem(This->dlg_hwnd, IDC_FILENAME);
364 UINT len;
365
366 if(!hwnd_edit)
367 {
368 if(This->set_filename)
369 {
370 len = lstrlenW(This->set_filename);
371 *str = CoTaskMemAlloc(sizeof(WCHAR)*(len+1));
372 lstrcpyW(*str, This->set_filename);
373 return len;
374 }
375 return 0;
376 }
377
378 len = SendMessageW(hwnd_edit, WM_GETTEXTLENGTH, 0, 0);
379 *str = CoTaskMemAlloc(sizeof(WCHAR)*(len+1));
380 if(!*str)
381 return 0;
382
383 SendMessageW(hwnd_edit, WM_GETTEXT, len+1, (LPARAM)*str);
384 return len;
385}
#define IDC_FILENAME
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
const WCHAR * str
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)

◆ get_first_ext_from_spec()

static LPWSTR get_first_ext_from_spec ( LPWSTR  buf,
LPCWSTR  spec 
)
static

Definition at line 469 of file itemdlg.c.

470{
471 WCHAR *endpos, *ext;
472
473 lstrcpyW(buf, spec);
474 if( (endpos = StrChrW(buf, ';')) )
475 *endpos = '\0';
476
478 if(StrChrW(ext, '*'))
479 return NULL;
480
481 return ext;
482}
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468
static const WCHAR *const ext[]
Definition: module.c:53
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447

Referenced by on_command_filetype(), and on_default_action().

◆ get_first_item()

static cctrl_item * get_first_item ( customctrl parent)
static

Definition at line 772 of file itemdlg.c.

773{
775
777 {
778 if ((item->cdcstate & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED))
779 return item;
780 }
781
782 return NULL;
783}

Referenced by IFileDialogCustomize_fnGetSelectedControlItem(), and update_control_text().

◆ get_item()

static cctrl_item * get_item ( customctrl parent,
DWORD  itemid,
CDCONTROLSTATEF  visible_flags,
DWORD position 
)
static

Definition at line 751 of file itemdlg.c.

752{
753 DWORD dummy;
755
756 if (!position) position = &dummy;
757
758 *position = 0;
759
761 {
762 if (item->id == itemid)
763 return item;
764
765 if ((item->cdcstate & visible_flags) == visible_flags)
766 (*position)++;
767 }
768
769 return NULL;
770}

Referenced by add_item(), IFileDialogCustomize_fnGetControlItemState(), IFileDialogCustomize_fnRemoveControlItem(), IFileDialogCustomize_fnSetControlItemState(), and IFileDialogCustomize_fnSetSelectedControlItem().

◆ ICommDlgBrowser3_fnAddRef()

static ULONG WINAPI ICommDlgBrowser3_fnAddRef ( ICommDlgBrowser3 iface)
static

Definition at line 3479 of file itemdlg.c.

3480{
3482 TRACE("%p\n", This);
3483 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3484}
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466

◆ ICommDlgBrowser3_fnGetCurrentFilter()

static HRESULT WINAPI ICommDlgBrowser3_fnGetCurrentFilter ( ICommDlgBrowser3 iface,
LPWSTR  pszFileSpec,
int  cchFileSpec 
)
static

Definition at line 3630 of file itemdlg.c.

3632{
3634 FIXME("Stub: %p (%p, %d)\n", This, pszFileSpec, cchFileSpec);
3635 return E_NOTIMPL;
3636}
#define FIXME(fmt,...)
Definition: debug.h:111

◆ ICommDlgBrowser3_fnGetDefaultMenuText()

static HRESULT WINAPI ICommDlgBrowser3_fnGetDefaultMenuText ( ICommDlgBrowser3 iface,
IShellView pshv,
LPWSTR  pszText,
int  cchMax 
)
static

Definition at line 3606 of file itemdlg.c.

3609{
3611 FIXME("Stub: %p (%p, %p, %d)\n", This, pshv, pszText, cchMax);
3612 return E_NOTIMPL;
3613}
UINT cchMax

◆ ICommDlgBrowser3_fnGetViewFlags()

static HRESULT WINAPI ICommDlgBrowser3_fnGetViewFlags ( ICommDlgBrowser3 iface,
DWORD pdwFlags 
)
static

Definition at line 3615 of file itemdlg.c.

3616{
3618 FIXME("Stub: %p (%p)\n", This, pdwFlags);
3619 return E_NOTIMPL;
3620}

◆ ICommDlgBrowser3_fnIncludeObject()

static HRESULT WINAPI ICommDlgBrowser3_fnIncludeObject ( ICommDlgBrowser3 iface,
IShellView shv,
LPCITEMIDLIST  pidl 
)
static

Definition at line 3545 of file itemdlg.c.

3547{
3549 IShellItem *psi;
3551 LPITEMIDLIST parent_pidl;
3552 HRESULT hr;
3553 ULONG attr;
3554 TRACE("%p (%p, %p)\n", This, shv, pidl);
3555
3556 if(!This->filterspec_count && !(This->options & FOS_PICKFOLDERS))
3557 return S_OK;
3558
3559 hr = SHGetIDListFromObject((IUnknown*)shv, &parent_pidl);
3560 if(SUCCEEDED(hr))
3561 {
3562 LPITEMIDLIST full_pidl = ILCombine(parent_pidl, pidl);
3563 hr = SHCreateItemFromIDList(full_pidl, &IID_IShellItem, (void**)&psi);
3564 ILFree(parent_pidl);
3565 ILFree(full_pidl);
3566 }
3567 if(FAILED(hr))
3568 {
3569 ERR("Failed to get shellitem (%08x).\n", hr);
3570 return S_OK;
3571 }
3572
3573 hr = IShellItem_GetAttributes(psi, SFGAO_FOLDER|SFGAO_LINK, &attr);
3574 if(FAILED(hr) || (attr & (SFGAO_FOLDER | SFGAO_LINK)))
3575 {
3576 IShellItem_Release(psi);
3577 return S_OK;
3578 }
3579
3580 if((This->options & FOS_PICKFOLDERS) && !(attr & (SFGAO_FOLDER | SFGAO_LINK)))
3581 {
3582 IShellItem_Release(psi);
3583 return S_FALSE;
3584 }
3585
3586 hr = S_OK;
3587 if(SUCCEEDED(IShellItem_GetDisplayName(psi, SIGDN_PARENTRELATIVEPARSING, &filename)))
3588 {
3589 if(!PathMatchSpecW(filename, This->filterspecs[This->filetypeindex].pszSpec))
3590 hr = S_FALSE;
3592 }
3593
3594 IShellItem_Release(psi);
3595 return hr;
3596}
BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask)
Definition: path.c:1964
const char * filename
Definition: ioapi.h:137
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:938
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1530
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:712
HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
uint32_t ULONG
Definition: typedefs.h:59
#define S_FALSE
Definition: winerror.h:2357

◆ ICommDlgBrowser3_fnNotify()

static HRESULT WINAPI ICommDlgBrowser3_fnNotify ( ICommDlgBrowser3 iface,
IShellView ppshv,
DWORD  dwNotifyType 
)
static

Definition at line 3598 of file itemdlg.c.

3600{
3602 FIXME("Stub: %p (%p, 0x%x)\n", This, ppshv, dwNotifyType);
3603 return E_NOTIMPL;
3604}

◆ ICommDlgBrowser3_fnOnColumnClicked()

static HRESULT WINAPI ICommDlgBrowser3_fnOnColumnClicked ( ICommDlgBrowser3 iface,
IShellView pshv,
int  iColumn 
)
static

Definition at line 3622 of file itemdlg.c.

3624{
3626 FIXME("Stub: %p (%p, %d)\n", This, pshv, iColumn);
3627 return E_NOTIMPL;
3628}

◆ ICommDlgBrowser3_fnOnDefaultCommand()

static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand ( ICommDlgBrowser3 iface,
IShellView shv 
)
static

Definition at line 3493 of file itemdlg.c.

3495{
3497 HRESULT hr;
3498 TRACE("%p (%p)\n", This, shv);
3499
3501
3502 if(SUCCEEDED(hr))
3503 EndDialog(This->dlg_hwnd, S_OK);
3504
3505 return S_OK;
3506}
static HRESULT on_default_action(FileDialogImpl *This)
Definition: itemdlg.c:506
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

◆ ICommDlgBrowser3_fnOnPreviewCreated()

static HRESULT WINAPI ICommDlgBrowser3_fnOnPreviewCreated ( ICommDlgBrowser3 iface,
IShellView pshv 
)
static

Definition at line 3638 of file itemdlg.c.

3640{
3642 FIXME("Stub: %p (%p)\n", This, pshv);
3643 return E_NOTIMPL;
3644}

◆ ICommDlgBrowser3_fnOnStateChange()

static HRESULT WINAPI ICommDlgBrowser3_fnOnStateChange ( ICommDlgBrowser3 iface,
IShellView shv,
ULONG  uChange 
)
static

Definition at line 3508 of file itemdlg.c.

3510{
3512 IDataObject *new_selection;
3513 HRESULT hr;
3514 TRACE("%p (%p, %x)\n", This, shv, uChange);
3515
3516 switch(uChange)
3517 {
3518 case CDBOSC_SELCHANGE:
3519 if(This->psia_selection)
3520 {
3521 IShellItemArray_Release(This->psia_selection);
3522 This->psia_selection = NULL;
3523 }
3524
3525 hr = IShellView_GetItemObject(shv, SVGIO_SELECTION, &IID_IDataObject, (void**)&new_selection);
3526 if(SUCCEEDED(hr))
3527 {
3528 hr = SHCreateShellItemArrayFromDataObject(new_selection, &IID_IShellItemArray,
3529 (void**)&This->psia_selection);
3530 if(SUCCEEDED(hr))
3531 {
3534 }
3535
3536 IDataObject_Release(new_selection);
3537 }
3538 break;
3539 default:
3540 TRACE("Unhandled state change\n");
3541 }
3542 return S_OK;
3543}
static void fill_filename_from_selection(FileDialogImpl *This)
Definition: itemdlg.c:397
static void events_OnSelectionChange(FileDialogImpl *This)
Definition: itemdlg.c:211
const GUID IID_IDataObject
HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv)

◆ ICommDlgBrowser3_fnQueryInterface()

static HRESULT WINAPI ICommDlgBrowser3_fnQueryInterface ( ICommDlgBrowser3 iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3471 of file itemdlg.c.

3473{
3475 TRACE("%p\n", This);
3476 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3477}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ ICommDlgBrowser3_fnRelease()

static ULONG WINAPI ICommDlgBrowser3_fnRelease ( ICommDlgBrowser3 iface)
static

Definition at line 3486 of file itemdlg.c.

3487{
3489 TRACE("%p\n", This);
3490 return IFileDialog2_Release(&This->IFileDialog2_iface);
3491}

◆ IExplorerBrowserEvents_fnAddRef()

static ULONG WINAPI IExplorerBrowserEvents_fnAddRef ( IExplorerBrowserEvents *  iface)
static

Definition at line 3318 of file itemdlg.c.

3319{
3321 TRACE("%p\n", This);
3322 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3323}
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ IExplorerBrowserEvents_fnOnNavigationComplete()

static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationComplete ( IExplorerBrowserEvents *  iface,
PCIDLIST_ABSOLUTE  pidlFolder 
)
static

Definition at line 3366 of file itemdlg.c.

3368{
3370 HRESULT hr;
3371 TRACE("%p (%p)\n", This, pidlFolder);
3372
3373 if(This->psi_folder)
3374 IShellItem_Release(This->psi_folder);
3375
3376 hr = SHCreateItemFromIDList(pidlFolder, &IID_IShellItem, (void**)&This->psi_folder);
3377 if(FAILED(hr))
3378 {
3379 ERR("Failed to get the current folder.\n");
3380 This->psi_folder = NULL;
3381 }
3382
3384
3385 return S_OK;
3386}
static void events_OnFolderChange(FileDialogImpl *This)
Definition: itemdlg.c:199

◆ IExplorerBrowserEvents_fnOnNavigationFailed()

static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationFailed ( IExplorerBrowserEvents *  iface,
PCIDLIST_ABSOLUTE  pidlFolder 
)
static

Definition at line 3388 of file itemdlg.c.

3390{
3392 TRACE("%p (%p)\n", This, pidlFolder);
3393 return S_OK;
3394}

◆ IExplorerBrowserEvents_fnOnNavigationPending()

static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationPending ( IExplorerBrowserEvents *  iface,
PCIDLIST_ABSOLUTE  pidlFolder 
)
static

Definition at line 3332 of file itemdlg.c.

3334{
3336 IShellItem *psi;
3337 HRESULT hr;
3338 TRACE("%p (%p)\n", This, pidlFolder);
3339
3340 hr = SHCreateItemFromIDList(pidlFolder, &IID_IShellItem, (void**)&psi);
3341 if(SUCCEEDED(hr))
3342 {
3344 IShellItem_Release(psi);
3345
3346 /* The ExplorerBrowser treats S_FALSE as S_OK, we don't. */
3347 if(hr == S_FALSE)
3348 hr = E_FAIL;
3349
3350 return hr;
3351 }
3352 else
3353 ERR("Failed to convert pidl (%p) to a shellitem.\n", pidlFolder);
3354
3355 return S_OK;
3356}
static HRESULT events_OnFolderChanging(FileDialogImpl *This, IShellItem *folder)
Definition: itemdlg.c:179

◆ IExplorerBrowserEvents_fnOnViewCreated()

static HRESULT WINAPI IExplorerBrowserEvents_fnOnViewCreated ( IExplorerBrowserEvents *  iface,
IShellView psv 
)
static

Definition at line 3358 of file itemdlg.c.

3360{
3362 TRACE("%p (%p)\n", This, psv);
3363 return S_OK;
3364}

◆ IExplorerBrowserEvents_fnQueryInterface()

static HRESULT WINAPI IExplorerBrowserEvents_fnQueryInterface ( IExplorerBrowserEvents *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3309 of file itemdlg.c.

3311{
3313 TRACE("%p (%s, %p)\n", This, debugstr_guid(riid), ppvObject);
3314
3315 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3316}

◆ IExplorerBrowserEvents_fnRelease()

static ULONG WINAPI IExplorerBrowserEvents_fnRelease ( IExplorerBrowserEvents *  iface)
static

Definition at line 3325 of file itemdlg.c.

3326{
3328 TRACE("%p\n", This);
3329 return IFileDialog2_Release(&This->IFileDialog2_iface);
3330}

◆ IFileDialog2_fnAddPlace()

static HRESULT WINAPI IFileDialog2_fnAddPlace ( IFileDialog2 iface,
IShellItem psi,
FDAP  fdap 
)
static

Definition at line 2710 of file itemdlg.c.

2711{
2713 FIXME("stub - %p (%p, %d)\n", This, psi, fdap);
2714 return S_OK;
2715}
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279

◆ IFileDialog2_fnAddRef()

static ULONG WINAPI IFileDialog2_fnAddRef ( IFileDialog2 iface)
static

Definition at line 2341 of file itemdlg.c.

2342{
2345 TRACE("%p - ref %d\n", This, ref);
2346
2347 return ref;
2348}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48

◆ IFileDialog2_fnAdvise()

static HRESULT WINAPI IFileDialog2_fnAdvise ( IFileDialog2 iface,
IFileDialogEvents pfde,
DWORD pdwCookie 
)
static

Definition at line 2458 of file itemdlg.c.

2459{
2462 TRACE("%p (%p, %p)\n", This, pfde, pdwCookie);
2463
2464 if(!pfde || !pdwCookie)
2465 return E_INVALIDARG;
2466
2468 client->pfde = pfde;
2469 client->cookie = ++This->events_next_cookie;
2470
2471 IFileDialogEvents_AddRef(pfde);
2472 *pdwCookie = client->cookie;
2473
2474 list_add_tail(&This->events_clients, &client->entry);
2475
2476 return S_OK;
2477}
static FILE * client
Definition: client.c:41

◆ IFileDialog2_fnClearClientData()

static HRESULT WINAPI IFileDialog2_fnClearClientData ( IFileDialog2 iface)
static

Definition at line 2747 of file itemdlg.c.

2748{
2750 FIXME("stub - %p\n", This);
2751 return E_NOTIMPL;
2752}

◆ IFileDialog2_fnClose()

static HRESULT WINAPI IFileDialog2_fnClose ( IFileDialog2 iface,
HRESULT  hr 
)
static

Definition at line 2728 of file itemdlg.c.

2729{
2731 TRACE("%p (0x%08x)\n", This, hr);
2732
2733 if(This->dlg_hwnd)
2734 EndDialog(This->dlg_hwnd, hr);
2735
2736 return S_OK;
2737}

◆ IFileDialog2_fnGetCurrentSelection()

static HRESULT WINAPI IFileDialog2_fnGetCurrentSelection ( IFileDialog2 iface,
IShellItem **  ppsi 
)
static

Definition at line 2602 of file itemdlg.c.

2603{
2605 HRESULT hr;
2606 TRACE("%p (%p)\n", This, ppsi);
2607
2608 if(!ppsi)
2609 return E_INVALIDARG;
2610
2611 if(This->psia_selection)
2612 {
2613 /* FIXME: Check filename edit box */
2614 hr = IShellItemArray_GetItemAt(This->psia_selection, 0, ppsi);
2615 return hr;
2616 }
2617
2618 return E_FAIL;
2619}

◆ IFileDialog2_fnGetFileName()

static HRESULT WINAPI IFileDialog2_fnGetFileName ( IFileDialog2 iface,
LPWSTR pszName 
)
static

Definition at line 2631 of file itemdlg.c.

2632{
2634 TRACE("%p (%p)\n", iface, pszName);
2635
2636 if(!pszName)
2637 return E_INVALIDARG;
2638
2639 *pszName = NULL;
2640 get_file_name(This, pszName);
2641 return *pszName ? S_OK : E_FAIL;
2642}
#define get_file_name
Definition: regproc.h:51

◆ IFileDialog2_fnGetFileTypeIndex()

static HRESULT WINAPI IFileDialog2_fnGetFileTypeIndex ( IFileDialog2 iface,
UINT piFileType 
)
static

Definition at line 2442 of file itemdlg.c.

2443{
2445 TRACE("%p (%p)\n", This, piFileType);
2446
2447 if(!piFileType)
2448 return E_INVALIDARG;
2449
2450 if(This->filterspec_count == 0)
2451 *piFileType = 0;
2452 else
2453 *piFileType = This->filetypeindex + 1;
2454
2455 return S_OK;
2456}

◆ IFileDialog2_fnGetFolder()

static HRESULT WINAPI IFileDialog2_fnGetFolder ( IFileDialog2 iface,
IShellItem **  ppsi 
)
static

Definition at line 2575 of file itemdlg.c.

2576{
2578 TRACE("%p (%p)\n", This, ppsi);
2579 if(!ppsi)
2580 return E_INVALIDARG;
2581
2582 /* FIXME:
2583 If the dialog is shown, return the current(ly selected) folder. */
2584
2585 *ppsi = NULL;
2586 if(This->psi_folder)
2587 *ppsi = This->psi_folder;
2588 else if(This->psi_setfolder)
2589 *ppsi = This->psi_setfolder;
2590 else if(This->psi_defaultfolder)
2591 *ppsi = This->psi_defaultfolder;
2592
2593 if(*ppsi)
2594 {
2595 IShellItem_AddRef(*ppsi);
2596 return S_OK;
2597 }
2598
2599 return E_FAIL;
2600}

◆ IFileDialog2_fnGetOptions()

static HRESULT WINAPI IFileDialog2_fnGetOptions ( IFileDialog2 iface,
FILEOPENDIALOGOPTIONS *  pfos 
)
static

Definition at line 2532 of file itemdlg.c.

2533{
2535 TRACE("%p (%p)\n", This, pfos);
2536
2537 if(!pfos)
2538 return E_INVALIDARG;
2539
2540 *pfos = This->options;
2541
2542 return S_OK;
2543}

◆ IFileDialog2_fnGetResult()

static HRESULT WINAPI IFileDialog2_fnGetResult ( IFileDialog2 iface,
IShellItem **  ppsi 
)
static

Definition at line 2682 of file itemdlg.c.

2683{
2685 HRESULT hr;
2686 TRACE("%p (%p)\n", This, ppsi);
2687
2688 if(!ppsi)
2689 return E_INVALIDARG;
2690
2691 if(This->psia_results)
2692 {
2693 UINT item_count;
2694 hr = IShellItemArray_GetCount(This->psia_results, &item_count);
2695 if(SUCCEEDED(hr))
2696 {
2697 if(item_count != 1)
2698 return E_FAIL;
2699
2700 /* Adds a reference. */
2701 hr = IShellItemArray_GetItemAt(This->psia_results, 0, ppsi);
2702 }
2703
2704 return hr;
2705 }
2706
2707 return E_UNEXPECTED;
2708}

◆ IFileDialog2_fnQueryInterface()

static HRESULT WINAPI IFileDialog2_fnQueryInterface ( IFileDialog2 iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 2284 of file itemdlg.c.

2287{
2289 TRACE("%p (%s, %p)\n", This, debugstr_guid(riid), ppvObject);
2290
2291 *ppvObject = NULL;
2293 IsEqualGUID(riid, &IID_IFileDialog) ||
2294 IsEqualGUID(riid, &IID_IFileDialog2))
2295 {
2296 *ppvObject = iface;
2297 }
2298 else if(IsEqualGUID(riid, &IID_IFileOpenDialog) && This->dlg_type == ITEMDLG_TYPE_OPEN)
2299 {
2300 *ppvObject = &This->u.IFileOpenDialog_iface;
2301 }
2302 else if(IsEqualGUID(riid, &IID_IFileSaveDialog) && This->dlg_type == ITEMDLG_TYPE_SAVE)
2303 {
2304 *ppvObject = &This->u.IFileSaveDialog_iface;
2305 }
2306 else if(IsEqualGUID(riid, &IID_IExplorerBrowserEvents))
2307 {
2308 *ppvObject = &This->IExplorerBrowserEvents_iface;
2309 }
2310 else if(IsEqualGUID(riid, &IID_IServiceProvider))
2311 {
2312 *ppvObject = &This->IServiceProvider_iface;
2313 }
2314 else if(IsEqualGUID(&IID_ICommDlgBrowser3, riid) ||
2315 IsEqualGUID(&IID_ICommDlgBrowser2, riid) ||
2316 IsEqualGUID(&IID_ICommDlgBrowser, riid))
2317 {
2318 *ppvObject = &This->ICommDlgBrowser3_iface;
2319 }
2320 else if(IsEqualGUID(&IID_IOleWindow, riid))
2321 {
2322 *ppvObject = &This->IOleWindow_iface;
2323 }
2324 else if(IsEqualGUID(riid, &IID_IFileDialogCustomize) ||
2325 IsEqualGUID(riid, &IID_IFileDialogCustomizeAlt))
2326 {
2327 *ppvObject = &This->IFileDialogCustomize_iface;
2328 }
2329 else
2330 FIXME("Unknown interface requested: %s.\n", debugstr_guid(riid));
2331
2332 if(*ppvObject)
2333 {
2334 IUnknown_AddRef((IUnknown*)*ppvObject);
2335 return S_OK;
2336 }
2337
2338 return E_NOINTERFACE;
2339}
const GUID IID_IUnknown
const GUID IID_IOleWindow
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IFileDialog2_fnRelease()

static ULONG WINAPI IFileDialog2_fnRelease ( IFileDialog2 iface)
static

Definition at line 2350 of file itemdlg.c.

2351{
2354 TRACE("%p - ref %d\n", This, ref);
2355
2356 if(!ref)
2357 {
2358 UINT i;
2359 for(i = 0; i < This->filterspec_count; i++)
2360 {
2361 LocalFree((void*)This->filterspecs[i].pszName);
2362 LocalFree((void*)This->filterspecs[i].pszSpec);
2363 }
2364 HeapFree(GetProcessHeap(), 0, This->filterspecs);
2365
2366 DestroyWindow(This->cctrls_hwnd);
2367
2368 if(This->psi_defaultfolder) IShellItem_Release(This->psi_defaultfolder);
2369 if(This->psi_setfolder) IShellItem_Release(This->psi_setfolder);
2370 if(This->psi_folder) IShellItem_Release(This->psi_folder);
2371 if(This->psia_selection) IShellItemArray_Release(This->psia_selection);
2372 if(This->psia_results) IShellItemArray_Release(This->psia_results);
2373
2374 LocalFree(This->set_filename);
2375 LocalFree(This->default_ext);
2376 LocalFree(This->custom_title);
2377 LocalFree(This->custom_okbutton);
2378 LocalFree(This->custom_cancelbutton);
2379 LocalFree(This->custom_filenamelabel);
2380
2381 DestroyMenu(This->hmenu_opendropdown);
2382 DeleteObject(This->hfont_opendropdown);
2383
2385 }
2386
2387 return ref;
2388}
#define InterlockedDecrement
Definition: armddk.h:52
pKey DeleteObject()
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594

◆ IFileDialog2_fnSetCancelButtonLabel()

static HRESULT WINAPI IFileDialog2_fnSetCancelButtonLabel ( IFileDialog2 iface,
LPCWSTR  pszLabel 
)
static

Definition at line 2761 of file itemdlg.c.

2762{
2764 TRACE("%p (%s)\n", This, debugstr_w(pszLabel));
2765
2766 LocalFree(This->custom_cancelbutton);
2767 This->custom_cancelbutton = StrDupW(pszLabel);
2770
2771 return S_OK;
2772}
static void update_layout(FileDialogImpl *This)
Definition: itemdlg.c:1642
static void update_control_text(FileDialogImpl *This)
Definition: itemdlg.c:1935
#define debugstr_w
Definition: kernel32.h:32

◆ IFileDialog2_fnSetClientGuid()

static HRESULT WINAPI IFileDialog2_fnSetClientGuid ( IFileDialog2 iface,
REFGUID  guid 
)
static

Definition at line 2739 of file itemdlg.c.

2740{
2742 TRACE("%p (%s)\n", This, debugstr_guid(guid));
2743 This->client_guid = *guid;
2744 return S_OK;
2745}
const GUID * guid

◆ IFileDialog2_fnSetDefaultExtension()

static HRESULT WINAPI IFileDialog2_fnSetDefaultExtension ( IFileDialog2 iface,
LPCWSTR  pszDefaultExtension 
)
static

Definition at line 2717 of file itemdlg.c.

2718{
2720 TRACE("%p (%s)\n", This, debugstr_w(pszDefaultExtension));
2721
2722 LocalFree(This->default_ext);
2723 This->default_ext = StrDupW(pszDefaultExtension);
2724
2725 return S_OK;
2726}

◆ IFileDialog2_fnSetDefaultFolder()

static HRESULT WINAPI IFileDialog2_fnSetDefaultFolder ( IFileDialog2 iface,
IShellItem psi 
)
static

Definition at line 2545 of file itemdlg.c.

2546{
2548 TRACE("%p (%p)\n", This, psi);
2549 if(This->psi_defaultfolder)
2550 IShellItem_Release(This->psi_defaultfolder);
2551
2552 This->psi_defaultfolder = psi;
2553
2554 if(This->psi_defaultfolder)
2555 IShellItem_AddRef(This->psi_defaultfolder);
2556
2557 return S_OK;
2558}

◆ IFileDialog2_fnSetFileName()

static HRESULT WINAPI IFileDialog2_fnSetFileName ( IFileDialog2 iface,
LPCWSTR  pszName 
)
static

Definition at line 2621 of file itemdlg.c.

2622{
2624 TRACE("%p (%s)\n", iface, debugstr_w(pszName));
2625
2626 set_file_name(This, pszName);
2627
2628 return S_OK;
2629}

◆ IFileDialog2_fnSetFileNameLabel()

static HRESULT WINAPI IFileDialog2_fnSetFileNameLabel ( IFileDialog2 iface,
LPCWSTR  pszLabel 
)
static

Definition at line 2669 of file itemdlg.c.

2670{
2672 TRACE("%p (%s)\n", This, debugstr_w(pszLabel));
2673
2674 LocalFree(This->custom_filenamelabel);
2675 This->custom_filenamelabel = StrDupW(pszLabel);
2678
2679 return S_OK;
2680}

◆ IFileDialog2_fnSetFileTypeIndex()

static HRESULT WINAPI IFileDialog2_fnSetFileTypeIndex ( IFileDialog2 iface,
UINT  iFileType 
)
static

Definition at line 2427 of file itemdlg.c.

2428{
2430 TRACE("%p (%d)\n", This, iFileType);
2431
2432 if(!This->filterspecs)
2433 return E_FAIL;
2434
2435 iFileType = max(iFileType, 1);
2436 iFileType = min(iFileType, This->filterspec_count);
2437 This->filetypeindex = iFileType-1;
2438
2439 return S_OK;
2440}

◆ IFileDialog2_fnSetFileTypes()

static HRESULT WINAPI IFileDialog2_fnSetFileTypes ( IFileDialog2 iface,
UINT  cFileTypes,
const COMDLG_FILTERSPEC rgFilterSpec 
)
static

Definition at line 2400 of file itemdlg.c.

2402{
2404 UINT i;
2405 TRACE("%p (%d, %p)\n", This, cFileTypes, rgFilterSpec);
2406
2407 if(This->filterspecs)
2408 return E_UNEXPECTED;
2409
2410 if(!rgFilterSpec)
2411 return E_INVALIDARG;
2412
2413 if(!cFileTypes)
2414 return S_OK;
2415
2416 This->filterspecs = HeapAlloc(GetProcessHeap(), 0, sizeof(COMDLG_FILTERSPEC)*cFileTypes);
2417 for(i = 0; i < cFileTypes; i++)
2418 {
2419 This->filterspecs[i].pszName = StrDupW(rgFilterSpec[i].pszName);
2420 This->filterspecs[i].pszSpec = StrDupW(rgFilterSpec[i].pszSpec);
2421 }
2422 This->filterspec_count = cFileTypes;
2423
2424 return S_OK;
2425}

◆ IFileDialog2_fnSetFilter()

static HRESULT WINAPI IFileDialog2_fnSetFilter ( IFileDialog2 iface,
IShellItemFilter pFilter 
)
static

Definition at line 2754 of file itemdlg.c.

2755{
2757 FIXME("stub - %p (%p)\n", This, pFilter);
2758 return E_NOTIMPL;
2759}

◆ IFileDialog2_fnSetFolder()

static HRESULT WINAPI IFileDialog2_fnSetFolder ( IFileDialog2 iface,
IShellItem psi 
)
static

Definition at line 2560 of file itemdlg.c.

2561{
2563 TRACE("%p (%p)\n", This, psi);
2564 if(This->psi_setfolder)
2565 IShellItem_Release(This->psi_setfolder);
2566
2567 This->psi_setfolder = psi;
2568
2569 if(This->psi_setfolder)
2570 IShellItem_AddRef(This->psi_setfolder);
2571
2572 return S_OK;
2573}

◆ IFileDialog2_fnSetNavigationRoot()

static HRESULT WINAPI IFileDialog2_fnSetNavigationRoot ( IFileDialog2 iface,
IShellItem psi 
)
static

Definition at line 2774 of file itemdlg.c.

2775{
2777 FIXME("stub - %p (%p)\n", This, psi);
2778 return E_NOTIMPL;
2779}

◆ IFileDialog2_fnSetOkButtonLabel()

static HRESULT WINAPI IFileDialog2_fnSetOkButtonLabel ( IFileDialog2 iface,
LPCWSTR  pszText 
)
static

Definition at line 2656 of file itemdlg.c.

2657{
2659 TRACE("%p (%s)\n", This, debugstr_w(pszText));
2660
2661 LocalFree(This->custom_okbutton);
2662 This->custom_okbutton = StrDupW(pszText);
2665
2666 return S_OK;
2667}

◆ IFileDialog2_fnSetOptions()

static HRESULT WINAPI IFileDialog2_fnSetOptions ( IFileDialog2 iface,
FILEOPENDIALOGOPTIONS  fos 
)
static

Definition at line 2505 of file itemdlg.c.

2506{
2508 TRACE("%p (0x%x)\n", This, fos);
2509
2510 if (fos & ~(FOS_OVERWRITEPROMPT | FOS_STRICTFILETYPES | FOS_NOCHANGEDIR | FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM
2511 | FOS_ALLNONSTORAGEITEMS | FOS_NOVALIDATE | FOS_ALLOWMULTISELECT | FOS_PATHMUSTEXIST | FOS_FILEMUSTEXIST
2512 | FOS_CREATEPROMPT | FOS_SHAREAWARE | FOS_NOREADONLYRETURN | FOS_NOTESTFILECREATE | FOS_HIDEMRUPLACES
2513 | FOS_HIDEPINNEDPLACES | FOS_NODEREFERENCELINKS | FOS_DONTADDTORECENT | FOS_FORCESHOWHIDDEN
2514 | FOS_DEFAULTNOMINIMODE | FOS_FORCEPREVIEWPANEON | FOS_SUPPORTSTREAMABLEITEMS))
2515 {
2516 WARN("Invalid option %#x\n", fos);
2517 return E_INVALIDARG;
2518 }
2519
2520 if( !(This->options & FOS_PICKFOLDERS) && (fos & FOS_PICKFOLDERS) )
2521 {
2522 WCHAR buf[30];
2524 IFileDialog2_SetTitle(iface, buf);
2525 }
2526
2527 This->options = fos;
2528
2529 return S_OK;
2530}
#define WARN(fmt,...)
Definition: debug.h:112
#define IDS_SELECT_FOLDER
Definition: cdlg.h:182

◆ IFileDialog2_fnSetTitle()

static HRESULT WINAPI IFileDialog2_fnSetTitle ( IFileDialog2 iface,
LPCWSTR  pszTitle 
)
static

Definition at line 2644 of file itemdlg.c.

2645{
2647 TRACE("%p (%s)\n", This, debugstr_w(pszTitle));
2648
2649 LocalFree(This->custom_title);
2650 This->custom_title = StrDupW(pszTitle);
2652
2653 return S_OK;
2654}

◆ IFileDialog2_fnShow()

static HRESULT WINAPI IFileDialog2_fnShow ( IFileDialog2 iface,
HWND  hwndOwner 
)
static

Definition at line 2390 of file itemdlg.c.

2391{
2393 TRACE("%p (%p)\n", iface, hwndOwner);
2394
2395 This->opendropdown_has_selection = FALSE;
2396
2397 return create_dialog(This, hwndOwner);
2398}
static HRESULT create_dialog(FileDialogImpl *This, HWND parent)
Definition: itemdlg.c:2257

◆ IFileDialog2_fnUnadvise()

static HRESULT WINAPI IFileDialog2_fnUnadvise ( IFileDialog2 iface,
DWORD  dwCookie 
)
static

Definition at line 2479 of file itemdlg.c.

2480{
2482 events_client *client, *found = NULL;
2483 TRACE("%p (%d)\n", This, dwCookie);
2484
2486 {
2487 if(client->cookie == dwCookie)
2488 {
2489 found = client;
2490 break;
2491 }
2492 }
2493
2494 if(found)
2495 {
2496 list_remove(&found->entry);
2497 IFileDialogEvents_Release(found->pfde);
2498 HeapFree(GetProcessHeap(), 0, found);
2499 return S_OK;
2500 }
2501
2502 return E_INVALIDARG;
2503}
IFileDialogEvents * pfde
Definition: itemdlg.c:97
struct list entry
Definition: itemdlg.c:96

◆ IFileDialogCustomize_fnAddCheckButton()

static HRESULT WINAPI IFileDialogCustomize_fnAddCheckButton ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszLabel,
BOOL  bChecked 
)
static

Definition at line 3852 of file itemdlg.c.

3856{
3859 HRESULT hr;
3860 TRACE("%p (%d, %p, %d)\n", This, dwIDCtl, pszLabel, bChecked);
3861
3863 This->cctrl_def_height, &ctrl);
3864 if(SUCCEEDED(hr))
3865 {
3867 SendMessageW(ctrl->hwnd, BM_SETCHECK, bChecked ? BST_CHECKED : BST_UNCHECKED, 0);
3868 }
3869
3870 return hr;
3871}
static FileDialogImpl * impl_from_IFileDialogCustomize(IFileDialogCustomize *iface)
Definition: itemdlg.c:3713
static HRESULT cctrl_create_new(FileDialogImpl *This, DWORD id, LPCWSTR text, LPCWSTR wndclass, DWORD ctrl_wsflags, DWORD ctrl_exflags, UINT height, customctrl **ppctrl)
Definition: itemdlg.c:1140
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define WC_BUTTONW
Definition: commctrl.h:4623
#define BS_MULTILINE
Definition: winuser.h:267

◆ IFileDialogCustomize_fnAddComboBox()

static HRESULT WINAPI IFileDialogCustomize_fnAddComboBox ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 3818 of file itemdlg.c.

3820{
3823 HRESULT hr;
3824 TRACE("%p (%d)\n", This, dwIDCtl);
3825
3827 This->cctrl_def_height, &ctrl);
3828 if(SUCCEEDED(hr))
3829 ctrl->type = IDLG_CCTRL_COMBOBOX;
3830
3831 return hr;
3832}
#define WC_COMBOBOXW
Definition: commctrl.h:4717
#define CBS_DROPDOWNLIST
Definition: winuser.h:284

◆ IFileDialogCustomize_fnAddControlItem()

static HRESULT WINAPI IFileDialogCustomize_fnAddControlItem ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem,
LPCWSTR  pszLabel 
)
static

Definition at line 4075 of file itemdlg.c.

4079{
4081 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4082 HRESULT hr;
4083 TRACE("%p (%d, %d, %s)\n", This, dwIDCtl, dwIDItem, debugstr_w(pszLabel));
4084
4085 if(!ctrl) return E_FAIL;
4086
4087 switch(ctrl->type)
4088 {
4090 {
4091 UINT index;
4093
4094 hr = add_item(ctrl, dwIDItem, pszLabel, &item);
4095
4096 if (FAILED(hr)) return hr;
4097
4098 index = SendMessageW(ctrl->hwnd, CB_ADDSTRING, 0, (LPARAM)pszLabel);
4099 SendMessageW(ctrl->hwnd, CB_SETITEMDATA, index, dwIDItem);
4100
4101 return S_OK;
4102 }
4103 case IDLG_CCTRL_MENU:
4105 {
4107 HMENU hmenu;
4108
4109 hr = add_item(ctrl, dwIDItem, pszLabel, &item);
4110
4111 if (FAILED(hr)) return hr;
4112
4113 if (ctrl->type == IDLG_CCTRL_MENU)
4114 {
4115 TBBUTTON tbb;
4116 SendMessageW(ctrl->hwnd, TB_GETBUTTON, 0, (LPARAM)&tbb);
4117 hmenu = (HMENU)tbb.dwData;
4118 }
4119 else /* ctrl->type == IDLG_CCTRL_OPENDROPDOWN */
4120 hmenu = This->hmenu_opendropdown;
4121
4122 AppendMenuW(hmenu, MF_STRING, dwIDItem, pszLabel);
4123 return S_OK;
4124 }
4126 {
4128
4129 hr = add_item(ctrl, dwIDItem, pszLabel, &item);
4130
4131 if (SUCCEEDED(hr))
4132 {
4133 item->hwnd = CreateWindowExW(0, WC_BUTTONW, pszLabel,
4135 0, 0, 0, 0, ctrl->hwnd, ULongToHandle(dwIDItem), COMDLG32_hInstance, 0);
4136
4137 if (!item->hwnd)
4138 {
4139 ERR("Failed to create radio button\n");
4140 list_remove(&item->entry);
4141 item_free(item);
4142 return E_FAIL;
4143 }
4144 }
4145
4146 return hr;
4147 }
4148 default:
4149 break;
4150 }
4151
4152 return E_NOINTERFACE; /* win7 */
4153}
#define index(s, c)
Definition: various.h:29
#define ULongToHandle(h)
Definition: basetsd.h:81
static HRESULT add_item(customctrl *parent, DWORD itemid, LPCWSTR label, cctrl_item **result)
Definition: itemdlg.c:785
GLuint index
Definition: glext.h:6031
#define BS_RADIOBUTTON
Definition: pedump.c:655
static HMENU hmenu
Definition: win.c:66
#define CB_SETITEMDATA
Definition: winuser.h:1966
#define MF_STRING
Definition: winuser.h:138
#define CB_ADDSTRING
Definition: winuser.h:1936
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)

◆ IFileDialogCustomize_fnAddEditBox()

static HRESULT WINAPI IFileDialogCustomize_fnAddEditBox ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszText 
)
static

Definition at line 3873 of file itemdlg.c.

3876{
3879 HRESULT hr;
3880 TRACE("%p (%d, %p)\n", This, dwIDCtl, pszText);
3881
3883 This->cctrl_def_height, &ctrl);
3884 if(SUCCEEDED(hr))
3885 ctrl->type = IDLG_CCTRL_EDITBOX;
3886
3887 return hr;
3888}
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WC_EDITW
Definition: commctrl.h:4687
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

◆ IFileDialogCustomize_fnAddMenu()

static HRESULT WINAPI IFileDialogCustomize_fnAddMenu ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszLabel 
)
static

Definition at line 3769 of file itemdlg.c.

3772{
3775 TBBUTTON tbb;
3776 HRESULT hr;
3777 TRACE("%p (%d, %p)\n", This, dwIDCtl, pszLabel);
3778
3781 This->cctrl_def_height, &ctrl);
3782 if(SUCCEEDED(hr))
3783 {
3784 SendMessageW(ctrl->hwnd, TB_BUTTONSTRUCTSIZE, sizeof(tbb), 0);
3785 ctrl->type = IDLG_CCTRL_MENU;
3786
3787 /* Add the actual button with a popup menu. */
3788 tbb.iBitmap = I_IMAGENONE;
3790 tbb.iString = (DWORD_PTR)pszLabel;
3793 tbb.idCommand = 1;
3794
3795 SendMessageW(ctrl->hwnd, TB_ADDBUTTONSW, 1, (LPARAM)&tbb);
3796 }
3797
3798 return hr;
3799}
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define TB_ADDBUTTONSW
Definition: commctrl.h:1266
#define I_IMAGENONE
Definition: commctrl.h:2386
#define BTNS_WHOLEDROPDOWN
Definition: commctrl.h:1007
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define DWORD_PTR
Definition: treelist.c:76
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838

◆ IFileDialogCustomize_fnAddPushButton()

static HRESULT WINAPI IFileDialogCustomize_fnAddPushButton ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszLabel 
)
static

Definition at line 3801 of file itemdlg.c.

3804{
3807 HRESULT hr;
3808 TRACE("%p (%d, %p)\n", This, dwIDCtl, pszLabel);
3809
3810 hr = cctrl_create_new(This, dwIDCtl, pszLabel, WC_BUTTONW, BS_MULTILINE, 0,
3811 This->cctrl_def_height, &ctrl);
3812 if(SUCCEEDED(hr))
3814
3815 return hr;
3816}

◆ IFileDialogCustomize_fnAddRadioButtonList()

static HRESULT WINAPI IFileDialogCustomize_fnAddRadioButtonList ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 3834 of file itemdlg.c.

3836{
3839 HRESULT hr;
3840 TRACE("%p (%d)\n", This, dwIDCtl);
3841
3842 hr = cctrl_create_new(This, dwIDCtl, NULL, radiobuttonlistW, 0, 0, 0, &ctrl);
3843 if(SUCCEEDED(hr))
3844 {
3847 }
3848
3849 return hr;
3850}
static const WCHAR radiobuttonlistW[]
Definition: itemdlg.c:55

◆ IFileDialogCustomize_fnAddRef()

static ULONG WINAPI IFileDialogCustomize_fnAddRef ( IFileDialogCustomize *  iface)
static

Definition at line 3725 of file itemdlg.c.

3726{
3728 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3729}

◆ IFileDialogCustomize_fnAddSeparator()

static HRESULT WINAPI IFileDialogCustomize_fnAddSeparator ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 3890 of file itemdlg.c.

3892{
3895 HRESULT hr;
3896 TRACE("%p (%d)\n", This, dwIDCtl);
3897
3900 if(SUCCEEDED(hr))
3901 ctrl->type = IDLG_CCTRL_SEPARATOR;
3902
3903 return hr;
3904}
#define WC_STATICW
Definition: commctrl.h:4680
#define SM_CYEDGE
Definition: winuser.h:1009
#define SS_ETCHEDHORZ
Definition: winuser.h:343
int WINAPI GetSystemMetrics(_In_ int)

◆ IFileDialogCustomize_fnAddText()

static HRESULT WINAPI IFileDialogCustomize_fnAddText ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszText 
)
static

Definition at line 3906 of file itemdlg.c.

3909{
3912 HRESULT hr;
3913 TRACE("%p (%d, %p)\n", This, dwIDCtl, pszText);
3914
3915 hr = cctrl_create_new(This, dwIDCtl, pszText, WC_STATICW, 0, 0,
3916 This->cctrl_def_height, &ctrl);
3917 if(SUCCEEDED(hr))
3918 ctrl->type = IDLG_CCTRL_TEXT;
3919
3920 return hr;
3921}

◆ IFileDialogCustomize_fnEnableOpenDropDown()

static HRESULT WINAPI IFileDialogCustomize_fnEnableOpenDropDown ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 3737 of file itemdlg.c.

3739{
3741 MENUINFO mi;
3742 TRACE("%p (%d)\n", This, dwIDCtl);
3743
3744 if (This->hmenu_opendropdown || get_cctrl(This, dwIDCtl))
3745 return E_UNEXPECTED;
3746
3747 This->hmenu_opendropdown = CreatePopupMenu();
3748
3749 if (!This->hmenu_opendropdown)
3750 return E_OUTOFMEMORY;
3751
3752 mi.cbSize = sizeof(mi);
3753 mi.fMask = MIM_STYLE;
3754 mi.dwStyle = MNS_NOTIFYBYPOS;
3755 SetMenuInfo(This->hmenu_opendropdown, &mi);
3756
3757 This->cctrl_opendropdown.hwnd = NULL;
3758 This->cctrl_opendropdown.wrapper_hwnd = NULL;
3759 This->cctrl_opendropdown.id = dwIDCtl;
3760 This->cctrl_opendropdown.dlgid = 0;
3761 This->cctrl_opendropdown.type = IDLG_CCTRL_OPENDROPDOWN;
3762 This->cctrl_opendropdown.cdcstate = CDCS_ENABLED | CDCS_VISIBLE;
3763 list_init(&This->cctrl_opendropdown.sub_cctrls);
3764 list_init(&This->cctrl_opendropdown.sub_items);
3765
3766 return S_OK;
3767}
DWORD cbSize
Definition: winuser.h:3784
static MONITORINFO mi
Definition: win.c:7338
#define MNS_NOTIFYBYPOS
Definition: winuser.h:759
BOOL WINAPI SetMenuInfo(_In_ HMENU, _In_ LPCMENUINFO)

◆ IFileDialogCustomize_fnEndVisualGroup()

static HRESULT WINAPI IFileDialogCustomize_fnEndVisualGroup ( IFileDialogCustomize *  iface)
static

Definition at line 4539 of file itemdlg.c.

4540{
4542 TRACE("%p\n", This);
4543
4544 This->cctrl_active_vg = NULL;
4545
4546 return S_OK;
4547}

◆ IFileDialogCustomize_fnGetCheckButtonState()

static HRESULT WINAPI IFileDialogCustomize_fnGetCheckButtonState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
BOOL pbChecked 
)
static

Definition at line 4032 of file itemdlg.c.

4035{
4037 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4038 TRACE("%p (%d, %p)\n", This, dwIDCtl, pbChecked);
4039
4040 if(ctrl && ctrl->hwnd)
4041 *pbChecked = (SendMessageW(ctrl->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED);
4042
4043 return S_OK;
4044}
#define BM_GETCHECK
Definition: winuser.h:1918

◆ IFileDialogCustomize_fnGetControlItemState()

static HRESULT WINAPI IFileDialogCustomize_fnGetControlItemState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem,
CDCONTROLSTATEF *  pdwState 
)
static

Definition at line 4247 of file itemdlg.c.

4251{
4253 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4254 TRACE("%p (%d, %d, %p)\n", This, dwIDCtl, dwIDItem, pdwState);
4255
4256 if(!ctrl) return E_FAIL;
4257
4258 switch(ctrl->type)
4259 {
4261 case IDLG_CCTRL_MENU:
4264 {
4266
4267 item = get_item(ctrl, dwIDItem, 0, NULL);
4268
4269 if (!item)
4270 return E_UNEXPECTED;
4271
4272 *pdwState = item->cdcstate;
4273
4274 return S_OK;
4275 }
4276 default:
4277 break;
4278 }
4279
4280 return E_FAIL;
4281}

◆ IFileDialogCustomize_fnGetControlState()

static HRESULT WINAPI IFileDialogCustomize_fnGetControlState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
CDCONTROLSTATEF *  pdwState 
)
static

Definition at line 3951 of file itemdlg.c.

3954{
3956 customctrl *ctrl = get_cctrl(This, dwIDCtl);
3957 TRACE("%p (%d, %p)\n", This, dwIDCtl, pdwState);
3958
3959 if(!ctrl || ctrl->type == IDLG_CCTRL_OPENDROPDOWN) return E_NOTIMPL;
3960
3961 *pdwState = ctrl->cdcstate;
3962 return S_OK;
3963}

◆ IFileDialogCustomize_fnGetEditBoxText()

static HRESULT WINAPI IFileDialogCustomize_fnGetEditBoxText ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
WCHAR **  ppszText 
)
static

Definition at line 3997 of file itemdlg.c.

4000{
4002 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4003 WCHAR len, *text;
4004 TRACE("%p (%d, %p)\n", This, dwIDCtl, ppszText);
4005
4006 if(!ctrl || !ctrl->hwnd || !(len = SendMessageW(ctrl->hwnd, WM_GETTEXTLENGTH, 0, 0)))
4007 return E_FAIL;
4008
4009 text = CoTaskMemAlloc(sizeof(WCHAR)*(len+1));
4010 if(!text) return E_FAIL;
4011
4013 *ppszText = text;
4014 return S_OK;
4015}

◆ IFileDialogCustomize_fnGetSelectedControlItem()

static HRESULT WINAPI IFileDialogCustomize_fnGetSelectedControlItem ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD pdwIDItem 
)
static

Definition at line 4407 of file itemdlg.c.

4410{
4412 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4413 TRACE("%p (%d, %p)\n", This, dwIDCtl, pdwIDItem);
4414
4415 if(!ctrl) return E_FAIL;
4416
4417 switch(ctrl->type)
4418 {
4420 {
4421 UINT index = SendMessageW(ctrl->hwnd, CB_GETCURSEL, 0, 0);
4422 if(index == CB_ERR)
4423 return E_FAIL;
4424
4425 *pdwIDItem = SendMessageW(ctrl->hwnd, CB_GETITEMDATA, index, 0);
4426 return S_OK;
4427 }
4429 if (This->opendropdown_has_selection)
4430 {
4431 *pdwIDItem = This->opendropdown_selection;
4432 return S_OK;
4433 }
4434 else
4435 {
4436 /* Return first enabled item. */
4438
4439 if (item)
4440 {
4441 *pdwIDItem = item->id;
4442 return S_OK;
4443 }
4444
4445 WARN("no enabled items in open dropdown\n");
4446 return E_FAIL;
4447 }
4449 {
4451
4453 {
4454 if (SendMessageW(item->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED)
4455 {
4456 *pdwIDItem = item->id;
4457 return S_OK;
4458 }
4459 }
4460
4461 WARN("no checked items in radio button list\n");
4462 return E_FAIL;
4463 }
4464 default:
4465 FIXME("Unsupported control type %d\n", ctrl->type);
4466 }
4467
4468 return E_NOTIMPL;
4469}
static cctrl_item * get_first_item(customctrl *parent)
Definition: itemdlg.c:772
#define CB_GETCURSEL
Definition: winuser.h:1943

◆ IFileDialogCustomize_fnMakeProminent()

static HRESULT WINAPI IFileDialogCustomize_fnMakeProminent ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 4549 of file itemdlg.c.

4551{
4553 FIXME("stub - %p (%d)\n", This, dwIDCtl);
4554 return S_OK;
4555}

◆ IFileDialogCustomize_fnQueryInterface()

static HRESULT WINAPI IFileDialogCustomize_fnQueryInterface ( IFileDialogCustomize *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3718 of file itemdlg.c.

3720{
3722 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3723}

◆ IFileDialogCustomize_fnRelease()

static ULONG WINAPI IFileDialogCustomize_fnRelease ( IFileDialogCustomize *  iface)
static

Definition at line 3731 of file itemdlg.c.

3732{
3734 return IFileDialog2_Release(&This->IFileDialog2_iface);
3735}

◆ IFileDialogCustomize_fnRemoveAllControlItems()

static HRESULT WINAPI IFileDialogCustomize_fnRemoveAllControlItems ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl 
)
static

Definition at line 4237 of file itemdlg.c.

4239{
4241 TRACE("%p (%d)\n", This, dwIDCtl);
4242
4243 /* Not implemented by native */
4244 return E_NOTIMPL;
4245}

◆ IFileDialogCustomize_fnRemoveControlItem()

static HRESULT WINAPI IFileDialogCustomize_fnRemoveControlItem ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem 
)
static

Definition at line 4155 of file itemdlg.c.

4158{
4160 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4161 TRACE("%p (%d, %d)\n", This, dwIDCtl, dwIDItem);
4162
4163 if(!ctrl) return E_FAIL;
4164
4165 switch(ctrl->type)
4166 {
4168 {
4170 DWORD position;
4171
4172 item = get_item(ctrl, dwIDItem, CDCS_VISIBLE|CDCS_ENABLED, &position);
4173
4174 if ((item->cdcstate & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED))
4175 {
4176 if(SendMessageW(ctrl->hwnd, CB_DELETESTRING, position, 0) == CB_ERR)
4177 return E_FAIL;
4178 }
4179
4180 list_remove(&item->entry);
4181 item_free(item);
4182
4183 return S_OK;
4184 }
4185 case IDLG_CCTRL_MENU:
4187 {
4188 HMENU hmenu;
4190
4191 item = get_item(ctrl, dwIDItem, 0, NULL);
4192
4193 if (!item)
4194 return E_UNEXPECTED;
4195
4196 if (item->cdcstate & CDCS_VISIBLE)
4197 {
4198 if (ctrl->type == IDLG_CCTRL_MENU)
4199 {
4200 TBBUTTON tbb;
4201 SendMessageW(ctrl->hwnd, TB_GETBUTTON, 0, (LPARAM)&tbb);
4202 hmenu = (HMENU)tbb.dwData;
4203 }
4204 else /* ctrl->type == IDLG_CCTRL_OPENDROPDOWN */
4205 hmenu = This->hmenu_opendropdown;
4206
4207 if(!hmenu || !DeleteMenu(hmenu, dwIDItem, MF_BYCOMMAND))
4208 return E_UNEXPECTED;
4209 }
4210
4211 list_remove(&item->entry);
4212 item_free(item);
4213
4214 return S_OK;
4215 }
4217 {
4219
4220 item = get_item(ctrl, dwIDItem, 0, NULL);
4221
4222 if (!item)
4223 return E_UNEXPECTED;
4224
4225 list_remove(&item->entry);
4226 item_free(item);
4227
4228 return S_OK;
4229 }
4230 default:
4231 break;
4232 }
4233
4234 return E_FAIL;
4235}
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define CB_DELETESTRING
Definition: winuser.h:1937

◆ IFileDialogCustomize_fnSetCheckButtonState()

static HRESULT WINAPI IFileDialogCustomize_fnSetCheckButtonState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
BOOL  bChecked 
)
static

Definition at line 4046 of file itemdlg.c.

4049{
4051 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4052 TRACE("%p (%d, %d)\n", This, dwIDCtl, bChecked);
4053
4054 if(ctrl && ctrl->hwnd)
4055 SendMessageW(ctrl->hwnd, BM_SETCHECK, bChecked ? BST_CHECKED:BST_UNCHECKED, 0);
4056
4057 return S_OK;
4058}

◆ IFileDialogCustomize_fnSetControlItemState()

static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem,
CDCONTROLSTATEF  dwState 
)
static

Definition at line 4283 of file itemdlg.c.

4287{
4289 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4290 TRACE("%p (%d, %d, %x)\n", This, dwIDCtl, dwIDItem, dwState);
4291
4292 if(!ctrl) return E_FAIL;
4293
4294 switch(ctrl->type)
4295 {
4297 {
4299 BOOL visible, was_visible;
4300 DWORD position;
4301
4302 item = get_item(ctrl, dwIDItem, CDCS_VISIBLE|CDCS_ENABLED, &position);
4303
4304 if (!item)
4305 return E_UNEXPECTED;
4306
4307 visible = ((dwState & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED));
4308 was_visible = ((item->cdcstate & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED));
4309
4310 if (visible && !was_visible)
4311 {
4312 SendMessageW(ctrl->hwnd, CB_INSERTSTRING, position, (LPARAM)item->label);
4313 SendMessageW(ctrl->hwnd, CB_SETITEMDATA, position, dwIDItem);
4314 }
4315 else if (!visible && was_visible)
4316 {
4317 SendMessageW(ctrl->hwnd, CB_DELETESTRING, position, 0);
4318 }
4319
4320 item->cdcstate = dwState;
4321
4322 return S_OK;
4323 }
4324 case IDLG_CCTRL_MENU:
4326 {
4327 HMENU hmenu;
4329 CDCONTROLSTATEF prev_state;
4330 DWORD position;
4331
4332 item = get_item(ctrl, dwIDItem, CDCS_VISIBLE, &position);
4333
4334 if (!item)
4335 return E_UNEXPECTED;
4336
4337 prev_state = item->cdcstate;
4338
4339 if (ctrl->type == IDLG_CCTRL_MENU)
4340 {
4341 TBBUTTON tbb;
4342 SendMessageW(ctrl->hwnd, TB_GETBUTTON, 0, (LPARAM)&tbb);
4343 hmenu = (HMENU)tbb.dwData;
4344 }
4345 else /* ctrl->type == IDLG_CCTRL_OPENDROPDOWN */
4346 hmenu = This->hmenu_opendropdown;
4347
4348 if (dwState & CDCS_VISIBLE)
4349 {
4350 if (prev_state & CDCS_VISIBLE)
4351 {
4352 /* change state */
4353 EnableMenuItem(hmenu, dwIDItem,
4355 }
4356 else
4357 {
4358 /* show item */
4359 MENUITEMINFOW mii;
4360
4361 mii.cbSize = sizeof(mii);
4363 mii.fState = (dwState & CDCS_ENABLED) ? MFS_ENABLED : MFS_DISABLED;
4364 mii.wID = dwIDItem;
4365 mii.dwTypeData = item->label;
4366
4367 InsertMenuItemW(hmenu, position, TRUE, &mii);
4368 }
4369 }
4370 else if (prev_state & CDCS_VISIBLE)
4371 {
4372 /* hide item */
4373 DeleteMenu(hmenu, dwIDItem, MF_BYCOMMAND);
4374 }
4375
4376 item->cdcstate = dwState;
4377
4378 if (ctrl->type == IDLG_CCTRL_OPENDROPDOWN)
4379 {
4382 }
4383
4384 return S_OK;
4385 }
4387 {
4389
4390 item = get_item(ctrl, dwIDItem, CDCS_VISIBLE, NULL);
4391
4392 if (!item)
4393 return E_UNEXPECTED;
4394
4395 /* Oddly, native allows setting this but doesn't seem to do anything with it. */
4396 item->cdcstate = dwState;
4397
4398 return S_OK;
4399 }
4400 default:
4401 break;
4402 }
4403
4404 return E_FAIL;
4405}
LPWSTR dwTypeData
Definition: winuser.h:3269
#define MIIM_STRING
Definition: winuser.h:727
#define MIIM_ID
Definition: winuser.h:722
#define MFS_DISABLED
Definition: winuser.h:749
#define MIIM_STATE
Definition: winuser.h:721
#define MFS_ENABLED
Definition: winuser.h:750
#define CB_INSERTSTRING
Definition: winuser.h:1957
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)

◆ IFileDialogCustomize_fnSetControlItemText()

static HRESULT WINAPI IFileDialogCustomize_fnSetControlItemText ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem,
LPCWSTR  pszLabel 
)
static

Definition at line 4557 of file itemdlg.c.

4561{
4563 FIXME("stub - %p (%d, %d, %s)\n", This, dwIDCtl, dwIDItem, debugstr_w(pszLabel));
4564 return E_NOTIMPL;
4565}

◆ IFileDialogCustomize_fnSetControlLabel()

static HRESULT WINAPI IFileDialogCustomize_fnSetControlLabel ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszLabel 
)
static

Definition at line 3923 of file itemdlg.c.

3926{
3928 customctrl *ctrl = get_cctrl(This, dwIDCtl);
3929 TRACE("%p (%d, %p)\n", This, dwIDCtl, pszLabel);
3930
3931 if(!ctrl) return E_INVALIDARG;
3932
3933 switch(ctrl->type)
3934 {
3935 case IDLG_CCTRL_MENU:
3938 case IDLG_CCTRL_TEXT:
3940 SendMessageW(ctrl->hwnd, WM_SETTEXT, 0, (LPARAM)pszLabel);
3941 break;
3943 return E_NOTIMPL;
3944 default:
3945 break;
3946 }
3947
3948 return S_OK;
3949}
#define WM_SETTEXT
Definition: winuser.h:1617

◆ IFileDialogCustomize_fnSetControlState()

static HRESULT WINAPI IFileDialogCustomize_fnSetControlState ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
CDCONTROLSTATEF  dwState 
)
static

Definition at line 3965 of file itemdlg.c.

3968{
3970 customctrl *ctrl = get_cctrl(This,dwIDCtl);
3971 TRACE("%p (%d, %x)\n", This, dwIDCtl, dwState);
3972
3973 if(ctrl && ctrl->hwnd)
3974 {
3975 LONG wndstyle = GetWindowLongW(ctrl->hwnd, GWL_STYLE);
3976
3977 if(dwState & CDCS_ENABLED)
3978 wndstyle &= ~(WS_DISABLED);
3979 else
3980 wndstyle |= WS_DISABLED;
3981
3982 if(dwState & CDCS_VISIBLE)
3983 wndstyle |= WS_VISIBLE;
3984 else
3985 wndstyle &= ~(WS_VISIBLE);
3986
3987 SetWindowLongW(ctrl->hwnd, GWL_STYLE, wndstyle);
3988
3989 /* We save the state separately since at least one application
3990 * relies on being able to hide a control. */
3991 ctrl->cdcstate = dwState;
3992 }
3993
3994 return S_OK;
3995}
#define WS_DISABLED
Definition: pedump.c:621

◆ IFileDialogCustomize_fnSetEditBoxText()

static HRESULT WINAPI IFileDialogCustomize_fnSetEditBoxText ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszText 
)
static

Definition at line 4017 of file itemdlg.c.

4020{
4022 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4023 TRACE("%p (%d, %s)\n", This, dwIDCtl, debugstr_w(pszText));
4024
4025 if(!ctrl || ctrl->type != IDLG_CCTRL_EDITBOX)
4026 return E_FAIL;
4027
4028 SendMessageW(ctrl->hwnd, WM_SETTEXT, 0, (LPARAM)pszText);
4029 return S_OK;
4030}

◆ IFileDialogCustomize_fnSetSelectedControlItem()

static HRESULT WINAPI IFileDialogCustomize_fnSetSelectedControlItem ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
DWORD  dwIDItem 
)
static

Definition at line 4471 of file itemdlg.c.

4474{
4476 customctrl *ctrl = get_cctrl(This, dwIDCtl);
4477 TRACE("%p (%d, %d)\n", This, dwIDCtl, dwIDItem);
4478
4479 if(!ctrl) return E_INVALIDARG;
4480
4481 switch(ctrl->type)
4482 {
4484 {
4485 UINT index = get_combobox_index_from_id(ctrl->hwnd, dwIDItem);
4486
4487 if(index == -1)
4488 return E_INVALIDARG;
4489
4490 if(SendMessageW(ctrl->hwnd, CB_SETCURSEL, index, 0) == CB_ERR)
4491 return E_FAIL;
4492
4493 return S_OK;
4494 }
4496 {
4498
4499 item = get_item(ctrl, dwIDItem, 0, NULL);
4500
4501 if (item)
4502 {
4504 return S_OK;
4505 }
4506
4507 return E_INVALIDARG;
4508 }
4509 default:
4510 FIXME("Unsupported control type %d\n", ctrl->type);
4511 }
4512
4513 return E_INVALIDARG;
4514}
static void radiobuttonlist_set_selected_item(FileDialogImpl *This, customctrl *ctrl, cctrl_item *item)
Definition: itemdlg.c:1424
static UINT get_combobox_index_from_id(HWND cb_hwnd, DWORD dwIDItem)
Definition: itemdlg.c:4060
#define CB_SETCURSEL
Definition: winuser.h:1961

◆ IFileDialogCustomize_fnStartVisualGroup()

static HRESULT WINAPI IFileDialogCustomize_fnStartVisualGroup ( IFileDialogCustomize *  iface,
DWORD  dwIDCtl,
LPCWSTR  pszLabel 
)
static

Definition at line 4516 of file itemdlg.c.

4519{
4521 customctrl *vg;
4522 HRESULT hr;
4523 TRACE("%p (%d, %s)\n", This, dwIDCtl, debugstr_w(pszLabel));
4524
4525 if(This->cctrl_active_vg)
4526 return E_UNEXPECTED;
4527
4528 hr = cctrl_create_new(This, dwIDCtl, pszLabel, WC_STATICW, 0, 0,
4529 This->cctrl_def_height, &vg);
4530 if(SUCCEEDED(hr))
4531 {
4533 This->cctrl_active_vg = vg;
4534 }
4535
4536 return hr;
4537}
enum ITEMDLG_CCTRL_TYPE type
Definition: itemdlg.c:86

◆ IFileOpenDialog_fnAddPlace()

static HRESULT WINAPI IFileOpenDialog_fnAddPlace ( IFileOpenDialog *  iface,
IShellItem psi,
FDAP  fdap 
)
static

Definition at line 2950 of file itemdlg.c.

2951{
2953 return IFileDialog2_AddPlace(&This->IFileDialog2_iface, psi, fdap);
2954}
static FileDialogImpl * impl_from_IFileOpenDialog(IFileOpenDialog *iface)
Definition: itemdlg.c:2816

◆ IFileOpenDialog_fnAddRef()

static ULONG WINAPI IFileOpenDialog_fnAddRef ( IFileOpenDialog *  iface)
static

Definition at line 2828 of file itemdlg.c.

2829{
2831 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
2832}

◆ IFileOpenDialog_fnAdvise()

static HRESULT WINAPI IFileOpenDialog_fnAdvise ( IFileOpenDialog *  iface,
IFileDialogEvents pfde,
DWORD pdwCookie 
)
static

Definition at line 2865 of file itemdlg.c.

2867{
2869 return IFileDialog2_Advise(&This->IFileDialog2_iface, pfde, pdwCookie);
2870}

◆ IFileOpenDialog_fnClearClientData()

static HRESULT WINAPI IFileOpenDialog_fnClearClientData ( IFileOpenDialog *  iface)
static

Definition at line 2975 of file itemdlg.c.

2976{
2978 return IFileDialog2_ClearClientData(&This->IFileDialog2_iface);
2979}

◆ IFileOpenDialog_fnClose()

static HRESULT WINAPI IFileOpenDialog_fnClose ( IFileOpenDialog *  iface,
HRESULT  hr 
)
static

Definition at line 2963 of file itemdlg.c.

2964{
2966 return IFileDialog2_Close(&This->IFileDialog2_iface, hr);
2967}

◆ IFileOpenDialog_fnGetCurrentSelection()

static HRESULT WINAPI IFileOpenDialog_fnGetCurrentSelection ( IFileOpenDialog *  iface,
IShellItem **  ppsi 
)
static

Definition at line 2908 of file itemdlg.c.

2909{
2911 return IFileDialog2_GetCurrentSelection(&This->IFileDialog2_iface, ppsi);
2912}

◆ IFileOpenDialog_fnGetFileName()

static HRESULT WINAPI IFileOpenDialog_fnGetFileName ( IFileOpenDialog *  iface,
LPWSTR pszName 
)
static

Definition at line 2920 of file itemdlg.c.

2921{
2923 return IFileDialog2_GetFileName(&This->IFileDialog2_iface, pszName);
2924}

◆ IFileOpenDialog_fnGetFileTypeIndex()

static HRESULT WINAPI IFileOpenDialog_fnGetFileTypeIndex ( IFileOpenDialog *  iface,
UINT piFileType 
)
static

Definition at line 2859 of file itemdlg.c.

2860{
2862 return IFileDialog2_GetFileTypeIndex(&This->IFileDialog2_iface, piFileType);
2863}

◆ IFileOpenDialog_fnGetFolder()

static HRESULT WINAPI IFileOpenDialog_fnGetFolder ( IFileOpenDialog *  iface,
IShellItem **  ppsi 
)
static

Definition at line 2902 of file itemdlg.c.

2903{
2905 return IFileDialog2_GetFolder(&This->IFileDialog2_iface, ppsi);
2906}

◆ IFileOpenDialog_fnGetOptions()

static HRESULT WINAPI IFileOpenDialog_fnGetOptions ( IFileOpenDialog *  iface,
FILEOPENDIALOGOPTIONS *  pfos 
)
static

Definition at line 2884 of file itemdlg.c.

2885{
2887 return IFileDialog2_GetOptions(&This->IFileDialog2_iface, pfos);
2888}

◆ IFileOpenDialog_fnGetResult()

static HRESULT WINAPI IFileOpenDialog_fnGetResult ( IFileOpenDialog *  iface,
IShellItem **  ppsi 
)
static

Definition at line 2944 of file itemdlg.c.

2945{
2947 return IFileDialog2_GetResult(&This->IFileDialog2_iface, ppsi);
2948}

◆ IFileOpenDialog_fnGetResults()

static HRESULT WINAPI IFileOpenDialog_fnGetResults ( IFileOpenDialog *  iface,
IShellItemArray **  ppenum 
)
static

Definition at line 2987 of file itemdlg.c.

2988{
2990 TRACE("%p (%p)\n", This, ppenum);
2991
2992 *ppenum = This->psia_results;
2993
2994 if(*ppenum)
2995 {
2996 IShellItemArray_AddRef(*ppenum);
2997 return S_OK;
2998 }
2999
3000 return E_FAIL;
3001}

◆ IFileOpenDialog_fnGetSelectedItems()

static HRESULT WINAPI IFileOpenDialog_fnGetSelectedItems ( IFileOpenDialog *  iface,
IShellItemArray **  ppsai 
)
static

Definition at line 3003 of file itemdlg.c.

3004{
3006 TRACE("%p (%p)\n", This, ppsai);
3007
3008 if(This->psia_selection)
3009 {
3010 *ppsai = This->psia_selection;
3011 IShellItemArray_AddRef(*ppsai);
3012 return S_OK;
3013 }
3014
3015 return E_FAIL;
3016}

◆ IFileOpenDialog_fnQueryInterface()

static HRESULT WINAPI IFileOpenDialog_fnQueryInterface ( IFileOpenDialog *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 2821 of file itemdlg.c.

2823{
2825 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
2826}

◆ IFileOpenDialog_fnRelease()

static ULONG WINAPI IFileOpenDialog_fnRelease ( IFileOpenDialog *  iface)
static

Definition at line 2834 of file itemdlg.c.

2835{
2837 return IFileDialog2_Release(&This->IFileDialog2_iface);
2838}

◆ IFileOpenDialog_fnSetClientGuid()

static HRESULT WINAPI IFileOpenDialog_fnSetClientGuid ( IFileOpenDialog *  iface,
REFGUID  guid 
)
static

Definition at line 2969 of file itemdlg.c.

2970{
2972 return IFileDialog2_SetClientGuid(&This->IFileDialog2_iface, guid);
2973}

◆ IFileOpenDialog_fnSetDefaultExtension()

static HRESULT WINAPI IFileOpenDialog_fnSetDefaultExtension ( IFileOpenDialog *  iface,
LPCWSTR  pszDefaultExtension 
)
static

Definition at line 2956 of file itemdlg.c.

2958{
2960 return IFileDialog2_SetDefaultExtension(&This->IFileDialog2_iface, pszDefaultExtension);
2961}

◆ IFileOpenDialog_fnSetDefaultFolder()

static HRESULT WINAPI IFileOpenDialog_fnSetDefaultFolder ( IFileOpenDialog *  iface,
IShellItem psi 
)
static

Definition at line 2890 of file itemdlg.c.

2891{
2893 return IFileDialog2_SetDefaultFolder(&This->IFileDialog2_iface, psi);
2894}

◆ IFileOpenDialog_fnSetFileName()

static HRESULT WINAPI IFileOpenDialog_fnSetFileName ( IFileOpenDialog *  iface,
LPCWSTR  pszName 
)
static

Definition at line 2914 of file itemdlg.c.

2915{
2917 return IFileDialog2_SetFileName(&This->IFileDialog2_iface, pszName);
2918}

◆ IFileOpenDialog_fnSetFileNameLabel()

static HRESULT WINAPI IFileOpenDialog_fnSetFileNameLabel ( IFileOpenDialog *  iface,
LPCWSTR  pszLabel 
)
static

Definition at line 2938 of file itemdlg.c.

2939{
2941 return IFileDialog2_SetFileNameLabel(&This->IFileDialog2_iface, pszLabel);
2942}

◆ IFileOpenDialog_fnSetFileTypeIndex()

static HRESULT WINAPI IFileOpenDialog_fnSetFileTypeIndex ( IFileOpenDialog *  iface,
UINT  iFileType 
)
static

Definition at line 2853 of file itemdlg.c.

2854{
2856 return IFileDialog2_SetFileTypeIndex(&This->IFileDialog2_iface, iFileType);
2857}

◆ IFileOpenDialog_fnSetFileTypes()

static HRESULT WINAPI IFileOpenDialog_fnSetFileTypes ( IFileOpenDialog *  iface,
UINT  cFileTypes,
const COMDLG_FILTERSPEC rgFilterSpec 
)
static

Definition at line 2846 of file itemdlg.c.

2848{
2850 return IFileDialog2_SetFileTypes(&This->IFileDialog2_iface, cFileTypes, rgFilterSpec);
2851}

◆ IFileOpenDialog_fnSetFilter()

static HRESULT WINAPI IFileOpenDialog_fnSetFilter ( IFileOpenDialog *  iface,
IShellItemFilter pFilter 
)
static

Definition at line 2981 of file itemdlg.c.

2982{
2984 return IFileDialog2_SetFilter(&This->IFileDialog2_iface, pFilter);
2985}

◆ IFileOpenDialog_fnSetFolder()

static HRESULT WINAPI IFileOpenDialog_fnSetFolder ( IFileOpenDialog *  iface,
IShellItem psi 
)
static

Definition at line 2896 of file itemdlg.c.

2897{
2899 return IFileDialog2_SetFolder(&This->IFileDialog2_iface, psi);
2900}

◆ IFileOpenDialog_fnSetOkButtonLabel()

static HRESULT WINAPI IFileOpenDialog_fnSetOkButtonLabel ( IFileOpenDialog *  iface,
LPCWSTR  pszText 
)
static

Definition at line 2932 of file itemdlg.c.

2933{
2935 return IFileDialog2_SetOkButtonLabel(&This->IFileDialog2_iface, pszText);
2936}

◆ IFileOpenDialog_fnSetOptions()

static HRESULT WINAPI IFileOpenDialog_fnSetOptions ( IFileOpenDialog *  iface,
FILEOPENDIALOGOPTIONS  fos 
)
static

Definition at line 2878 of file itemdlg.c.

2879{
2881 return IFileDialog2_SetOptions(&This->IFileDialog2_iface, fos);
2882}

◆ IFileOpenDialog_fnSetTitle()

static HRESULT WINAPI IFileOpenDialog_fnSetTitle ( IFileOpenDialog *  iface,
LPCWSTR  pszTitle 
)
static

Definition at line 2926 of file itemdlg.c.

2927{
2929 return IFileDialog2_SetTitle(&This->IFileDialog2_iface, pszTitle);
2930}

◆ IFileOpenDialog_fnShow()

static HRESULT WINAPI IFileOpenDialog_fnShow ( IFileOpenDialog *  iface,
HWND  hwndOwner 
)
static

Definition at line 2840 of file itemdlg.c.

2841{
2843 return IFileDialog2_Show(&This->IFileDialog2_iface, hwndOwner);
2844}

◆ IFileOpenDialog_fnUnadvise()

static HRESULT WINAPI IFileOpenDialog_fnUnadvise ( IFileOpenDialog *  iface,
DWORD  dwCookie 
)
static

Definition at line 2872 of file itemdlg.c.

2873{
2875 return IFileDialog2_Unadvise(&This->IFileDialog2_iface, dwCookie);
2876}

◆ IFileSaveDialog_fnAddPlace()

static HRESULT WINAPI IFileSaveDialog_fnAddPlace ( IFileSaveDialog iface,
IShellItem psi,
FDAP  fdap 
)
static

Definition at line 3188 of file itemdlg.c.

3189{
3191 return IFileDialog2_AddPlace(&This->IFileDialog2_iface, psi, fdap);
3192}
static FileDialogImpl * impl_from_IFileSaveDialog(IFileSaveDialog *iface)
Definition: itemdlg.c:3053

◆ IFileSaveDialog_fnAddRef()

static ULONG WINAPI IFileSaveDialog_fnAddRef ( IFileSaveDialog iface)
static

Definition at line 3066 of file itemdlg.c.

3067{
3069 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3070}

◆ IFileSaveDialog_fnAdvise()

static HRESULT WINAPI IFileSaveDialog_fnAdvise ( IFileSaveDialog iface,
IFileDialogEvents pfde,
DWORD pdwCookie 
)
static

Definition at line 3103 of file itemdlg.c.

3105{
3107 return IFileDialog2_Advise(&This->IFileDialog2_iface, pfde, pdwCookie);
3108}

◆ IFileSaveDialog_fnApplyProperties()

static HRESULT WINAPI IFileSaveDialog_fnApplyProperties ( IFileSaveDialog iface,
IShellItem psi,
IPropertyStore pStore,
HWND  hwnd,
IFileOperationProgressSink pSink 
)
static

Definition at line 3255 of file itemdlg.c.

3260{
3262 FIXME("%p (%p, %p, %p, %p)\n", This, psi, pStore, hwnd, pSink);
3263 return E_NOTIMPL;
3264}

◆ IFileSaveDialog_fnClearClientData()

static HRESULT WINAPI IFileSaveDialog_fnClearClientData ( IFileSaveDialog iface)
static

Definition at line 3213 of file itemdlg.c.

3214{
3216 return IFileDialog2_ClearClientData(&This->IFileDialog2_iface);
3217}

◆ IFileSaveDialog_fnClose()

static HRESULT WINAPI IFileSaveDialog_fnClose ( IFileSaveDialog iface,
HRESULT  hr 
)
static

Definition at line 3201 of file itemdlg.c.

3202{
3204 return IFileDialog2_Close(&This->IFileDialog2_iface, hr);
3205}

◆ IFileSaveDialog_fnGetCurrentSelection()

static HRESULT WINAPI IFileSaveDialog_fnGetCurrentSelection ( IFileSaveDialog iface,
IShellItem **  ppsi 
)
static

Definition at line 3146 of file itemdlg.c.

3147{
3149 return IFileDialog2_GetCurrentSelection(&This->IFileDialog2_iface, ppsi);
3150}

◆ IFileSaveDialog_fnGetFileName()

static HRESULT WINAPI IFileSaveDialog_fnGetFileName ( IFileSaveDialog iface,
LPWSTR pszName 
)
static

Definition at line 3158 of file itemdlg.c.

3159{
3161 return IFileDialog2_GetFileName(&This->IFileDialog2_iface, pszName);
3162}

◆ IFileSaveDialog_fnGetFileTypeIndex()

static HRESULT WINAPI IFileSaveDialog_fnGetFileTypeIndex ( IFileSaveDialog iface,
UINT piFileType 
)
static

Definition at line 3097 of file itemdlg.c.

3098{
3100 return IFileDialog2_GetFileTypeIndex(&This->IFileDialog2_iface, piFileType);
3101}

◆ IFileSaveDialog_fnGetFolder()

static HRESULT WINAPI IFileSaveDialog_fnGetFolder ( IFileSaveDialog iface,
IShellItem **  ppsi 
)
static

Definition at line 3140 of file itemdlg.c.

3141{
3143 return IFileDialog2_GetFolder(&This->IFileDialog2_iface, ppsi);
3144}

◆ IFileSaveDialog_fnGetOptions()

static HRESULT WINAPI IFileSaveDialog_fnGetOptions ( IFileSaveDialog iface,
FILEOPENDIALOGOPTIONS *  pfos 
)
static

Definition at line 3122 of file itemdlg.c.

3123{
3125 return IFileDialog2_GetOptions(&This->IFileDialog2_iface, pfos);
3126}

◆ IFileSaveDialog_fnGetProperties()

static HRESULT WINAPI IFileSaveDialog_fnGetProperties ( IFileSaveDialog iface,
IPropertyStore **  ppStore 
)
static

Definition at line 3248 of file itemdlg.c.

3249{
3251 FIXME("stub - %p (%p)\n", This, ppStore);
3252 return E_NOTIMPL;
3253}

◆ IFileSaveDialog_fnGetResult()

static HRESULT WINAPI IFileSaveDialog_fnGetResult ( IFileSaveDialog iface,
IShellItem **  ppsi 
)
static

Definition at line 3182 of file itemdlg.c.

3183{
3185 return IFileDialog2_GetResult(&This->IFileDialog2_iface, ppsi);
3186}

◆ IFileSaveDialog_fnQueryInterface()

static HRESULT WINAPI IFileSaveDialog_fnQueryInterface ( IFileSaveDialog iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3058 of file itemdlg.c.

3061{
3063 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3064}

◆ IFileSaveDialog_fnRelease()

static ULONG WINAPI IFileSaveDialog_fnRelease ( IFileSaveDialog iface)
static

Definition at line 3072 of file itemdlg.c.

3073{
3075 return IFileDialog2_Release(&This->IFileDialog2_iface);
3076}

◆ IFileSaveDialog_fnSetClientGuid()

static HRESULT WINAPI IFileSaveDialog_fnSetClientGuid ( IFileSaveDialog iface,
REFGUID  guid 
)
static

Definition at line 3207 of file itemdlg.c.

3208{
3210 return IFileDialog2_SetClientGuid(&This->IFileDialog2_iface, guid);
3211}

◆ IFileSaveDialog_fnSetCollectedProperties()

static HRESULT WINAPI IFileSaveDialog_fnSetCollectedProperties ( IFileSaveDialog iface,
IPropertyDescriptionList pList,
BOOL  fAppendDefault 
)
static

Definition at line 3239 of file itemdlg.c.

3242{
3244 FIXME("stub - %p (%p, %d)\n", This, pList, fAppendDefault);
3245 return E_NOTIMPL;
3246}
FxChildList * pList

◆ IFileSaveDialog_fnSetDefaultExtension()

static HRESULT WINAPI IFileSaveDialog_fnSetDefaultExtension ( IFileSaveDialog iface,
LPCWSTR  pszDefaultExtension 
)
static

Definition at line 3194 of file itemdlg.c.

3196{
3198 return IFileDialog2_SetDefaultExtension(&This->IFileDialog2_iface, pszDefaultExtension);
3199}

◆ IFileSaveDialog_fnSetDefaultFolder()

static HRESULT WINAPI IFileSaveDialog_fnSetDefaultFolder ( IFileSaveDialog iface,
IShellItem psi 
)
static

Definition at line 3128 of file itemdlg.c.

3129{
3131 return IFileDialog2_SetDefaultFolder(&This->IFileDialog2_iface, psi);
3132}

◆ IFileSaveDialog_fnSetFileName()

static HRESULT WINAPI IFileSaveDialog_fnSetFileName ( IFileSaveDialog iface,
LPCWSTR  pszName 
)
static

Definition at line 3152 of file itemdlg.c.

3153{
3155 return IFileDialog2_SetFileName(&This->IFileDialog2_iface, pszName);
3156}

◆ IFileSaveDialog_fnSetFileNameLabel()

static HRESULT WINAPI IFileSaveDialog_fnSetFileNameLabel ( IFileSaveDialog iface,
LPCWSTR  pszLabel 
)
static

Definition at line 3176 of file itemdlg.c.

3177{
3179 return IFileDialog2_SetFileNameLabel(&This->IFileDialog2_iface, pszLabel);
3180}

◆ IFileSaveDialog_fnSetFileTypeIndex()

static HRESULT WINAPI IFileSaveDialog_fnSetFileTypeIndex ( IFileSaveDialog iface,
UINT  iFileType 
)
static

Definition at line 3091 of file itemdlg.c.

3092{
3094 return IFileDialog2_SetFileTypeIndex(&This->IFileDialog2_iface, iFileType);
3095}

◆ IFileSaveDialog_fnSetFileTypes()

static HRESULT WINAPI IFileSaveDialog_fnSetFileTypes ( IFileSaveDialog iface,
UINT  cFileTypes,
const COMDLG_FILTERSPEC rgFilterSpec 
)
static

Definition at line 3084 of file itemdlg.c.

3086{
3088 return IFileDialog2_SetFileTypes(&This->IFileDialog2_iface, cFileTypes, rgFilterSpec);
3089}

◆ IFileSaveDialog_fnSetFilter()

static HRESULT WINAPI IFileSaveDialog_fnSetFilter ( IFileSaveDialog iface,
IShellItemFilter pFilter 
)
static

Definition at line 3219 of file itemdlg.c.

3220{
3222 return IFileDialog2_SetFilter(&This->IFileDialog2_iface, pFilter);
3223}

◆ IFileSaveDialog_fnSetFolder()

static HRESULT WINAPI IFileSaveDialog_fnSetFolder ( IFileSaveDialog iface,
IShellItem psi 
)
static

Definition at line 3134 of file itemdlg.c.

3135{
3137 return IFileDialog2_SetFolder(&This->IFileDialog2_iface, psi);
3138}

◆ IFileSaveDialog_fnSetOkButtonLabel()

static HRESULT WINAPI IFileSaveDialog_fnSetOkButtonLabel ( IFileSaveDialog iface,
LPCWSTR  pszText 
)
static

Definition at line 3170 of file itemdlg.c.

3171{
3173 return IFileDialog2_SetOkButtonLabel(&This->IFileDialog2_iface, pszText);
3174}

◆ IFileSaveDialog_fnSetOptions()

static HRESULT WINAPI IFileSaveDialog_fnSetOptions ( IFileSaveDialog iface,
FILEOPENDIALOGOPTIONS  fos 
)
static

Definition at line 3116 of file itemdlg.c.

3117{
3119 return IFileDialog2_SetOptions(&This->IFileDialog2_iface, fos);
3120}

◆ IFileSaveDialog_fnSetProperties()

static HRESULT WINAPI IFileSaveDialog_fnSetProperties ( IFileSaveDialog iface,
IPropertyStore pStore 
)
static

Definition at line 3232 of file itemdlg.c.

3233{
3235 FIXME("stub - %p (%p)\n", This, pStore);
3236 return E_NOTIMPL;
3237}

◆ IFileSaveDialog_fnSetSaveAsItem()

static HRESULT WINAPI IFileSaveDialog_fnSetSaveAsItem ( IFileSaveDialog iface,
IShellItem psi 
)
static

Definition at line 3225 of file itemdlg.c.

3226{
3228 FIXME("stub - %p (%p)\n", This, psi);
3229 return E_NOTIMPL;
3230}

◆ IFileSaveDialog_fnSetTitle()

static HRESULT WINAPI IFileSaveDialog_fnSetTitle ( IFileSaveDialog iface,
LPCWSTR  pszTitle 
)
static

Definition at line 3164 of file itemdlg.c.

3165{
3167 return IFileDialog2_SetTitle(&This->IFileDialog2_iface, pszTitle);
3168}

◆ IFileSaveDialog_fnShow()

static HRESULT WINAPI IFileSaveDialog_fnShow ( IFileSaveDialog iface,
HWND  hwndOwner 
)
static

Definition at line 3078 of file itemdlg.c.

3079{
3081 return IFileDialog2_Show(&This->IFileDialog2_iface, hwndOwner);
3082}

◆ IFileSaveDialog_fnUnadvise()

static HRESULT WINAPI IFileSaveDialog_fnUnadvise ( IFileSaveDialog iface,
DWORD  dwCookie 
)
static

Definition at line 3110 of file itemdlg.c.

3111{
3113 return IFileDialog2_Unadvise(&This->IFileDialog2_iface, dwCookie);
3114}

◆ impl_from_ICommDlgBrowser3()

◆ impl_from_IExplorerBrowserEvents()

◆ impl_from_IFileDialog2()

◆ impl_from_IFileDialogCustomize()

static FileDialogImpl * impl_from_IFileDialogCustomize ( IFileDialogCustomize *  iface)
inlinestatic

◆ impl_from_IFileOpenDialog()

static FileDialogImpl * impl_from_IFileOpenDialog ( IFileOpenDialog *  iface)
inlinestatic

Definition at line 2816 of file itemdlg.c.

2817{
2818 return CONTAINING_RECORD(iface, FileDialogImpl, u.IFileOpenDialog_iface);
2819}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

Referenced by IFileOpenDialog_fnAddPlace(), IFileOpenDialog_fnAddRef(), IFileOpenDialog_fnAdvise(), IFileOpenDialog_fnClearClientData(), IFileOpenDialog_fnClose(), IFileOpenDialog_fnGetCurrentSelection(), IFileOpenDialog_fnGetFileName(), IFileOpenDialog_fnGetFileTypeIndex(), IFileOpenDialog_fnGetFolder(), IFileOpenDialog_fnGetOptions(), IFileOpenDialog_fnGetResult(), IFileOpenDialog_fnGetResults(), IFileOpenDialog_fnGetSelectedItems(), IFileOpenDialog_fnQueryInterface(), IFileOpenDialog_fnRelease(), IFileOpenDialog_fnSetClientGuid(), IFileOpenDialog_fnSetDefaultExtension(), IFileOpenDialog_fnSetDefaultFolder(), IFileOpenDialog_fnSetFileName(), IFileOpenDialog_fnSetFileNameLabel(), IFileOpenDialog_fnSetFileTypeIndex(), IFileOpenDialog_fnSetFileTypes(), IFileOpenDialog_fnSetFilter(), IFileOpenDialog_fnSetFolder(), IFileOpenDialog_fnSetOkButtonLabel(), IFileOpenDialog_fnSetOptions(), IFileOpenDialog_fnSetTitle(), IFileOpenDialog_fnShow(), and IFileOpenDialog_fnUnadvise().

◆ impl_from_IFileSaveDialog()

◆ impl_from_IOleWindow()

static FileDialogImpl * impl_from_IOleWindow ( IOleWindow iface)
inlinestatic

◆ impl_from_IServiceProvider()

static FileDialogImpl * impl_from_IServiceProvider ( IServiceProvider iface)
inlinestatic

Definition at line 3409 of file itemdlg.c.

3410{
3411 return CONTAINING_RECORD(iface, FileDialogImpl, IServiceProvider_iface);
3412}

Referenced by IServiceProvider_fnAddRef(), IServiceProvider_fnQueryInterface(), IServiceProvider_fnQueryService(), and IServiceProvider_fnRelease().

◆ init_custom_controls()

static HRESULT init_custom_controls ( FileDialogImpl This)
static

Definition at line 1493 of file itemdlg.c.

1494{
1495 WNDCLASSW wc;
1496 HDC hdc;
1497 static const WCHAR ctrl_container_classname[] =
1498 {'i','d','l','g','_','c','o','n','t','a','i','n','e','r','_','p','a','n','e',0};
1499
1501
1502 if( !GetClassInfoW(COMDLG32_hInstance, ctrl_container_classname, &wc) )
1503 {
1506 wc.cbClsExtra = 0;
1507 wc.cbWndExtra = 0;
1509 wc.hIcon = 0;
1511 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1512 wc.lpszMenuName = NULL;
1513 wc.lpszClassName = ctrl_container_classname;
1514
1515 if(!RegisterClassW(&wc)) return E_FAIL;
1516 }
1517
1518 This->cctrls_hwnd = CreateWindowExW(0, ctrl_container_classname, NULL,
1520 0, 0, 0, 0, NULL, 0,
1522 if(!This->cctrls_hwnd)
1523 return E_FAIL;
1524
1525 hdc = GetDC(This->cctrls_hwnd);
1526 This->dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
1527 This->dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
1528 ReleaseDC(This->cctrls_hwnd, hdc);
1529
1530 This->cctrl_width = MulDiv(160, This->dpi_x, USER_DEFAULT_SCREEN_DPI); /* Controls have a fixed width */
1531 This->cctrl_indent = MulDiv(100, This->dpi_x, USER_DEFAULT_SCREEN_DPI);
1532 This->cctrl_def_height = MulDiv(23, This->dpi_y, USER_DEFAULT_SCREEN_DPI);
1533 This->cctrls_cols = 0;
1534
1535 This->cctrl_next_dlgid = 0x2000;
1536 list_init(&This->cctrls);
1537 This->cctrl_active_vg = NULL;
1538
1539 SetWindowLongW(This->cctrls_hwnd, GWL_STYLE, WS_TABSTOP);
1540
1541 /* Register class for */
1544 {
1547 wc.cbClsExtra = 0;
1548 wc.cbWndExtra = 0;
1550 wc.hIcon = 0;
1552 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1553 wc.lpszMenuName = NULL;
1555
1556 if (!RegisterClassW(&wc))
1557 ERR("Failed to register FloatNotifySink window class.\n");
1558 }
1559
1562 {
1565 wc.cbClsExtra = 0;
1566 wc.cbWndExtra = 0;
1568 wc.hIcon = 0;
1570 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
1571 wc.lpszMenuName = NULL;
1573
1574 if (!RegisterClassW(&wc))
1575 ERR("Failed to register RadioButtonList window class.\n");
1576 }
1577
1578 return S_OK;
1579}
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
static LRESULT CALLBACK ctrl_container_wndproc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1410
static LRESULT CALLBACK notifysink_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1114
static LRESULT CALLBACK radiobuttonlist_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1481
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LPCWSTR lpszClassName
Definition: winuser.h:3185
LPCWSTR lpszMenuName
Definition: winuser.h:3184
HBRUSH hbrBackground
Definition: winuser.h:3183
HICON hIcon
Definition: winuser.h:3181
HINSTANCE hInstance
Definition: winuser.h:3180
int cbClsExtra
Definition: winuser.h:3178
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define LOGPIXELSY
Definition: wingdi.h:719
#define LOGPIXELSX
Definition: wingdi.h:718
#define CS_VREDRAW
Definition: winuser.h:658
#define CS_HREDRAW
Definition: winuser.h:653
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2105
BOOL WINAPI GetClassInfoW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _Out_ LPWNDCLASSW)
#define COLOR_BTNFACE
Definition: winuser.h:928

Referenced by FileDialog_constructor().

◆ init_explorerbrowser()

static HRESULT init_explorerbrowser ( FileDialogImpl This)
static

Definition at line 1846 of file itemdlg.c.

1847{
1848 IShellItem *psi_folder;
1850 FOLDERSETTINGS fos;
1851 RECT rc = {0};
1852 HRESULT hr;
1853
1854 /* Create ExplorerBrowser instance */
1856
1857 hr = CoCreateInstance(&CLSID_ExplorerBrowser, NULL, CLSCTX_INPROC_SERVER,
1858 &IID_IExplorerBrowser, (void**)&This->peb);
1859 if(FAILED(hr))
1860 {
1861 ERR("Failed to instantiate ExplorerBrowser control.\n");
1862 return hr;
1863 }
1864
1865 IExplorerBrowser_SetOptions(This->peb, EBO_SHOWFRAMES | EBO_NOBORDER);
1866
1867 hr = IExplorerBrowser_Initialize(This->peb, This->dlg_hwnd, &rc, NULL);
1868 if(FAILED(hr))
1869 {
1870 ERR("Failed to initialize the ExplorerBrowser control.\n");
1871 IExplorerBrowser_Release(This->peb);
1872 This->peb = NULL;
1873 return hr;
1874 }
1875 hr = IExplorerBrowser_Advise(This->peb, &This->IExplorerBrowserEvents_iface, &This->ebevents_cookie);
1876 if(FAILED(hr))
1877 ERR("Advise (ExplorerBrowser) failed.\n");
1878
1879 /* Get previous options? */
1880 fos.ViewMode = fos.fFlags = 0;
1881 if(!(This->options & FOS_ALLOWMULTISELECT))
1882 fos.fFlags |= FWF_SINGLESEL;
1883
1884 IExplorerBrowser_SetFolderSettings(This->peb, &fos);
1885
1886 hr = IExplorerBrowser_QueryInterface(This->peb, &IID_IObjectWithSite, (void**)&client);
1887 if (hr == S_OK)
1888 {
1889 hr = IObjectWithSite_SetSite(client, (IUnknown*)&This->IFileDialog2_iface);
1890 IObjectWithSite_Release(client);
1891 if(FAILED(hr))
1892 ERR("SetSite failed, 0x%08x\n", hr);
1893 }
1894
1895 /* Browse somewhere */
1896 psi_folder = This->psi_setfolder ? This->psi_setfolder : This->psi_defaultfolder;
1897 IExplorerBrowser_BrowseToObject(This->peb, (IUnknown*)psi_folder, SBSP_DEFBROWSER);
1898
1899 return S_OK;
1900}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
const IID IID_IObjectWithSite
@ FWF_SINGLESEL
Definition: shobjidl.idl:643
@ EBO_NOBORDER
Definition: shobjidl.idl:2969
@ EBO_SHOWFRAMES
Definition: shobjidl.idl:2964

Referenced by on_wm_initdialog().

◆ init_toolbar()

static void init_toolbar ( FileDialogImpl This,
HWND  hwnd 
)
static

Definition at line 1902 of file itemdlg.c.

1903{
1904 HWND htoolbar;
1905 TBADDBITMAP tbab;
1906 TBBUTTON button[2];
1907
1909 0, 0, 0, 0,
1911
1912 tbab.hInst = HINST_COMMCTRL;
1914 SendMessageW(htoolbar, TB_ADDBITMAP, 0, (LPARAM)&tbab);
1915
1916 button[0].iBitmap = HIST_BACK;
1917 button[0].idCommand = IDC_NAVBACK;
1918 button[0].fsState = TBSTATE_ENABLED;
1919 button[0].fsStyle = BTNS_BUTTON;
1920 button[0].dwData = 0;
1921 button[0].iString = 0;
1922
1923 button[1].iBitmap = HIST_FORWARD;
1924 button[1].idCommand = IDC_NAVFORWARD;
1925 button[1].fsState = TBSTATE_ENABLED;
1926 button[1].fsStyle = BTNS_BUTTON;
1927 button[1].dwData = 0;
1928 button[1].iString = 0;
1929
1930 SendMessageW(htoolbar, TB_ADDBUTTONSW, 2, (LPARAM)button);
1931 SendMessageW(htoolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(24,24));
1932 SendMessageW(htoolbar, TB_AUTOSIZE, 0, 0);
1933}
#define IDC_NAVBACK
Definition: itemdlg.c:43
#define IDC_NAVFORWARD
Definition: itemdlg.c:44
#define IDC_NAV_TOOLBAR
Definition: itemdlg.c:42
DWORD button
Definition: button.c:166
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define IDB_HIST_LARGE_COLOR
Definition: commctrl.h:1069
#define HINST_COMMCTRL
Definition: commctrl.h:1063
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1135
#define HIST_BACK
Definition: commctrl.h:1100
#define HIST_FORWARD
Definition: commctrl.h:1101
#define TB_ADDBITMAP
Definition: commctrl.h:1056
UINT_PTR nID
Definition: commctrl.h:1060
HINSTANCE hInst
Definition: commctrl.h:1059
#define MAKELPARAM(l, h)
Definition: winuser.h:4008

Referenced by on_wm_initdialog().

◆ IOleWindow_fnAddRef()

static ULONG WINAPI IOleWindow_fnAddRef ( IOleWindow iface)
static

Definition at line 3675 of file itemdlg.c.

3676{
3678 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3679}
static FileDialogImpl * impl_from_IOleWindow(IOleWindow *iface)
Definition: itemdlg.c:3664

◆ IOleWindow_fnContextSensitiveHelp()

static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp ( IOleWindow iface,
BOOL  fEnterMOde 
)
static

Definition at line 3687 of file itemdlg.c.

3688{
3690 FIXME("Stub: %p (%d)\n", This, fEnterMOde);
3691 return E_NOTIMPL;
3692}

◆ IOleWindow_fnGetWindow()

static HRESULT WINAPI IOleWindow_fnGetWindow ( IOleWindow iface,
HWND phwnd 
)
static

Definition at line 3694 of file itemdlg.c.

3695{
3697 TRACE("%p (%p)\n", This, phwnd);
3698 *phwnd = This->dlg_hwnd;
3699 return S_OK;
3700}

◆ IOleWindow_fnQueryInterface()

static HRESULT WINAPI IOleWindow_fnQueryInterface ( IOleWindow iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3669 of file itemdlg.c.

3670{
3672 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3673}

◆ IOleWindow_fnRelease()

static ULONG WINAPI IOleWindow_fnRelease ( IOleWindow iface)
static

Definition at line 3681 of file itemdlg.c.

3682{
3684 return IFileDialog2_Release(&This->IFileDialog2_iface);
3685}

◆ IServiceProvider_fnAddRef()

static ULONG WINAPI IServiceProvider_fnAddRef ( IServiceProvider iface)
static

Definition at line 3422 of file itemdlg.c.

3423{
3425 TRACE("%p\n", This);
3426 return IFileDialog2_AddRef(&This->IFileDialog2_iface);
3427}
static FileDialogImpl * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: itemdlg.c:3409

◆ IServiceProvider_fnQueryInterface()

static HRESULT WINAPI IServiceProvider_fnQueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 3414 of file itemdlg.c.

3416{
3418 TRACE("%p\n", This);
3419 return IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppvObject);
3420}

◆ IServiceProvider_fnQueryService()

static HRESULT WINAPI IServiceProvider_fnQueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 3436 of file itemdlg.c.

3439{
3442 TRACE("%p (%s, %s, %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
3443
3444 *ppv = NULL;
3445 if(IsEqualGUID(guidService, &SID_STopLevelBrowser) && This->peb)
3446 hr = IExplorerBrowser_QueryInterface(This->peb, riid, ppv);
3447 else if(IsEqualGUID(guidService, &SID_SExplorerBrowserFrame))
3448 hr = IFileDialog2_QueryInterface(&This->IFileDialog2_iface, riid, ppv);
3449 else
3450 FIXME("Interface %s requested from unknown service %s\n",
3451 debugstr_guid(riid), debugstr_guid(guidService));
3452
3453 return hr;
3454}

◆ IServiceProvider_fnRelease()

static ULONG WINAPI IServiceProvider_fnRelease ( IServiceProvider iface)
static

Definition at line 3429 of file itemdlg.c.

3430{
3432 TRACE("%p\n", This);
3433 return IFileDialog2_Release(&This->IFileDialog2_iface);
3434}

◆ item_free()

static void item_free ( cctrl_item item)
static

Definition at line 744 of file itemdlg.c.

745{
746 DestroyWindow(item->hwnd);
747 HeapFree(GetProcessHeap(), 0, item->label);
749}

Referenced by ctrl_free(), IFileDialogCustomize_fnAddControlItem(), and IFileDialogCustomize_fnRemoveControlItem().

◆ itemdlg_dlgproc()

static LRESULT CALLBACK itemdlg_dlgproc ( HWND  hwnd,
UINT  umessage,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 2241 of file itemdlg.c.

2242{
2244
2245 switch(umessage)
2246 {
2248 case WM_COMMAND: return on_wm_command(This, wparam, lparam);
2249 case WM_SIZE: return on_wm_size(This);
2251 case WM_DESTROY: return on_wm_destroy(This);
2252 }
2253
2254 return FALSE;
2255}
static LRESULT on_wm_getminmaxinfo(FileDialogImpl *This, LPARAM lparam)
Definition: itemdlg.c:2099
static LRESULT on_wm_command(FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:2226
static LRESULT on_wm_size(FileDialogImpl *This)
Definition: itemdlg.c:2093
static LRESULT on_wm_destroy(FileDialogImpl *This)
Definition: itemdlg.c:2111
static LRESULT on_wm_initdialog(HWND hwnd, LPARAM lParam)
Definition: itemdlg.c:1992
#define WM_SIZE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define WM_GETMINMAXINFO
Definition: winuser.h:1640

Referenced by create_dialog().

◆ notifysink_on_bn_clicked()

static LRESULT notifysink_on_bn_clicked ( FileDialogImpl This,
HWND  hwnd,
WPARAM  wparam 
)
static

Definition at line 1032 of file itemdlg.c.

1033{
1035
1036 TRACE("%p, %lx\n", This, wparam);
1037
1038 if(ctrl)
1039 {
1040 if(ctrl->type == IDLG_CCTRL_CHECKBUTTON)
1041 {
1042 BOOL checked = (SendMessageW(ctrl->hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED);
1044 }
1045 else
1047 }
1048
1049 return TRUE;
1050}
static HRESULT cctrl_event_OnCheckButtonToggled(FileDialogImpl *This, DWORD ctl_id, BOOL checked)
Definition: itemdlg.c:319
static HRESULT cctrl_event_OnButtonClicked(FileDialogImpl *This, DWORD ctl_id)
Definition: itemdlg.c:281
static customctrl * get_cctrl_from_dlgid(FileDialogImpl *This, DWORD dlgid)
Definition: itemdlg.c:819
#define LOWORD(l)
Definition: pedump.c:82

Referenced by notifysink_on_wm_command().

◆ notifysink_on_cbn_selchange()

static LRESULT notifysink_on_cbn_selchange ( FileDialogImpl This,
HWND  hwnd,
WPARAM  wparam 
)
static

Definition at line 1052 of file itemdlg.c.

1053{
1055 TRACE("%p, %p (%lx)\n", This, ctrl, wparam);
1056
1057 if(ctrl)
1058 {
1059 UINT index = SendMessageW(ctrl->hwnd, CB_GETCURSEL, 0, 0);
1060 UINT selid = SendMessageW(ctrl->hwnd, CB_GETITEMDATA, index, 0);
1061
1063 }
1064 return TRUE;
1065}
static HRESULT cctrl_event_OnItemSelected(FileDialogImpl *This, DWORD ctl_id, DWORD item_id)
Definition: itemdlg.c:300

Referenced by notifysink_on_wm_command().

◆ notifysink_on_create()

static LRESULT notifysink_on_create ( HWND  hwnd,
CREATESTRUCTW crs 
)
static

Definition at line 1023 of file itemdlg.c.

1024{
1025 FileDialogImpl *This = crs->lpCreateParams;
1026 TRACE("%p\n", This);
1027
1029 return TRUE;
1030}

Referenced by notifysink_proc().

◆ notifysink_on_tvn_dropdown()

static LRESULT notifysink_on_tvn_dropdown ( FileDialogImpl This,
LPARAM  lparam 
)
static

Definition at line 1067 of file itemdlg.c.

1068{
1069 NMTOOLBARW *nmtb = (NMTOOLBARW*)lparam;
1071 POINT pt = { 0, nmtb->rcButton.bottom };
1072 TBBUTTON tbb;
1073 UINT idcmd;
1074
1075 TRACE("%p, %p (%lx)\n", This, ctrl, lparam);
1076
1077 if(ctrl)
1078 {
1080
1081 SendMessageW(ctrl->hwnd, TB_GETBUTTON, 0, (LPARAM)&tbb);
1082 ClientToScreen(ctrl->hwnd, &pt);
1083 idcmd = TrackPopupMenu((HMENU)tbb.dwData, TPM_RETURNCMD, pt.x, pt.y, 0, This->dlg_hwnd, NULL);
1084 if(idcmd)
1086 }
1087
1088 return TBDDRET_DEFAULT;
1089}
static HRESULT cctrl_event_OnControlActivating(FileDialogImpl *This, DWORD ctl_id)
Definition: itemdlg.c:338
#define pt(x, y)
Definition: drawing.c:79
#define TBDDRET_DEFAULT
Definition: commctrl.h:1424
HWND hwndFrom
Definition: winuser.h:3157
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
int WINAPI GetDlgCtrlID(_In_ HWND)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define TPM_RETURNCMD
Definition: winuser.h:2387

Referenced by notifysink_on_wm_notify().

◆ notifysink_on_wm_command()

static LRESULT notifysink_on_wm_command ( FileDialogImpl This,
HWND  hwnd,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1091 of file itemdlg.c.

1092{
1093 switch(HIWORD(wparam))
1094 {
1097 }
1098
1099 return FALSE;
1100}
static LRESULT notifysink_on_cbn_selchange(FileDialogImpl *This, HWND hwnd, WPARAM wparam)
Definition: itemdlg.c:1052
static LRESULT notifysink_on_bn_clicked(FileDialogImpl *This, HWND hwnd, WPARAM wparam)
Definition: itemdlg.c:1032
#define HIWORD(l)
Definition: typedefs.h:247
#define CBN_SELCHANGE
Definition: winuser.h:1979
#define BN_CLICKED
Definition: winuser.h:1925

Referenced by notifysink_proc().

◆ notifysink_on_wm_notify()

static LRESULT notifysink_on_wm_notify ( FileDialogImpl This,
HWND  hwnd,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1102 of file itemdlg.c.

1103{
1104 NMHDR *nmhdr = (NMHDR*)lparam;
1105
1106 switch(nmhdr->code)
1107 {
1109 }
1110
1111 return FALSE;
1112}
static LRESULT notifysink_on_tvn_dropdown(FileDialogImpl *This, LPARAM lparam)
Definition: itemdlg.c:1067
#define TBN_DROPDOWN
Definition: commctrl.h:1316
UINT code
Definition: winuser.h:3159

Referenced by notifysink_proc().

◆ notifysink_proc()

static LRESULT CALLBACK notifysink_proc ( HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1114 of file itemdlg.c.

1115{
1118 HWND hwnd_child;
1119 RECT rc;
1120
1121 switch(message)
1122 {
1126 case WM_SIZE:
1127 hwnd_child = GetPropW(hwnd, notifysink_childW);
1129 if(ctrl && ctrl->type != IDLG_CCTRL_VISUALGROUP)
1130 {
1131 GetClientRect(hwnd, &rc);
1133 }
1134 return TRUE;
1135 }
1136
1138}
static LRESULT notifysink_on_wm_command(FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1091
static LRESULT notifysink_on_create(HWND hwnd, CREATESTRUCTW *crs)
Definition: itemdlg.c:1023
static LRESULT notifysink_on_wm_notify(FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1102
#define WM_NOTIFY
Definition: richedit.h:61
Definition: tftpd.h:60
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by init_custom_controls().

◆ on_browse_back()

static LRESULT on_browse_back ( FileDialogImpl This)
static

Definition at line 2163 of file itemdlg.c.

2164{
2165 TRACE("%p\n", This);
2166 IExplorerBrowser_BrowseToIDList(This->peb, NULL, SBSP_NAVIGATEBACK);
2167 return FALSE;
2168}

Referenced by on_wm_command().

◆ on_browse_forward()

static LRESULT on_browse_forward ( FileDialogImpl This)
static

Definition at line 2170 of file itemdlg.c.

2171{
2172 TRACE("%p\n", This);
2173 IExplorerBrowser_BrowseToIDList(This->peb, NULL, SBSP_NAVIGATEFORWARD);
2174 return FALSE;
2175}

Referenced by on_wm_command().

◆ on_command_filetype()

static LRESULT on_command_filetype ( FileDialogImpl This,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 2177 of file itemdlg.c.

2178{
2180 {
2181 IShellView *psv;
2182 HRESULT hr;
2184 UINT prev_index = This->filetypeindex;
2185
2186 This->filetypeindex = SendMessageW((HWND)lparam, CB_GETCURSEL, 0, 0);
2187 TRACE("File type selection changed to %d.\n", This->filetypeindex);
2188
2189 if(prev_index == This->filetypeindex)
2190 return FALSE;
2191
2192 hr = IExplorerBrowser_GetCurrentView(This->peb, &IID_IShellView, (void**)&psv);
2193 if(SUCCEEDED(hr))
2194 {
2195 IShellView_Refresh(psv);
2196 IShellView_Release(psv);
2197 }
2198
2199 if(This->dlg_type == ITEMDLG_TYPE_SAVE && get_file_name(This, &filename))
2200 {
2201 WCHAR buf[MAX_PATH], extbuf[MAX_PATH], *ext;
2202
2203 ext = get_first_ext_from_spec(extbuf, This->filterspecs[This->filetypeindex].pszSpec);
2204 if(ext)
2205 {
2207
2208 if(PathMatchSpecW(buf, This->filterspecs[prev_index].pszSpec))
2210
2211 lstrcatW(buf, ext);
2213 }
2215 }
2216
2217 /* The documentation claims that OnTypeChange is called only
2218 * when the dialog is opened, but this is obviously not the
2219 * case. */
2221 }
2222
2223 return FALSE;
2224}
static void events_OnTypeChange(FileDialogImpl *This)
Definition: itemdlg.c:223
static LPWSTR get_first_ext_from_spec(LPWSTR buf, LPCWSTR spec)
Definition: itemdlg.c:469
#define MAX_PATH
Definition: compat.h:34
void WINAPI PathRemoveExtensionW(LPWSTR lpszPath)
Definition: path.c:823
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

Referenced by on_wm_command().

◆ on_command_opendropdown()

static LRESULT on_command_opendropdown ( FileDialogImpl This,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 2150 of file itemdlg.c.

2151{
2152 if(HIWORD(wparam) == BN_CLICKED)
2153 {
2154 HWND hwnd = (HWND)lparam;
2158 }
2159
2160 return FALSE;
2161}
HANDLE HWND
Definition: compat.h:19

Referenced by on_wm_command().

◆ on_default_action()

static HRESULT on_default_action ( FileDialogImpl This)
static

Definition at line 506 of file itemdlg.c.

507{
508 IShellFolder *psf_parent, *psf_desktop;
509 LPITEMIDLIST *pidla;
510 LPITEMIDLIST current_folder;
511 LPWSTR fn_iter, files = NULL, tmp_files;
512 UINT file_count = 0, len, i;
513 int open_action;
514 HRESULT hr, ret = E_FAIL;
515
516 len = get_file_name(This, &tmp_files);
517 if(len)
518 {
519 UINT size_used;
520 file_count = COMDLG32_SplitFileNames(tmp_files, len, &files, &size_used);
521 CoTaskMemFree(tmp_files);
522 }
523 if(!file_count) return E_FAIL;
524
525 hr = SHGetIDListFromObject((IUnknown*)This->psi_folder, &current_folder);
526 if(FAILED(hr))
527 {
528 ERR("Failed to get pidl for current directory.\n");
529 HeapFree(GetProcessHeap(), 0, files);
530 return hr;
531 }
532
533 TRACE("Acting on %d file(s).\n", file_count);
534
535 pidla = HeapAlloc(GetProcessHeap(), 0, sizeof(LPITEMIDLIST) * file_count);
536 open_action = ONOPEN_OPEN;
537 fn_iter = files;
538
539 for(i = 0; i < file_count && open_action == ONOPEN_OPEN; i++)
540 {
541 WCHAR canon_filename[MAX_PATH];
542 psf_parent = NULL;
543
544 COMDLG32_GetCanonicalPath(current_folder, fn_iter, canon_filename);
545
546 if( (This->options & FOS_NOVALIDATE) &&
547 !(This->options & FOS_FILEMUSTEXIST) )
548 open_action = ONOPEN_OPEN;
549 else
550 open_action = ONOPEN_BROWSE;
551
552 open_action = FILEDLG95_ValidatePathAction(canon_filename, &psf_parent, This->dlg_hwnd,
553 This->options & ~FOS_FILEMUSTEXIST,
554 (This->dlg_type == ITEMDLG_TYPE_SAVE),
555 open_action);
556
557 /* Add the proper extension */
558 if(open_action == ONOPEN_OPEN)
559 {
560 static const WCHAR dotW[] = {'.',0};
561
562 if(This->dlg_type == ITEMDLG_TYPE_SAVE)
563 {
564 WCHAR extbuf[MAX_PATH], *newext = NULL;
565
566 if(This->filterspec_count)
567 {
568 newext = get_first_ext_from_spec(extbuf, This->filterspecs[This->filetypeindex].pszSpec);
569 }
570 else if(This->default_ext)
571 {
572 lstrcpyW(extbuf, dotW);
573 lstrcatW(extbuf, This->default_ext);
574 newext = extbuf;
575 }
576
577 if(newext)
578 {
579 WCHAR *ext = PathFindExtensionW(canon_filename);
580 if(lstrcmpW(ext, newext))
581 lstrcatW(canon_filename, newext);
582 }
583 }
584 else
585 {
586 if( !(This->options & FOS_NOVALIDATE) && (This->options & FOS_FILEMUSTEXIST) &&
587 !PathFileExistsW(canon_filename))
588 {
589 if(This->default_ext)
590 {
591 lstrcatW(canon_filename, dotW);
592 lstrcatW(canon_filename, This->default_ext);
593
594 if(!PathFileExistsW(canon_filename))
595 {
597 open_action = ONOPEN_BROWSE;
598 }
599 }
600 else
601 {
603 open_action = ONOPEN_BROWSE;
604 }
605 }
606 }
607 }
608
609 pidla[i] = COMDLG32_SHSimpleIDListFromPathAW(canon_filename);
610
611 if(psf_parent && !(open_action == ONOPEN_BROWSE))
612 IShellFolder_Release(psf_parent);
613
614 fn_iter += (WCHAR)lstrlenW(fn_iter) + 1;
615 }
616
617 HeapFree(GetProcessHeap(), 0, files);
618 ILFree(current_folder);
619
620 if((This->options & FOS_PICKFOLDERS) && open_action == ONOPEN_BROWSE)
621 open_action = ONOPEN_OPEN; /* FIXME: Multiple folders? */
622
623 switch(open_action)
624 {
625 case ONOPEN_SEARCH:
626 FIXME("Filtering not implemented.\n");
627 break;
628
629 case ONOPEN_BROWSE:
630 hr = IExplorerBrowser_BrowseToObject(This->peb, (IUnknown*)psf_parent, SBSP_DEFBROWSER);
631 if(FAILED(hr))
632 ERR("Failed to browse to directory: %08x\n", hr);
633
634 IShellFolder_Release(psf_parent);
635 break;
636
637 case ONOPEN_OPEN:
638 hr = SHGetDesktopFolder(&psf_desktop);
639 if(SUCCEEDED(hr))
640 {
641 if(This->psia_results)
642 {
643 IShellItemArray_Release(This->psia_results);
644 This->psia_results = NULL;
645 }
646
647 hr = SHCreateShellItemArray(NULL, psf_desktop, file_count, (PCUITEMID_CHILD_ARRAY)pidla,
648 &This->psia_results);
649
650 IShellFolder_Release(psf_desktop);
651
652 if(FAILED(hr))
653 break;
654
655 if(This->options & FOS_PICKFOLDERS)
656 {
657 SFGAOF attributes;
658 hr = IShellItemArray_GetAttributes(This->psia_results, SIATTRIBFLAGS_AND, SFGAO_FOLDER, &attributes);
659 if(hr != S_OK)
660 {
661 WCHAR buf[64];
663
664 MessageBoxW(This->dlg_hwnd, buf, This->custom_title, MB_OK | MB_ICONEXCLAMATION);
665
666 IShellItemArray_Release(This->psia_results);
667 This->psia_results = NULL;
668 break;
669 }
670 }
671
672 if((This->options & FOS_OVERWRITEPROMPT) && This->dlg_type == ITEMDLG_TYPE_SAVE)
673 {
674 IShellItem *shellitem;
675
676 for (i=0; SUCCEEDED(hr) && i<file_count; i++)
677 {
678 hr = IShellItemArray_GetItemAt(This->psia_results, i, &shellitem);
679 if (SUCCEEDED(hr))
680 {
681 if (shell_item_exists(shellitem))
682 hr = events_OnOverwrite(This, shellitem);
683
684 IShellItem_Release(shellitem);
685 }
686 }
687
688 if (FAILED(hr))
689 break;
690 }
691
693 ret = S_OK;
694 }
695 break;
696
697 default:
698 ERR("Failed.\n");
699 break;
700 }
701
702 /* Clean up */
703 for(i = 0; i < file_count; i++)
704 ILFree(pidla[i]);
705 HeapFree(GetProcessHeap(), 0, pidla);
706
707 /* Success closes the dialog */
708 return ret;
709}
void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText) DECLSPEC_HIDDEN
Definition: filedlg.c:2861
#define ONOPEN_OPEN
Definition: cdlg.h:220
#define ONOPEN_BROWSE
Definition: cdlg.h:219
int COMDLG32_SplitFileNames(LPWSTR lpstrEdit, UINT nStrLen, LPWSTR *lpstrFileList, UINT *sizeUsed) DECLSPEC_HIDDEN
Definition: filedlg.c:792
int FILEDLG95_ValidatePathAction(LPWSTR lpstrPathAndFile, IShellFolder **ppsf, HWND hwnd, DWORD flags, BOOL isSaveDlg, int defAction) DECLSPEC_HIDDEN
Definition: filedlg.c:2962
void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent, LPWSTR lpstrFile, LPWSTR lpstrPathAndFile) DECLSPEC_HIDDEN
Definition: filedlg.c:752
#define ONOPEN_SEARCH
Definition: cdlg.h:221
static BOOL shell_item_exists(IShellItem *shellitem)
Definition: itemdlg.c:484
static HRESULT events_OnFileOk(FileDialogImpl *This)
Definition: itemdlg.c:159
static HRESULT events_OnOverwrite(FileDialogImpl *This, IShellItem *shellitem)
Definition: itemdlg.c:235
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1777
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
#define IDS_FILENOTEXISTING
#define IDS_INVALID_FOLDERNAME
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static const WCHAR dotW[]
Definition: directory.c:80
HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder *psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray)
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
int ret
#define MB_OK
Definition: winuser.h:790

Referenced by ICommDlgBrowser3_fnOnDefaultCommand(), on_idok(), and show_opendropdown().

◆ on_idcancel()

static LRESULT on_idcancel ( FileDialogImpl This)
static

Definition at line 2141 of file itemdlg.c.

2142{
2143 TRACE("%p\n", This);
2144
2146
2147 return FALSE;
2148}
#define ERROR_CANCELLED
Definition: winerror.h:726
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92

Referenced by on_wm_command().

◆ on_idok()

static LRESULT on_idok ( FileDialogImpl This)
static

Definition at line 2131 of file itemdlg.c.

2132{
2133 TRACE("%p\n", This);
2134
2136 EndDialog(This->dlg_hwnd, S_OK);
2137
2138 return FALSE;
2139}

Referenced by on_wm_command().

◆ on_wm_command()

static LRESULT on_wm_command ( FileDialogImpl This,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 2226 of file itemdlg.c.

2227{
2228 switch(LOWORD(wparam))
2229 {
2230 case IDOK: return on_idok(This);
2231 case IDCANCEL: return on_idcancel(This);
2233 case IDC_NAVBACK: return on_browse_back(This);
2236 default: TRACE("Unknown command.\n");
2237 }
2238 return FALSE;
2239}
#define psh1
Definition: dlgs.h:112
static LRESULT on_browse_back(FileDialogImpl *This)
Definition: itemdlg.c:2163
static LRESULT on_idok(FileDialogImpl *This)
Definition: itemdlg.c:2131
static LRESULT on_command_filetype(FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:2177
static LRESULT on_idcancel(FileDialogImpl *This)
Definition: itemdlg.c:2141
static LRESULT on_browse_forward(FileDialogImpl *This)
Definition: itemdlg.c:2170
static LRESULT on_command_opendropdown(FileDialogImpl *This, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:2150
#define IDC_FILETYPE
#define IDOK
Definition: winuser.h:830

Referenced by itemdlg_dlgproc().

◆ on_wm_destroy()

static LRESULT on_wm_destroy ( FileDialogImpl This)
static

Definition at line 2111 of file itemdlg.c.

2112{
2113 TRACE("%p\n", This);
2114
2115 if(This->peb)
2116 {
2117 IExplorerBrowser_Destroy(This->peb);
2118 IExplorerBrowser_Release(This->peb);
2119 This->peb = NULL;
2120 }
2121
2123 This->dlg_hwnd = NULL;
2124
2125 DeleteObject(This->hfont_opendropdown);
2126 This->hfont_opendropdown = NULL;
2127
2128 return TRUE;
2129}
static void ctrl_container_reparent(FileDialogImpl *This, HWND parent)
Definition: itemdlg.c:1346

Referenced by itemdlg_dlgproc().

◆ on_wm_getminmaxinfo()

static LRESULT on_wm_getminmaxinfo ( FileDialogImpl This,
LPARAM  lparam 
)
static

Definition at line 2099 of file itemdlg.c.

2100{
2101 MINMAXINFO *mmi = (MINMAXINFO*)lparam;
2102 TRACE("%p (%p)\n", This, mmi);
2103
2104 /* FIXME */
2105 mmi->ptMinTrackSize.x = 640;
2106 mmi->ptMinTrackSize.y = 480;
2107
2108 return FALSE;
2109}
POINT ptMinTrackSize
Definition: winuser.h:3630
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

Referenced by itemdlg_dlgproc().

◆ on_wm_initdialog()

static LRESULT on_wm_initdialog ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 1992 of file itemdlg.c.

1993{
1995 HWND hitem;
1996
1997 TRACE("(%p, %p)\n", This, hwnd);
1998
2000 This->dlg_hwnd = hwnd;
2001
2002 hitem = GetDlgItem(This->dlg_hwnd, pshHelp);
2003 if(hitem) ShowWindow(hitem, SW_HIDE);
2004
2005 hitem = GetDlgItem(This->dlg_hwnd, IDC_FILETYPESTATIC);
2006 if(hitem) ShowWindow(hitem, SW_HIDE);
2007
2008 /* Fill filetypes combobox, or hide it. */
2009 hitem = GetDlgItem(This->dlg_hwnd, IDC_FILETYPE);
2010 if(This->filterspec_count)
2011 {
2012 HDC hdc;
2013 HFONT font;
2014 SIZE size;
2015 UINT i, maxwidth = 0;
2016
2017 hdc = GetDC(hitem);
2018 font = (HFONT)SendMessageW(hitem, WM_GETFONT, 0, 0);
2020
2021 for(i = 0; i < This->filterspec_count; i++)
2022 {
2023 SendMessageW(hitem, CB_ADDSTRING, 0, (LPARAM)This->filterspecs[i].pszName);
2024
2025 if(GetTextExtentPoint32W(hdc, This->filterspecs[i].pszName, lstrlenW(This->filterspecs[i].pszName), &size))
2026 maxwidth = max(maxwidth, size.cx);
2027 }
2028 ReleaseDC(hitem, hdc);
2029
2030 if(maxwidth > 0)
2031 {
2032 maxwidth += GetSystemMetrics(SM_CXVSCROLL) + 4;
2033 SendMessageW(hitem, CB_SETDROPPEDWIDTH, (WPARAM)maxwidth, 0);
2034 }
2035 else
2036 ERR("Failed to calculate width of filetype dropdown\n");
2037
2038 SendMessageW(hitem, CB_SETCURSEL, This->filetypeindex, 0);
2039 }
2040 else
2041 ShowWindow(hitem, SW_HIDE);
2042
2043 if(This->set_filename &&
2044 (hitem = GetDlgItem(This->dlg_hwnd, IDC_FILENAME)) )
2045 SendMessageW(hitem, WM_SETTEXT, 0, (LPARAM)This->set_filename);
2046
2047 if(This->hmenu_opendropdown)
2048 {
2049 HWND dropdown_hwnd;
2050 LOGFONTW lfw, lfw_marlett;
2051 HFONT dialog_font;
2052 static const WCHAR marlett[] = {'M','a','r','l','e','t','t',0};
2053 static const WCHAR prop_this[] = {'i','t','e','m','d','l','g','_','T','h','i','s',0};
2054 static const WCHAR prop_oldwndproc[] = {'i','t','e','m','d','l','g','_','o','l','d','w','n','d','p','r','o','c',0};
2055
2056 dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1);
2057
2058 /* Change dropdown button font to Marlett */
2059 dialog_font = (HFONT)SendMessageW(dropdown_hwnd, WM_GETFONT, 0, 0);
2060
2061 GetObjectW(dialog_font, sizeof(lfw), &lfw);
2062
2063 memset(&lfw_marlett, 0, sizeof(lfw_marlett));
2064 lstrcpyW(lfw_marlett.lfFaceName, marlett);
2065 lfw_marlett.lfHeight = lfw.lfHeight;
2066 lfw_marlett.lfCharSet = SYMBOL_CHARSET;
2067
2068 This->hfont_opendropdown = CreateFontIndirectW(&lfw_marlett);
2069
2070 SendMessageW(dropdown_hwnd, WM_SETFONT, (LPARAM)This->hfont_opendropdown, 0);
2071
2072 /* Subclass button so we can handle LBUTTONDOWN */
2073 SetPropW(dropdown_hwnd, prop_this, This);
2074 SetPropW(dropdown_hwnd, prop_oldwndproc,
2076 }
2077
2078 ctrl_container_reparent(This, This->dlg_hwnd);
2083
2084 if(This->filterspec_count)
2086
2087 if ((hitem = GetDlgItem(This->dlg_hwnd, IDC_FILENAME)))
2088 SetFocus(hitem);
2089
2090 return FALSE;
2091}
LPARAM lParam
Definition: combotst.c:139
#define pshHelp
Definition: dlgs.h:127
static LRESULT CALLBACK dropdown_subclass_proc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1973
static HRESULT init_explorerbrowser(FileDialogImpl *This)
Definition: itemdlg.c:1846
static void init_toolbar(FileDialogImpl *This, HWND hwnd)
Definition: itemdlg.c:1902
#define IDC_FILETYPESTATIC
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define memset(x, y, z)
Definition: compat.h:39
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfCharSet
Definition: dimm.idl:67
#define GWLP_WNDPROC
Definition: treelist.c:66
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define SYMBOL_CHARSET
Definition: wingdi.h:385
#define SW_HIDE
Definition: winuser.h:768
#define CB_SETDROPPEDWIDTH
Definition: winuser.h:1962
#define SM_CXVSCROLL
Definition: winuser.h:961
HWND WINAPI SetFocus(_In_opt_ HWND)

Referenced by itemdlg_dlgproc().

◆ on_wm_size()

static LRESULT on_wm_size ( FileDialogImpl This)
static

Definition at line 2093 of file itemdlg.c.

2094{
2096 return FALSE;
2097}

Referenced by itemdlg_dlgproc().

◆ radiobuttonlist_on_bn_clicked()

static LRESULT radiobuttonlist_on_bn_clicked ( FileDialogImpl This,
HWND  hwnd,
HWND  child 
)
static

Definition at line 1434 of file itemdlg.c.

1435{
1439 BOOL found_item=FALSE;
1440
1441 ctrl = get_cctrl_from_dlgid(This, ctrl_id);
1442
1443 if (!ctrl)
1444 {
1445 ERR("Can't find this control\n");
1446 return 0;
1447 }
1448
1450 {
1451 if (item->hwnd == child)
1452 {
1453 found_item = TRUE;
1454 break;
1455 }
1456 }
1457
1458 if (!found_item)
1459 {
1460 ERR("Can't find control item\n");
1461 return 0;
1462 }
1463
1465
1467
1468 return 0;
1469}
static HWND child
Definition: cursoricon.c:298
#define DWORD
Definition: nt_native.h:44
#define GWLP_ID
Definition: winuser.h:860

Referenced by radiobuttonlist_on_wm_command().

◆ radiobuttonlist_on_wm_command()

static LRESULT radiobuttonlist_on_wm_command ( FileDialogImpl This,
HWND  hwnd,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1471 of file itemdlg.c.

1472{
1473 switch(HIWORD(wparam))
1474 {
1476 }
1477
1478 return FALSE;
1479}
static LRESULT radiobuttonlist_on_bn_clicked(FileDialogImpl *This, HWND hwnd, HWND child)
Definition: itemdlg.c:1434

Referenced by radiobuttonlist_proc().

◆ radiobuttonlist_proc()

static LRESULT CALLBACK radiobuttonlist_proc ( HWND  hwnd,
UINT  message,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1481 of file itemdlg.c.

1482{
1484
1485 switch(message)
1486 {
1488 }
1489
1491}
static LRESULT radiobuttonlist_on_wm_command(FileDialogImpl *This, HWND hwnd, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:1471

Referenced by init_custom_controls().

◆ radiobuttonlist_set_selected_item()

static void radiobuttonlist_set_selected_item ( FileDialogImpl This,
customctrl ctrl,
cctrl_item item 
)
static

Definition at line 1424 of file itemdlg.c.

1425{
1427
1429 {
1431 }
1432}

Referenced by IFileDialogCustomize_fnSetSelectedControlItem(), and radiobuttonlist_on_bn_clicked().

◆ set_file_name()

static BOOL set_file_name ( FileDialogImpl This,
LPCWSTR  str 
)
static

Definition at line 387 of file itemdlg.c.

388{
389 if(This->set_filename)
390 LocalFree(This->set_filename);
391
392 This->set_filename = str ? StrDupW(str) : NULL;
393
394 return SetDlgItemTextW(This->dlg_hwnd, IDC_FILENAME, This->set_filename);
395}
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)

Referenced by fill_filename_from_selection(), IFileDialog2_fnSetFileName(), and on_command_filetype().

◆ shell_item_exists()

static BOOL shell_item_exists ( IShellItem shellitem)
static

Definition at line 484 of file itemdlg.c.

485{
487 HRESULT hr;
488 BOOL result;
489
490 hr = IShellItem_GetDisplayName(shellitem, SIGDN_FILESYSPATH, &filename);
491 if (SUCCEEDED(hr))
492 {
493 /* FIXME: Implement SFGAO_VALIDATE in Wine and use it instead. */
496 }
497 else
498 {
499 SFGAOF attributes;
500 result = SUCCEEDED(IShellItem_GetAttributes(shellitem, SFGAO_VALIDATE, &attributes));
501 }
502
503 return result;
504}
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by on_default_action().

◆ show_opendropdown()

static void show_opendropdown ( FileDialogImpl This)
static

Definition at line 711 of file itemdlg.c.

712{
713 HWND open_hwnd;
714 RECT open_rc;
715 MSG msg;
716
717 open_hwnd = GetDlgItem(This->dlg_hwnd, IDOK);
718
719 GetWindowRect(open_hwnd, &open_rc);
720
721 if (TrackPopupMenu(This->hmenu_opendropdown, 0, open_rc.left, open_rc.bottom, 0, This->dlg_hwnd, NULL) &&
722 PeekMessageW(&msg, This->dlg_hwnd, WM_MENUCOMMAND, WM_MENUCOMMAND, PM_REMOVE))
723 {
724 MENUITEMINFOW mii;
725
726 This->opendropdown_has_selection = TRUE;
727
728 mii.cbSize = sizeof(mii);
729 mii.fMask = MIIM_ID;
730 GetMenuItemInfoW((HMENU)msg.lParam, msg.wParam, TRUE, &mii);
731 This->opendropdown_selection = mii.wID;
732
734 EndDialog(This->dlg_hwnd, S_OK);
735 else
736 This->opendropdown_has_selection = FALSE;
737 }
738}
#define msg(x)
Definition: auth_time.c:54
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1196
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)

Referenced by dropdown_subclass_proc(), and on_command_opendropdown().

◆ update_control_text()

static void update_control_text ( FileDialogImpl This)
static

Definition at line 1935 of file itemdlg.c.

1936{
1937 HWND hitem;
1938 LPCWSTR custom_okbutton;
1940 UINT min_width = MulDiv(50, This->dpi_x, USER_DEFAULT_SCREEN_DPI);
1941 UINT max_width = MulDiv(250, This->dpi_x, USER_DEFAULT_SCREEN_DPI);
1942
1943 if(This->custom_title)
1944 SetWindowTextW(This->dlg_hwnd, This->custom_title);
1945
1946 if(This->hmenu_opendropdown && (item = get_first_item(&This->cctrl_opendropdown)))
1947 custom_okbutton = item->label;
1948 else
1949 custom_okbutton = This->custom_okbutton;
1950
1951 if(custom_okbutton &&
1952 (hitem = GetDlgItem(This->dlg_hwnd, IDOK)))
1953 {
1954 SetWindowTextW(hitem, custom_okbutton);
1955 ctrl_resize(hitem, min_width, max_width, FALSE);
1956 }
1957
1958 if(This->custom_cancelbutton &&
1959 (hitem = GetDlgItem(This->dlg_hwnd, IDCANCEL)))
1960 {
1961 SetWindowTextW(hitem, This->custom_cancelbutton);
1962 ctrl_resize(hitem, min_width, max_width, FALSE);
1963 }
1964
1965 if(This->custom_filenamelabel &&
1966 (hitem = GetDlgItem(This->dlg_hwnd, IDC_FILENAMESTATIC)))
1967 {
1968 SetWindowTextW(hitem, This->custom_filenamelabel);
1969 ctrl_resize(hitem, min_width, max_width, FALSE);
1970 }
1971}
#define IDC_FILENAMESTATIC
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by IFileDialog2_fnSetCancelButtonLabel(), IFileDialog2_fnSetFileNameLabel(), IFileDialog2_fnSetOkButtonLabel(), IFileDialog2_fnSetTitle(), IFileDialogCustomize_fnSetControlItemState(), and on_wm_initdialog().

◆ update_layout()

static void update_layout ( FileDialogImpl This)
static

Definition at line 1642 of file itemdlg.c.

1643{
1644 HDWP hdwp;
1645 HWND hwnd;
1646 RECT dialog_rc;
1647 RECT cancel_rc, dropdown_rc, open_rc;
1648 RECT filetype_rc, filename_rc, filenamelabel_rc;
1649 RECT toolbar_rc, ebrowser_rc, customctrls_rc;
1650 static const UINT vspacing = 4, hspacing = 4;
1651 static const UINT min_width = 320, min_height = 200;
1652 BOOL show_dropdown;
1653
1654 if (!GetClientRect(This->dlg_hwnd, &dialog_rc))
1655 {
1656 TRACE("Invalid dialog window, not updating layout\n");
1657 return;
1658 }
1659
1660 if(dialog_rc.right < min_width || dialog_rc.bottom < min_height)
1661 {
1662 TRACE("Dialog size (%d, %d) too small, not updating layout\n", dialog_rc.right, dialog_rc.bottom);
1663 return;
1664 }
1665
1666 /****
1667 * Calculate the size of the dialog and all the parts.
1668 */
1669
1670 /* Cancel button */
1671 hwnd = GetDlgItem(This->dlg_hwnd, IDCANCEL);
1672 if(hwnd)
1673 {
1674 int cancel_width, cancel_height;
1675 GetWindowRect(hwnd, &cancel_rc);
1676 cancel_width = cancel_rc.right - cancel_rc.left;
1677 cancel_height = cancel_rc.bottom - cancel_rc.top;
1678
1679 cancel_rc.left = dialog_rc.right - cancel_width - hspacing;
1680 cancel_rc.top = dialog_rc.bottom - cancel_height - vspacing;
1681 cancel_rc.right = cancel_rc.left + cancel_width;
1682 cancel_rc.bottom = cancel_rc.top + cancel_height;
1683 }
1684
1685 /* Open/Save dropdown */
1686 show_dropdown = update_open_dropdown(This);
1687
1688 if(show_dropdown)
1689 {
1690 int dropdown_width, dropdown_height;
1691 hwnd = GetDlgItem(This->dlg_hwnd, psh1);
1692
1693 GetWindowRect(hwnd, &dropdown_rc);
1694 dropdown_width = dropdown_rc.right - dropdown_rc.left;
1695 dropdown_height = dropdown_rc.bottom - dropdown_rc.top;
1696
1697 dropdown_rc.left = cancel_rc.left - dropdown_width - hspacing;
1698 dropdown_rc.top = cancel_rc.top;
1699 dropdown_rc.right = dropdown_rc.left + dropdown_width;
1700 dropdown_rc.bottom = dropdown_rc.top + dropdown_height;
1701 }
1702 else
1703 {
1704 dropdown_rc.left = dropdown_rc.right = cancel_rc.left - hspacing;
1705 dropdown_rc.top = cancel_rc.top;
1706 dropdown_rc.bottom = cancel_rc.bottom;
1707 }
1708
1709 /* Open/Save button */
1710 hwnd = GetDlgItem(This->dlg_hwnd, IDOK);
1711 if(hwnd)
1712 {
1713 int open_width, open_height;
1714 GetWindowRect(hwnd, &open_rc);
1715 open_width = open_rc.right - open_rc.left;
1716 open_height = open_rc.bottom - open_rc.top;
1717
1718 open_rc.left = dropdown_rc.left - open_width;
1719 open_rc.top = dropdown_rc.top;
1720 open_rc.right = open_rc.left + open_width;
1721 open_rc.bottom = open_rc.top + open_height;
1722 }
1723
1724 /* The filetype combobox. */
1725 hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILETYPE);
1726 if(hwnd)
1727 {
1728 int filetype_width, filetype_height;
1729 GetWindowRect(hwnd, &filetype_rc);
1730
1731 filetype_width = filetype_rc.right - filetype_rc.left;
1732 filetype_height = filetype_rc.bottom - filetype_rc.top;
1733
1734 filetype_rc.right = cancel_rc.right;
1735
1736 filetype_rc.left = filetype_rc.right - filetype_width;
1737 filetype_rc.top = cancel_rc.top - filetype_height - vspacing;
1738 filetype_rc.bottom = filetype_rc.top + filetype_height;
1739
1740 if(!This->filterspec_count)
1741 filetype_rc.left = filetype_rc.right;
1742 }
1743
1744 /* Filename label. */
1745 hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILENAMESTATIC);
1746 if(hwnd)
1747 {
1748 int filetypelabel_width, filetypelabel_height;
1749 GetWindowRect(hwnd, &filenamelabel_rc);
1750
1751 filetypelabel_width = filenamelabel_rc.right - filenamelabel_rc.left;
1752 filetypelabel_height = filenamelabel_rc.bottom - filenamelabel_rc.top;
1753
1754 filenamelabel_rc.left = 160; /* FIXME */
1755 filenamelabel_rc.top = filetype_rc.top;
1756 filenamelabel_rc.right = filenamelabel_rc.left + filetypelabel_width;
1757 filenamelabel_rc.bottom = filenamelabel_rc.top + filetypelabel_height;
1758 }
1759
1760 /* Filename edit box. */
1761 hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILENAME);
1762 if(hwnd)
1763 {
1764 int filename_width, filename_height;
1765 GetWindowRect(hwnd, &filename_rc);
1766
1767 filename_width = filetype_rc.left - filenamelabel_rc.right - hspacing*2;
1768 filename_height = filename_rc.bottom - filename_rc.top;
1769
1770 filename_rc.left = filenamelabel_rc.right + hspacing;
1771 filename_rc.top = filetype_rc.top;
1772 filename_rc.right = filename_rc.left + filename_width;
1773 filename_rc.bottom = filename_rc.top + filename_height;
1774 }
1775
1776 hwnd = GetDlgItem(This->dlg_hwnd, IDC_NAV_TOOLBAR);
1777 if(hwnd)
1778 {
1779 GetWindowRect(hwnd, &toolbar_rc);
1780 MapWindowPoints(NULL, This->dlg_hwnd, (POINT*)&toolbar_rc, 2);
1781 }
1782
1783 /* The custom controls */
1784 customctrls_rc.left = dialog_rc.left + hspacing;
1785 customctrls_rc.right = dialog_rc.right - hspacing;
1786 customctrls_rc.bottom = filename_rc.top - vspacing;
1787 customctrls_rc.top = customctrls_rc.bottom -
1788 ctrl_container_resize(This, customctrls_rc.right - customctrls_rc.left);
1789
1790 /* The ExplorerBrowser control. */
1791 ebrowser_rc.left = dialog_rc.left + hspacing;
1792 ebrowser_rc.top = toolbar_rc.bottom + vspacing;
1793 ebrowser_rc.right = dialog_rc.right - hspacing;
1794 ebrowser_rc.bottom = customctrls_rc.top - vspacing;
1795
1796 /****
1797 * Move everything to the right place.
1798 */
1799
1800 /* FIXME: The Save Dialog uses a slightly different layout. */
1801 hdwp = BeginDeferWindowPos(7);
1802
1803 if(hdwp && This->peb)
1804 IExplorerBrowser_SetRect(This->peb, &hdwp, ebrowser_rc);
1805
1806 if(hdwp && This->cctrls_hwnd)
1807 DeferWindowPos(hdwp, This->cctrls_hwnd, NULL,
1808 customctrls_rc.left, customctrls_rc.top,
1809 customctrls_rc.right - customctrls_rc.left, customctrls_rc.bottom - customctrls_rc.top,
1811
1812 /* The default controls */
1813 if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILETYPE)) )
1814 DeferWindowPos(hdwp, hwnd, NULL, filetype_rc.left, filetype_rc.top, 0, 0,
1816
1817 if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILENAME)) )
1818 DeferWindowPos(hdwp, hwnd, NULL, filename_rc.left, filename_rc.top,
1819 filename_rc.right - filename_rc.left, filename_rc.bottom - filename_rc.top,
1821
1822 if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDC_FILENAMESTATIC)) )
1823 DeferWindowPos(hdwp, hwnd, NULL, filenamelabel_rc.left, filenamelabel_rc.top, 0, 0,
1825
1826 if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDOK)) )
1827 DeferWindowPos(hdwp, hwnd, NULL, open_rc.left, open_rc.top, 0, 0,
1829
1830 if(hdwp && This->hmenu_opendropdown && (hwnd = GetDlgItem(This->dlg_hwnd, psh1)))
1831 DeferWindowPos(hdwp, hwnd, NULL, dropdown_rc.left, dropdown_rc.top, 0, 0,
1833
1834 if(hdwp && (hwnd = GetDlgItem(This->dlg_hwnd, IDCANCEL)) )
1835 DeferWindowPos(hdwp, hwnd, NULL, cancel_rc.left, cancel_rc.top, 0, 0,
1837
1838 if(hdwp)
1839 EndDeferWindowPos(hdwp);
1840 else
1841 ERR("Failed to position dialog controls.\n");
1842
1843 return;
1844}
static UINT ctrl_container_resize(FileDialogImpl *This, UINT container_width)
Definition: itemdlg.c:1202
static BOOL update_open_dropdown(FileDialogImpl *This)
Definition: itemdlg.c:1584
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by IFileDialog2_fnSetCancelButtonLabel(), IFileDialog2_fnSetFileNameLabel(), IFileDialog2_fnSetOkButtonLabel(), IFileDialogCustomize_fnSetControlItemState(), on_wm_initdialog(), and on_wm_size().

◆ update_open_dropdown()

static BOOL update_open_dropdown ( FileDialogImpl This)
static

Definition at line 1584 of file itemdlg.c.

1585{
1586 /* Show or hide the open dropdown button as appropriate */
1587 BOOL show=FALSE, showing;
1588 HWND open_hwnd, dropdown_hwnd;
1589
1590 if (This->hmenu_opendropdown)
1591 {
1592 INT num_visible_items=0;
1594
1595 LIST_FOR_EACH_ENTRY(item, &This->cctrl_opendropdown.sub_items, cctrl_item, entry)
1596 {
1597 if (item->cdcstate & CDCS_VISIBLE)
1598 {
1599 num_visible_items++;
1600 if (num_visible_items >= 2)
1601 {
1602 show = TRUE;
1603 break;
1604 }
1605 }
1606 }
1607 }
1608
1609 open_hwnd = GetDlgItem(This->dlg_hwnd, IDOK);
1610 dropdown_hwnd = GetDlgItem(This->dlg_hwnd, psh1);
1611
1612 showing = (GetWindowLongPtrW(dropdown_hwnd, GWL_STYLE) & WS_VISIBLE) != 0;
1613
1614 if (showing != show)
1615 {
1616 RECT open_rc, dropdown_rc;
1617
1618 GetWindowRect(open_hwnd, &open_rc);
1619 GetWindowRect(dropdown_hwnd, &dropdown_rc);
1620
1621 if (show)
1622 {
1623 ShowWindow(dropdown_hwnd, SW_SHOW);
1624
1625 SetWindowPos(open_hwnd, NULL, 0, 0,
1626 (open_rc.right - open_rc.left) - (dropdown_rc.right - dropdown_rc.left),
1627 open_rc.bottom - open_rc.top, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
1628 }
1629 else
1630 {
1631 ShowWindow(dropdown_hwnd, SW_HIDE);
1632
1633 SetWindowPos(open_hwnd, NULL, 0, 0,
1634 (open_rc.right - open_rc.left) + (dropdown_rc.right - dropdown_rc.left),
1635 open_rc.bottom - open_rc.top, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
1636 }
1637 }
1638
1639 return show;
1640}
int32_t INT
Definition: typedefs.h:58
#define SW_SHOW
Definition: winuser.h:775

Referenced by update_layout().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( commdlg  )

Variable Documentation

◆ floatnotifysinkW

const WCHAR floatnotifysinkW[] = {'F','l','o','a','t','N','o','t','i','f','y','S','i','n','k',0}
static

Definition at line 54 of file itemdlg.c.

Referenced by cctrl_create_new(), init_custom_controls(), and test_customize_onfolderchange().

◆ notifysink_childW

const WCHAR notifysink_childW[] = {'n','f','s','_','c','h','i','l','d',0}
static

Definition at line 53 of file itemdlg.c.

Referenced by cctrl_create_new(), and notifysink_proc().

◆ radiobuttonlistW

const WCHAR radiobuttonlistW[] = {'R','a','d','i','o','B','u','t','t','o','n','L','i','s','t',0}
static

Definition at line 55 of file itemdlg.c.

Referenced by IFileDialogCustomize_fnAddRadioButtonList(), and init_custom_controls().

◆ vt_ICommDlgBrowser3

const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3
static
Initial value:
= {
}
static HRESULT WINAPI ICommDlgBrowser3_fnOnColumnClicked(ICommDlgBrowser3 *iface, IShellView *pshv, int iColumn)
Definition: itemdlg.c:3622
static HRESULT WINAPI ICommDlgBrowser3_fnGetCurrentFilter(ICommDlgBrowser3 *iface, LPWSTR pszFileSpec, int cchFileSpec)
Definition: itemdlg.c:3630
static ULONG WINAPI ICommDlgBrowser3_fnAddRef(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3479
static HRESULT WINAPI ICommDlgBrowser3_fnOnDefaultCommand(ICommDlgBrowser3 *iface, IShellView *shv)
Definition: itemdlg.c:3493
static HRESULT WINAPI ICommDlgBrowser3_fnNotify(ICommDlgBrowser3 *iface, IShellView *ppshv, DWORD dwNotifyType)
Definition: itemdlg.c:3598
static HRESULT WINAPI ICommDlgBrowser3_fnOnPreviewCreated(ICommDlgBrowser3 *iface, IShellView *pshv)
Definition: itemdlg.c:3638
static HRESULT WINAPI ICommDlgBrowser3_fnGetDefaultMenuText(ICommDlgBrowser3 *iface, IShellView *pshv, LPWSTR pszText, int cchMax)
Definition: itemdlg.c:3606
static HRESULT WINAPI ICommDlgBrowser3_fnIncludeObject(ICommDlgBrowser3 *iface, IShellView *shv, LPCITEMIDLIST pidl)
Definition: itemdlg.c:3545
static HRESULT WINAPI ICommDlgBrowser3_fnGetViewFlags(ICommDlgBrowser3 *iface, DWORD *pdwFlags)
Definition: itemdlg.c:3615
static HRESULT WINAPI ICommDlgBrowser3_fnQueryInterface(ICommDlgBrowser3 *iface, REFIID riid, void **ppvObject)
Definition: itemdlg.c:3471
static HRESULT WINAPI ICommDlgBrowser3_fnOnStateChange(ICommDlgBrowser3 *iface, IShellView *shv, ULONG uChange)
Definition: itemdlg.c:3508
static ULONG WINAPI ICommDlgBrowser3_fnRelease(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3486

Definition at line 3646 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IExplorerBrowserEvents

const IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents
static
Initial value:
= {
}
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationComplete(IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
Definition: itemdlg.c:3366
static ULONG WINAPI IExplorerBrowserEvents_fnRelease(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3325
static HRESULT WINAPI IExplorerBrowserEvents_fnQueryInterface(IExplorerBrowserEvents *iface, REFIID riid, void **ppvObject)
Definition: itemdlg.c:3309
static ULONG WINAPI IExplorerBrowserEvents_fnAddRef(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3318
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationPending(IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
Definition: itemdlg.c:3332
static HRESULT WINAPI IExplorerBrowserEvents_fnOnViewCreated(IExplorerBrowserEvents *iface, IShellView *psv)
Definition: itemdlg.c:3358
static HRESULT WINAPI IExplorerBrowserEvents_fnOnNavigationFailed(IExplorerBrowserEvents *iface, PCIDLIST_ABSOLUTE pidlFolder)
Definition: itemdlg.c:3388

Definition at line 3396 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IFileDialog2

const IFileDialog2Vtbl vt_IFileDialog2
static

Definition at line 2781 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IFileDialogCustomize

const IFileDialogCustomizeVtbl vt_IFileDialogCustomize
static

Definition at line 4567 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IFileOpenDialog

const IFileOpenDialogVtbl vt_IFileOpenDialog
static

Definition at line 3018 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IFileSaveDialog

const IFileSaveDialogVtbl vt_IFileSaveDialog
static

Definition at line 3266 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IOleWindow

const IOleWindowVtbl vt_IOleWindow
static
Initial value:
= {
}
static HRESULT WINAPI IOleWindow_fnQueryInterface(IOleWindow *iface, REFIID riid, void **ppvObject)
Definition: itemdlg.c:3669
static HRESULT WINAPI IOleWindow_fnGetWindow(IOleWindow *iface, HWND *phwnd)
Definition: itemdlg.c:3694
static ULONG WINAPI IOleWindow_fnAddRef(IOleWindow *iface)
Definition: itemdlg.c:3675
static ULONG WINAPI IOleWindow_fnRelease(IOleWindow *iface)
Definition: itemdlg.c:3681
static HRESULT WINAPI IOleWindow_fnContextSensitiveHelp(IOleWindow *iface, BOOL fEnterMOde)
Definition: itemdlg.c:3687

Definition at line 3702 of file itemdlg.c.

Referenced by FileDialog_constructor().

◆ vt_IServiceProvider

const IServiceProviderVtbl vt_IServiceProvider
static
Initial value:
= {
}
static ULONG WINAPI IServiceProvider_fnRelease(IServiceProvider *iface)
Definition: itemdlg.c:3429
static HRESULT WINAPI IServiceProvider_fnQueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: itemdlg.c:3436
static ULONG WINAPI IServiceProvider_fnAddRef(IServiceProvider *iface)
Definition: itemdlg.c:3422
static HRESULT WINAPI IServiceProvider_fnQueryInterface(IServiceProvider *iface, REFIID riid, void **ppvObject)
Definition: itemdlg.c:3414

Definition at line 3456 of file itemdlg.c.

Referenced by FileDialog_constructor().