ReactOS  0.4.13-dev-66-gc714b7f
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.

◆ ITEMDLG_TYPE

Enumerator
ITEMDLG_TYPE_OPEN 
ITEMDLG_TYPE_SAVE 

Definition at line 57 of file itemdlg.c.

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 {
787  cctrl_item* item;
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 }
v1_enum CDCS_ENABLED
#define lstrlenW
Definition: compat.h:407
static cctrl_item * get_item(customctrl *parent, DWORD itemid, CDCONTROLSTATEF visible_flags, DWORD *position)
Definition: itemdlg.c:751
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
r parent
Definition: btrfs.c:2659
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint8_t label[11]
Definition: fsck.fat.h:65
#define S_OK
Definition: intsafe.h:59
static ATOM item
Definition: dde.c:856
#define lstrcpyW
Definition: compat.h:406
WCHAR * LPWSTR
Definition: xmlstorage.h:184
GLuint64EXT * result
Definition: glext.h:11304
#define HeapFree(x, y, z)
Definition: compat.h:394

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;
1145  DWORD wsflags = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
1146  customctrl *ctrl;
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 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static customctrl * get_cctrl(FileDialogImpl *This, DWORD ctlid)
Definition: itemdlg.c:837
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
const WCHAR * text
Definition: package.c:1827
#define WS_CHILD
Definition: pedump.c:617
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GWLP_USERDATA
Definition: treelist.c:63
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
static const WCHAR notifysink_childW[]
Definition: itemdlg.c:53
#define ctrl
Definition: input.c:1669
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
unsigned long DWORD
Definition: ntddk_ex.h:95
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)
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
v1_enum CDCS_VISIBLE
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define E_UNEXPECTED
Definition: winerror.h:2456
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
GLenum GLuint id
Definition: glext.h:5579
static const WCHAR floatnotifysinkW[]
Definition: itemdlg.c:54
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

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 
286  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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
uint8_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
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 
324  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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 }
static HRESULT get_cctrl_event(IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce)
Definition: itemdlg.c:276
uint8_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
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 
344  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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 }
static HRESULT get_cctrl_event(IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce)
Definition: itemdlg.c:276
uint8_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
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 
305  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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 }
static HRESULT get_cctrl_event(IFileDialogEvents *pfde, IFileDialogControlEvents **pfdce)
Definition: itemdlg.c:276
uint8_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
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
static LRESULT CALLBACK itemdlg_dlgproc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam)
Definition: itemdlg.c:2241
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
int32_t INT_PTR
Definition: typedefs.h:62
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2659
LONG HRESULT
Definition: typedefs.h:77
#define SetLastError(x)
Definition: compat.h:409
#define ERR(fmt,...)
Definition: debug.h:109
GLuint res
Definition: glext.h:9613
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
static const WCHAR crs[]
#define SetWindowLongPtrW
Definition: winuser.h:5215

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 }
#define TRUE
Definition: types.h:120
uint8_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
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  {
1352  customctrl *ctrl;
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  {
1370  if(font) ctrl_set_font(ctrl, font);
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 TRUE
Definition: types.h:120
static void ctrl_set_font(customctrl *ctrl, HFONT font)
Definition: itemdlg.c:1325
Definition: mk_font.cpp:20
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
uint8_t entry
Definition: isohybrid.c:63
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static void customctrl_resize(FileDialogImpl *This, customctrl *ctrl)
Definition: itemdlg.c:939
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
long LONG
Definition: pedump.c:60
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
#define ctrl
Definition: input.c:1669
r parent
Definition: btrfs.c:2659
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_POPUP
Definition: pedump.c:616
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)

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;
1209  customctrl *ctrl;
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 }
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
uint8_t entry
Definition: isohybrid.c:63
LONG top
Definition: windef.h:292
#define SWP_NOZORDER
Definition: winuser.h:1232
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static UINT ctrl_get_height(customctrl *ctrl)
Definition: itemdlg.c:904
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define ctrl
Definition: input.c:1669
#define TRACE(s)
Definition: solgame.cpp:4
#define SWP_NOACTIVATE
Definition: winuser.h:1227
#define SWP_NOSIZE
Definition: winuser.h:1230
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int UINT
Definition: ndis.h:50
LONG bottom
Definition: windef.h:294
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 USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GetWindowLongPtrW
Definition: winuser.h:4698
#define WM_NCCREATE
Definition: winuser.h:1665
static LRESULT ctrl_container_on_wm_destroy(FileDialogImpl *This)
Definition: itemdlg.c:1396
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_DESTROY
Definition: winuser.h:1591
static LRESULT ctrl_container_on_create(HWND hwnd, CREATESTRUCTW *crs)
Definition: itemdlg.c:1387
static UINT WPARAM wparam
Definition: combo.c:716

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);
920  DestroyMenu((HMENU)tbb.dwData);
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 }
#define TB_GETBUTTON
Definition: commctrl.h:1081
uint8_t entry
Definition: isohybrid.c:63
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG_PTR LPARAM
Definition: windef.h:208
static void item_free(cctrl_item *item)
Definition: itemdlg.c:744
DWORD_PTR dwData
Definition: commctrl.h:930
#define ctrl
Definition: input.c:1669
struct list entry
Definition: itemdlg.c:80
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
static void ctrl_free(customctrl *ctrl)
Definition: itemdlg.c:910
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define HeapFree(x, y, z)
Definition: compat.h:394
struct list sub_cctrls_entry
Definition: itemdlg.c:91

Referenced by ctrl_container_on_wm_destroy().

◆ 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 }
LONG top
Definition: windef.h:292
#define ctrl
Definition: input.c:1669
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

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;
874  SendMessageW(hctrl, WM_GETTEXT, len+1, (LPARAM)text);
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 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define max(a, b)
Definition: svc.c:63
HDC WINAPI GetDC(_In_opt_ HWND)
Definition: mk_font.cpp:20
const WCHAR * text
Definition: package.c:1827
#define WM_GETTEXT
Definition: winuser.h:1600
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:292
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define SWP_NOZORDER
Definition: winuser.h:1232
#define lstrlenW
Definition: compat.h:407
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
LONG_PTR LPARAM
Definition: windef.h:208
eMaj lines
Definition: tritemp.h:206
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SWP_NOACTIVATE
Definition: winuser.h:1227
const GLubyte * c
Definition: glext.h:8905
HDC hdc
Definition: main.c:9
GLenum GLsizei len
Definition: glext.h:6722
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define c
Definition: ke_i.h:80
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
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)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)

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;
1328  cctrl_item* item;
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  {
1339  LIST_FOR_EACH_ENTRY(item, &ctrl->sub_items, cctrl_item, entry)
1340  {
1342  }
1343  }
1344 }
#define TRUE
Definition: types.h:120
static void ctrl_set_font(customctrl *ctrl, HFONT font)
Definition: itemdlg.c:1325
Definition: mk_font.cpp:20
uint8_t entry
Definition: isohybrid.c:63
UINT_PTR WPARAM
Definition: windef.h:207
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define ctrl
Definition: input.c:1669
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SETFONT
Definition: winuser.h:1632

Referenced by ctrl_container_reparent().

◆ 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  {
949  case IDLG_CCTRL_COMBOBOX:
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  {
973  UINT width, height;
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  {
988  cctrl_item* item;
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:
1015  case IDLG_CCTRL_SEPARATOR:
1016  case IDLG_CCTRL_MENU:
1018  /* Nothing */
1019  break;
1020  }
1021 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define max(a, b)
Definition: svc.c:63
#define TRUE
Definition: types.h:120
uint8_t entry
Definition: isohybrid.c:63
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
LONG right
Definition: windef.h:293
static void customctrl_resize(FileDialogImpl *This, customctrl *ctrl)
Definition: itemdlg.c:939
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static UINT ctrl_get_height(customctrl *ctrl)
Definition: itemdlg.c:904
smooth NULL
Definition: ftsmooth.c:416
#define ctrl
Definition: input.c:1669
GLsizeiptr size
Definition: glext.h:5919
static void ctrl_resize(HWND hctrl, UINT min_width, UINT max_width, BOOL multiline)
Definition: itemdlg.c:858
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define SWP_NOSIZE
Definition: winuser.h:1230
HWND wrapper_hwnd
Definition: itemdlg.c:84
static ATOM item
Definition: dde.c:856
unsigned int UINT
Definition: ndis.h:50
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
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 USER_DEFAULT_SCREEN_DPI
Definition: winuser.h:2846
#define MulDiv(x, y, z)
Definition: gdifloat.h:86

Referenced by ctrl_container_reparent().

◆ 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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
static void show_opendropdown(FileDialogImpl *This)
Definition: itemdlg.c:711
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define BM_SETCHECK
Definition: winuser.h:1882
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define BST_UNCHECKED
Definition: winuser.h:199
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define BST_CHECKED
Definition: winuser.h:197
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM wparam
Definition: combo.c:716

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 
165  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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 }
HRESULT hr
Definition: shlfolder.c:183
uint8_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
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define E_NOTIMPL
Definition: ddrawi.h:99

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 
204  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
205  {
206  TRACE("Notifying %p\n", cursor);
207  IFileDialogEvents_OnFolderChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
208  }
209 }
uint8_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
const char cursor[]
Definition: icontest.c:13

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 
185  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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:115
HRESULT hr
Definition: shlfolder.c:183
uint8_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
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define E_NOTIMPL
Definition: ddrawi.h:99

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 
242  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
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 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
HRESULT hr
Definition: shlfolder.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
uint8_t entry
Definition: isohybrid.c:63
#define E_FAIL
Definition: ddrawi.h:102
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MB_ICONEXCLAMATION
Definition: winuser.h:779
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define MB_YESNO
Definition: winuser.h:811
#define TRACE(s)
Definition: solgame.cpp:4
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define IDS_OVERWRITEFILE
FDE_OVERWRITE_RESPONSE
Definition: shobjidl.idl:3374
#define S_OK
Definition: intsafe.h:59
const char cursor[]
Definition: icontest.c:13
#define E_NOTIMPL
Definition: ddrawi.h:99
#define IDNO
Definition: winuser.h:830
#define IDCANCEL
Definition: winuser.h:825
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 
216  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
217  {
218  TRACE("Notifying %p\n", cursor);
219  IFileDialogEvents_OnSelectionChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
220  }
221 }
uint8_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
const char cursor[]
Definition: icontest.c:13

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 
228  LIST_FOR_EACH_ENTRY(cursor, &This->events_clients, events_client, entry)
229  {
230  TRACE("Notifying %p\n", cursor);
231  IFileDialogEvents_OnTypeChange(cursor->pfde, (IFileDialog*)&This->IFileDialog2_iface);
232  }
233 }
uint8_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
const char cursor[]
Definition: icontest.c:13

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;
4619  fdimpl->IServiceProvider_iface.lpVtbl = &vt_IServiceProvider;
4620  fdimpl->ICommDlgBrowser3_iface.lpVtbl = &vt_ICommDlgBrowser3;
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 }
IFileDialogCustomize IFileDialogCustomize_iface
Definition: itemdlg.c:112
static const IExplorerBrowserEventsVtbl vt_IExplorerBrowserEvents
Definition: itemdlg.c:3396
#define IDS_SAVE
Definition: cdlg.h:176
IExplorerBrowserEvents IExplorerBrowserEvents_iface
Definition: itemdlg.c:108
struct list events_clients
Definition: itemdlg.c:120
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42
static const ICommDlgBrowser3Vtbl vt_ICommDlgBrowser3
Definition: itemdlg.c:3646
HRESULT hr
Definition: shlfolder.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
REFIID riid
Definition: precomp.h:44
static const IFileSaveDialogVtbl vt_IFileSaveDialog
Definition: itemdlg.c:3266
static HRESULT init_custom_controls(FileDialogImpl *This)
Definition: itemdlg.c:1493
static const IOleWindowVtbl vt_IOleWindow
Definition: itemdlg.c:3702
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static const IFileOpenDialogVtbl vt_IFileOpenDialog
Definition: itemdlg.c:3018
union FileDialogImpl::@330 u
#define E_FAIL
Definition: ddrawi.h:102
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
enum ITEMDLG_TYPE dlg_type
Definition: itemdlg.c:107
HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
ICommDlgBrowser3 ICommDlgBrowser3_iface
Definition: itemdlg.c:110
smooth NULL
Definition: ftsmooth.c:416
static const IFileDialog2Vtbl vt_IFileDialog2
Definition: itemdlg.c:2781
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
FILEOPENDIALOGOPTIONS options
Definition: itemdlg.c:115
LONG HRESULT
Definition: typedefs.h:77
LPWSTR custom_title
Definition: itemdlg.c:135
LPWSTR custom_okbutton
Definition: itemdlg.c:136
IShellItem * psi_defaultfolder
Definition: itemdlg.c:125
IOleWindow IOleWindow_iface
Definition: itemdlg.c:111
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:109
IServiceProvider IServiceProvider_iface
Definition: itemdlg.c:109
IFileSaveDialog IFileSaveDialog_iface
Definition: itemdlg.c:105
#define ARRAY_SIZE(a)
Definition: main.h:24
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static const IServiceProviderVtbl vt_IServiceProvider
Definition: itemdlg.c:3456
static const IFileDialogCustomizeVtbl vt_IFileDialogCustomize
Definition: itemdlg.c:4567
#define E_POINTER
Definition: winerror.h:2365
IFileOpenDialog IFileOpenDialog_iface
Definition: itemdlg.c:104
IFileDialog2 IFileDialog2_iface
Definition: itemdlg.c:102

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
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

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 }
static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv, enum ITEMDLG_TYPE type)
Definition: itemdlg.c:4600
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39

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  {
441  set_file_name(This, names[0]);
442  CoTaskMemFree(names[0]);
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
#define lstrlenW
Definition: compat.h:407
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
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
Definition: cookie.c:170
__u8 attr
Definition: mkdosfs.c:359
char string[160]
Definition: util.h:11
#define lstrcpyW
Definition: compat.h:406
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SUCCEEDED(hr)
Definition: intsafe.h:57
Definition: fci.c:126

Referenced by ICommDlgBrowser3_fnOnStateChange().

◆ get_cctrl()

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

Definition at line 837 of file itemdlg.c.

838 {
839  customctrl *ctrl, *sub_ctrl;
840 
842  {
843  if(ctrl->id == ctlid)
844  return ctrl;
845 
846  LIST_FOR_EACH_ENTRY(sub_ctrl, &ctrl->sub_cctrls, customctrl, sub_cctrls_entry)
847  if(sub_ctrl->id == ctlid)
848  return sub_ctrl;
849  }
850 
851  if (This->hmenu_opendropdown && This->cctrl_opendropdown.id == ctlid)
852  return &This->cctrl_opendropdown;
853 
854  TRACE("No existing control with control id %d\n", ctlid);
855  return NULL;
856 }
uint8_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
#define ctrl
Definition: input.c:1669
UINT id
Definition: itemdlg.c:85
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by cctrl_create_new(), IFileDialogCustomize_fnAddControlItem(), IFileDialogCustomize_fnEnableOpenDropDown(), IFileDialogCustomize_fnGetCheckButtonState(), IFileDialogCustomize_fnGetControlItemState(), IFileDialogCustomize_fnGetControlState(), IFileDialogCustomize_fnGetEditBoxText(), IFileDialogCustomize_fnGetSelectedControlItem(), IFileDialogCustomize_fnRemoveControlItem(), IFileDialogCustomize_fnSetCheckButtonState(), IFileDialogCustomize_fnSetControlItemState(), IFileDialogCustomize_fnSetControlLabel(), IFileDialogCustomize_fnSetControlState(), IFileDialogCustomize_fnSetEditBoxText(), and IFileDialogCustomize_fnSetSelectedControlItem().

◆ 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
uint8_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
#define ctrl
Definition: input.c:1669
#define ERR(fmt,...)
Definition: debug.h:109

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 }
#define CB_GETITEMDATA
Definition: winuser.h:1911
GLuint GLuint GLsizei count
Definition: gl.h:1545
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
#define CB_ERR
Definition: winuser.h:2389
#define TRACE(s)
Definition: solgame.cpp:4
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
#define CB_GETCOUNT
Definition: winuser.h:1903

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 WM_GETTEXTLENGTH
Definition: winuser.h:1601
#define WM_GETTEXT
Definition: winuser.h:1600
#define IDC_FILENAME
#define lstrlenW
Definition: compat.h:407
const WCHAR * str
LONG_PTR LPARAM
Definition: windef.h:208
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
#define lstrcpyW
Definition: compat.h:406
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406

Referenced by IFileDialog2_fnGetFileName(), on_command_filetype(), and on_default_action().

◆ 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 }
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
smooth NULL
Definition: ftsmooth.c:416
char ext[3]
Definition: mkdosfs.c:358
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define lstrcpyW
Definition: compat.h:406
LPWSTR WINAPI StrChrW(LPCWSTR lpszStr, WCHAR ch)
Definition: string.c:468

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 {
774  cctrl_item* item;
775 
777  {
778  if ((item->cdcstate & (CDCS_VISIBLE|CDCS_ENABLED)) == (CDCS_VISIBLE|CDCS_ENABLED))
779  return item;
780  }
781 
782  return NULL;
783 }
uint8_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2659
static ATOM item
Definition: dde.c:856

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;
754  cctrl_item* item;
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 }
uint8_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2659
unsigned long DWORD
Definition: ntddk_ex.h:95
static ATOM item
Definition: dde.c:856
unsigned char dummy
Definition: maze.c:118

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
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
UINT cchMax
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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;
3550  LPWSTR filename;
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 }
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:925
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
HRESULT hr
Definition: shlfolder.c:183
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:699
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
const char * filename
Definition: ioapi.h:135
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
Definition: cookie.c:170
__u8 attr
Definition: mkdosfs.c:359
HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl)
Definition: pidl.c:1472
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI PathMatchSpecW(LPCWSTR lpszPath, LPCWSTR lpszMask)
Definition: path.c:1943
unsigned int ULONG
Definition: retypes.h:1
HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT on_default_action(FileDialogImpl *This)
Definition: itemdlg.c:506
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
static void events_OnSelectionChange(FileDialogImpl *This)
Definition: itemdlg.c:211
const GUID IID_IDataObject
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static void fill_filename_from_selection(FileDialogImpl *This)
Definition: itemdlg.c:397
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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 }
REFIID riid
Definition: precomp.h:44
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define TRACE(s)
Definition: solgame.cpp:4
REFIID LPVOID * ppvObject
Definition: precomp.h:44

◆ 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 }
static FileDialogImpl * impl_from_ICommDlgBrowser3(ICommDlgBrowser3 *iface)
Definition: itemdlg.c:3466
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
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 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static void events_OnFolderChange(FileDialogImpl *This)
Definition: itemdlg.c:199
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv)
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT events_OnFolderChanging(FileDialogImpl *This, IShellItem *folder)
Definition: itemdlg.c:179
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
#define TRACE(s)
Definition: solgame.cpp:4
static FileDialogImpl * impl_from_IExplorerBrowserEvents(IExplorerBrowserEvents *iface)
Definition: itemdlg.c:3304

◆ 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 }
#define FIXME(fmt,...)
Definition: debug.h:110
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define S_OK
Definition: intsafe.h:59

◆ IFileDialog2_fnAddRef()

static ULONG WINAPI IFileDialog2_fnAddRef ( IFileDialog2 iface)
static

Definition at line 2341 of file itemdlg.c.

2342 {
2344  LONG ref = InterlockedIncrement(&This->ref);
2345  TRACE("%p - ref %d\n", This, ref);
2346 
2347  return ref;
2348 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ 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 
2467  client = HeapAlloc(GetProcessHeap(), 0, sizeof(events_client));
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 }
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static FILE * client
Definition: client.c:41
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define FIXME(fmt,...)
Definition: debug.h:110
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77

◆ 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 E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static UINT get_file_name(FileDialogImpl *This, LPWSTR *str)
Definition: itemdlg.c:361

◆ 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 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
HRESULT hr
Definition: shlfolder.c:183
#define E_FAIL
Definition: ddrawi.h:102
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned int UINT
Definition: ndis.h:50
#define E_UNEXPECTED
Definition: winerror.h:2456
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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;
2292  if(IsEqualGUID(riid, &IID_IUnknown) ||
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IOleWindow

◆ IFileDialog2_fnRelease()

static ULONG WINAPI IFileDialog2_fnRelease ( IFileDialog2 iface)
static

Definition at line 2350 of file itemdlg.c.

2351 {
2353  LONG ref = InterlockedDecrement(&This->ref);
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 
2384  HeapFree(GetProcessHeap(), 0, This);
2385  }
2386 
2387  return ref;
2388 }
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI DestroyWindow(_In_ HWND)
Definition: send.c:47
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
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
#define InterlockedDecrement
Definition: armddk.h:52
BOOL WINAPI DestroyMenu(_In_ HMENU)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
unsigned int UINT
Definition: ndis.h:50
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ 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 }
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define debugstr_w
Definition: kernel32.h:32
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
static void update_layout(FileDialogImpl *This)
Definition: itemdlg.c:1642
#define S_OK
Definition: intsafe.h:59
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static void update_control_text(FileDialogImpl *This)
Definition: itemdlg.c:1935

◆ 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
#define debugstr_guid
Definition: kernel32.h:35
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define debugstr_w
Definition: kernel32.h:32
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577

◆ 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 }
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
static BOOL set_file_name(FileDialogImpl *This, LPCWSTR str)
Definition: itemdlg.c:387
#define debugstr_w
Definition: kernel32.h:32
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define debugstr_w
Definition: kernel32.h:32
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
static void update_layout(FileDialogImpl *This)
Definition: itemdlg.c:1642
#define S_OK
Definition: intsafe.h:59
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static void update_control_text(FileDialogImpl *This)
Definition: itemdlg.c:1935

◆ 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 }
#define max(a, b)
Definition: svc.c:63
#define E_FAIL
Definition: ddrawi.h:102
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define min(a, b)
Definition: monoChain.cc:55

◆ 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 }
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
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
#define E_INVALIDARG
Definition: ddrawi.h:101
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ 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 }
#define FIXME(fmt,...)
Definition: debug.h:110
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define FIXME(fmt,...)
Definition: debug.h:110
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
Definition: string.c:1089
#define debugstr_w
Definition: kernel32.h:32
static FileDialogImpl * impl_from_IFileDialog2(IFileDialog2 *iface)
Definition: itemdlg.c:2279
#define TRACE(s)
Definition: solgame.cpp:4
static void update_layout(FileDialogImpl *This)
Definition: itemdlg.c:1642
#define S_OK
Definition: intsafe.h:59
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static void update_control_text(FileDialogImpl *This)
Definition: itemdlg.c:1935

◆ 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 }
DECLSPEC_HIDDEN HINSTANCE COMDLG32_hInstance
Definition: cdlg32.c:42