ReactOS 0.4.15-dev-6703-g6528ab8
dialog.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "msi.h"
#include "msidefs.h"
#include "ocidl.h"
#include "olectl.h"
#include "richedit.h"
#include "commctrl.h"
#include "winreg.h"
#include "shlwapi.h"
#include "shellapi.h"
#include "wine/debug.h"
#include "msipriv.h"
#include "msiserver.h"
#include "resource.h"
Include dependency graph for dialog.c:

Go to the source code of this file.

Classes

struct  msi_control_tag
 
struct  msi_font_tag
 
struct  msi_dialog_tag
 
struct  subscriber
 
struct  control_handler
 
struct  radio_button_group_descr
 
struct  msi_selection_tree_info
 
struct  dialog_control
 
struct  msi_text_info
 
struct  msi_scrolltext_info
 
struct  msi_streamin_info
 
struct  msi_combobox_info
 
struct  msi_mask_group
 
struct  msi_maskedit_info
 
struct  msi_pathedit_info
 
struct  msi_listbox_info
 
struct  listview_param
 
struct  control_event
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define WM_MSI_DIALOG_CREATE   (WM_USER+0x100)
 
#define WM_MSI_DIALOG_DESTROY   (WM_USER+0x101)
 
#define USER_INSTALLSTATE_ALL   0x1000
 
#define MAX_NUM_DIGITS   11
 
#define MASK_MAX_GROUPS   20
 

Typedefs

typedef struct msi_control_tag msi_control
 
typedef UINT(* msi_handler) (msi_dialog *, msi_control *, WPARAM)
 
typedef void(* msi_update) (msi_dialog *, msi_control *)
 
typedef UINT(* control_event_handler) (msi_dialog *, const WCHAR *, const WCHAR *)
 
typedef UINT(* event_handler) (msi_dialog *, const WCHAR *)
 
typedef struct msi_font_tag msi_font
 
typedef UINT(* msi_dialog_control_func) (msi_dialog *dialog, MSIRECORD *rec)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static LPWSTR msi_get_window_text (HWND hwnd)
 
static INT msi_dialog_scale_unit (msi_dialog *dialog, INT val)
 
static msi_controlmsi_dialog_find_control (msi_dialog *dialog, LPCWSTR name)
 
static msi_controlmsi_dialog_find_control_by_type (msi_dialog *dialog, LPCWSTR type)
 
static msi_controlmsi_dialog_find_control_by_hwnd (msi_dialog *dialog, HWND hwnd)
 
static LPWSTR msi_get_deformatted_field (MSIPACKAGE *package, MSIRECORD *rec, int field)
 
static LPWSTR msi_dialog_dup_property (msi_dialog *dialog, LPCWSTR property, BOOL indirect)
 
static LPWSTR msi_dialog_get_style (LPCWSTR p, LPCWSTR *rest)
 
static UINT msi_dialog_add_font (MSIRECORD *rec, LPVOID param)
 
static msi_fontmsi_dialog_find_font (msi_dialog *dialog, LPCWSTR name)
 
static UINT msi_dialog_set_font (msi_dialog *dialog, HWND hwnd, LPCWSTR name)
 
static UINT msi_dialog_build_font_list (msi_dialog *dialog)
 
static void msi_destroy_control (msi_control *t)
 
static msi_controldialog_create_window (msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, const WCHAR *szCls, const WCHAR *name, const WCHAR *text, DWORD style, HWND parent)
 
static LPWSTR msi_dialog_get_uitext (msi_dialog *dialog, LPCWSTR key)
 
static HANDLE msi_load_image (MSIDATABASE *db, LPCWSTR name, UINT type, UINT cx, UINT cy, UINT flags)
 
static HICON msi_load_icon (MSIDATABASE *db, LPCWSTR text, UINT attributes)
 
static void msi_dialog_update_controls (msi_dialog *dialog, LPCWSTR property)
 
static void msi_dialog_update_all_controls (msi_dialog *dialog)
 
static void msi_dialog_set_property (MSIPACKAGE *package, LPCWSTR property, LPCWSTR value)
 
static MSIFEATUREmsi_seltree_feature_from_item (HWND hwnd, HTREEITEM hItem)
 
static MSIFEATUREmsi_seltree_get_selected_feature (msi_control *control)
 
static void dialog_handle_event (msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec)
 
static void event_subscribe (msi_dialog *dialog, const WCHAR *event, const WCHAR *control, const WCHAR *attribute)
 
static UINT map_event (MSIRECORD *row, void *param)
 
static void dialog_map_events (msi_dialog *dialog, const WCHAR *control)
 
static msi_controlmsi_dialog_add_control (msi_dialog *dialog, MSIRECORD *rec, LPCWSTR szCls, DWORD style)
 
static void msi_text_on_settext (HWND hWnd)
 
static LRESULT WINAPI MSIText_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT msi_dialog_text_control (msi_dialog *dialog, MSIRECORD *rec)
 
static WCHARmsi_get_binary_name (MSIPACKAGE *package, MSIRECORD *rec)
 
static UINT msi_dialog_set_property_event (msi_dialog *dialog, LPCWSTR event, LPCWSTR arg)
 
static UINT msi_dialog_send_event (msi_dialog *dialog, LPCWSTR event, LPCWSTR arg)
 
static UINT msi_dialog_control_event (MSIRECORD *rec, LPVOID param)
 
static UINT msi_dialog_button_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static HBITMAP msi_load_picture (MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags)
 
static UINT msi_dialog_button_control (msi_dialog *dialog, MSIRECORD *rec)
 
static LPWSTR msi_get_checkbox_value (msi_dialog *dialog, LPCWSTR prop)
 
static UINT msi_dialog_get_checkbox_state (msi_dialog *dialog, msi_control *control)
 
static void msi_dialog_set_checkbox_state (msi_dialog *dialog, msi_control *control, UINT state)
 
static void msi_dialog_checkbox_sync_state (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_checkbox_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_checkbox_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_line_control (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIScrollText_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static DWORD CALLBACK msi_richedit_stream_in (DWORD_PTR arg, LPBYTE buffer, LONG count, LONG *pcb)
 
static void msi_scrolltext_add_text (msi_control *control, LPCWSTR text)
 
static UINT msi_dialog_scrolltext_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_bitmap_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_icon_control (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIComboBox_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT msi_combobox_add_item (MSIRECORD *rec, LPVOID param)
 
static UINT msi_combobox_add_items (struct msi_combobox_info *info, LPCWSTR property)
 
static UINT msi_dialog_set_control_condition (MSIRECORD *rec, LPVOID param)
 
static UINT msi_dialog_evaluate_control_conditions (msi_dialog *dialog)
 
static UINT msi_dialog_combobox_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static void msi_dialog_combobox_update (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_combo_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_edit_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_edit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static BOOL msi_mask_editable (WCHAR type)
 
static void msi_mask_control_change (struct msi_maskedit_info *info)
 
static VOID msi_mask_next_control (struct msi_maskedit_info *info, HWND hWnd)
 
static LRESULT WINAPI MSIMaskedEdit_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void msi_maskedit_set_text (struct msi_maskedit_info *info, LPCWSTR text)
 
static struct msi_maskedit_infomsi_dialog_parse_groups (LPCWSTR mask)
 
static void msi_maskedit_create_children (struct msi_maskedit_info *info, LPCWSTR font)
 
static UINT msi_dialog_maskedit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_progress_bar (msi_dialog *dialog, MSIRECORD *rec)
 
static WCHARget_path_property (msi_dialog *dialog, msi_control *control)
 
static void msi_dialog_update_pathedit (msi_dialog *dialog, msi_control *control)
 
static BOOL msi_dialog_verify_path (LPWSTR path)
 
static BOOL msi_dialog_onkillfocus (msi_dialog *dialog, msi_control *control)
 
static LRESULT WINAPI MSIPathEdit_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT msi_dialog_pathedit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_radiogroup_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_create_radiobutton (MSIRECORD *rec, LPVOID param)
 
static BOOL CALLBACK msi_radioground_child_enum (HWND hWnd, LPARAM lParam)
 
static LRESULT WINAPI MSIRadioGroup_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT msi_dialog_radiogroup_control (msi_dialog *dialog, MSIRECORD *rec)
 
static void msi_seltree_sync_item_state (HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem)
 
static UINT msi_seltree_popup_menu (HWND hwnd, INT x, INT y)
 
static void msi_seltree_update_feature_installstate (HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state)
 
static void msi_seltree_update_siblings_and_children_installstate (HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, INSTALLSTATE state)
 
static LRESULT msi_seltree_menu (HWND hwnd, HTREEITEM hItem)
 
static LRESULT WINAPI MSISelectionTree_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void msi_seltree_add_child_features (MSIPACKAGE *package, HWND hwnd, LPCWSTR parent, HTREEITEM hParent)
 
static void msi_seltree_create_imagelist (HWND hwnd)
 
static UINT msi_dialog_seltree_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_selection_tree (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_group_box (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIListBox_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT msi_listbox_add_item (MSIRECORD *rec, LPVOID param)
 
static UINT msi_listbox_add_items (struct msi_listbox_info *info, LPCWSTR property)
 
static UINT msi_dialog_listbox_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_list_box (msi_dialog *dialog, MSIRECORD *rec)
 
static void msi_dialog_update_directory_combo (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_directory_combo (msi_dialog *dialog, MSIRECORD *rec)
 
static void msi_dialog_update_directory_list (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_directorylist_up (msi_dialog *dialog)
 
static WCHARget_unique_folder_name (const WCHAR *root, int *ret_len)
 
static UINT msi_dialog_directorylist_new (msi_dialog *dialog)
 
static UINT msi_dialog_dirlist_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_directory_list (msi_dialog *dialog, MSIRECORD *rec)
 
static BOOL str_is_number (LPCWSTR str)
 
static void msi_dialog_vcl_add_columns (msi_dialog *dialog, msi_control *control, MSIRECORD *rec)
 
static LONGLONG msi_vcl_get_cost (msi_dialog *dialog)
 
static void msi_dialog_vcl_add_drives (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_volumecost_list (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_volsel_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static void msi_dialog_vsc_add_drives (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_volumeselect_combo (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_hyperlink_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_dialog_hyperlink (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_listview_handler (msi_dialog *dialog, msi_control *control, WPARAM param)
 
static UINT msi_listview_add_item (MSIRECORD *rec, LPVOID param)
 
static UINT msi_listview_add_items (msi_dialog *dialog, msi_control *control)
 
static UINT msi_dialog_listview (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT msi_dialog_create_controls (MSIRECORD *rec, LPVOID param)
 
static UINT msi_dialog_fill_controls (msi_dialog *dialog)
 
static UINT msi_dialog_reset (msi_dialog *dialog)
 
static INT msi_dialog_get_sans_serif_height (HWND hwnd)
 
static MSIRECORDmsi_get_dialog_record (msi_dialog *dialog)
 
static void msi_dialog_adjust_dialog_pos (msi_dialog *dialog, MSIRECORD *rec, LPRECT pos)
 
static void msi_dialog_set_tab_order (msi_dialog *dialog, LPCWSTR first)
 
static LRESULT msi_dialog_oncreate (HWND hwnd, LPCREATESTRUCTW cs)
 
static LRESULT msi_dialog_oncommand (msi_dialog *dialog, WPARAM param, HWND hwnd)
 
static LRESULT msi_dialog_onnotify (msi_dialog *dialog, LPARAM param)
 
static void dialog_setfocus (msi_dialog *dialog)
 
static LRESULT WINAPI MSIDialog_WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void process_pending_messages (HWND hdlg)
 
static UINT dialog_run_message_loop (msi_dialog *dialog)
 
static LRESULT WINAPI MSIHiddenWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static BOOL dialog_register_class (void)
 
static msi_dialogdialog_create (MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, control_event_handler event_handler)
 
static void msi_dialog_end_dialog (msi_dialog *dialog)
 
void msi_dialog_check_messages (HANDLE handle)
 
static void dialog_do_preview (msi_dialog *dialog)
 
static void free_subscriber (struct subscriber *sub)
 
static void event_cleanup_subscriptions (MSIPACKAGE *package, const WCHAR *dialog)
 
void msi_dialog_destroy (msi_dialog *dialog)
 
void msi_dialog_unregister_class (void)
 
void msi_event_cleanup_all_subscriptions (MSIPACKAGE *package)
 
static void MSI_ClosePreview (MSIOBJECTHDR *arg)
 
static MSIPREVIEWMSI_EnableUIPreview (MSIDATABASE *db)
 
UINT WINAPI MsiEnableUIPreview (MSIHANDLE hdb, MSIHANDLE *phPreview)
 
static UINT preview_event_handler (msi_dialog *dialog, const WCHAR *event, const WCHAR *argument)
 
static UINT MSI_PreviewDialogW (MSIPREVIEW *preview, LPCWSTR szDialogName)
 
UINT WINAPI MsiPreviewDialogW (MSIHANDLE hPreview, LPCWSTR szDialogName)
 
UINT WINAPI MsiPreviewDialogA (MSIHANDLE hPreview, LPCSTR szDialogName)
 
UINT WINAPI MsiPreviewBillboardW (MSIHANDLE hPreview, const WCHAR *szControlName, const WCHAR *szBillboard)
 
UINT WINAPI MsiPreviewBillboardA (MSIHANDLE hPreview, const char *szControlName, const char *szBillboard)
 
static UINT dialog_event_handler (msi_dialog *, const WCHAR *, const WCHAR *)
 
static INT event_do_dialog (MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, BOOL destroy_modeless)
 
static UINT event_end_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT pending_event_end_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_new_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT pending_event_new_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_spawn_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT pending_event_spawn_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_spawn_wait_dialog (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_do_action (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_add_local (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_remove (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_add_source (msi_dialog *dialog, const WCHAR *argument)
 
void msi_event_fire (MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
 
static UINT event_set_target_path (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_reset (msi_dialog *dialog, const WCHAR *argument)
 
INT ACTION_ShowDialog (MSIPACKAGE *package, const WCHAR *dialog)
 
INT ACTION_DialogBox (MSIPACKAGE *package, const WCHAR *dialog)
 
static UINT event_set_install_level (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_directory_list_up (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_directory_list_new (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_reinstall_mode (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_reinstall (msi_dialog *dialog, const WCHAR *argument)
 
static UINT event_validate_product_id (msi_dialog *dialog, const WCHAR *argument)
 

Variables

HINSTANCE msi_hInstance
 
static DWORD uiThreadId
 
static HWND hMsiHiddenWindow
 
static const WCHAR column_keys [][80]
 
static const struct control_handler msi_dialog_handler []
 
static const struct control_event control_events []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file dialog.c.

◆ MASK_MAX_GROUPS

#define MASK_MAX_GROUPS   20

Definition at line 1718 of file dialog.c.

◆ MAX_NUM_DIGITS

#define MAX_NUM_DIGITS   11

Definition at line 1675 of file dialog.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 23 of file dialog.c.

◆ USER_INSTALLSTATE_ALL

#define USER_INSTALLSTATE_ALL   0x1000

Definition at line 138 of file dialog.c.

◆ WM_MSI_DIALOG_CREATE

#define WM_MSI_DIALOG_CREATE   (WM_USER+0x100)

Definition at line 135 of file dialog.c.

◆ WM_MSI_DIALOG_DESTROY

#define WM_MSI_DIALOG_DESTROY   (WM_USER+0x101)

Definition at line 136 of file dialog.c.

Typedef Documentation

◆ control_event_handler

typedef UINT(* control_event_handler) (msi_dialog *, const WCHAR *, const WCHAR *)

Definition at line 56 of file dialog.c.

◆ event_handler

typedef UINT(* event_handler) (msi_dialog *, const WCHAR *)

Definition at line 57 of file dialog.c.

◆ msi_control

Definition at line 53 of file dialog.c.

◆ msi_dialog_control_func

typedef UINT(* msi_dialog_control_func) (msi_dialog *dialog, MSIRECORD *rec)

Definition at line 119 of file dialog.c.

◆ msi_font

◆ msi_handler

typedef UINT(* msi_handler) (msi_dialog *, msi_control *, WPARAM)

Definition at line 54 of file dialog.c.

◆ msi_update

typedef void(* msi_update) (msi_dialog *, msi_control *)

Definition at line 55 of file dialog.c.

Function Documentation

◆ ACTION_DialogBox()

INT ACTION_DialogBox ( MSIPACKAGE package,
const WCHAR dialog 
)

Definition at line 4565 of file dialog.c.

4566{
4567 INT r;
4568
4569 if (package->next_dialog) ERR("Already got next dialog... ignoring it\n");
4570 package->next_dialog = NULL;
4571
4572 /* Dialogs are chained through NewDialog, which sets the next_dialog member.
4573 * We fall out of the loop if we reach a modeless dialog, which immediately
4574 * returns IDOK, or an EndDialog event, which returns the value corresponding
4575 * to its argument.
4576 */
4577 r = event_do_dialog( package, dialog, NULL, TRUE );
4578 while (package->next_dialog)
4579 {
4580 WCHAR *name = package->next_dialog;
4581
4582 package->next_dialog = NULL;
4583 r = event_do_dialog( package, name, NULL, TRUE );
4584 msi_free( name );
4585 }
4586 return r;
4587}
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static INT event_do_dialog(MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, BOOL destroy_modeless)
Definition: dialog.c:4333
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static HWND dialog
Definition: gui.c:33
static void msi_free(void *mem)
Definition: msipriv.h:1159
Definition: name.c:39
LPWSTR next_dialog
Definition: msipriv.h:454
int32_t INT
Definition: typedefs.h:58
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by internal_ui_handler().

◆ ACTION_ShowDialog()

INT ACTION_ShowDialog ( MSIPACKAGE package,
const WCHAR dialog 
)

Definition at line 4537 of file dialog.c.

4538{
4539 MSIRECORD *row;
4540 INT rc;
4541
4542 if (!TABLE_Exists(package->db, L"Dialog")) return 0;
4543
4544 row = MSI_CreateRecord(0);
4545 if (!row) return -1;
4548 msiobj_release(&row->hdr);
4549
4550 if (rc == -2) rc = 0;
4551
4552 if (!rc)
4553 {
4555 if (!row) return -1;
4556 MSI_RecordSetInteger(row, 1, 2726);
4559
4560 msiobj_release(&row->hdr);
4561 }
4562 return rc;
4563}
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name) DECLSPEC_HIDDEN
Definition: table.c:960
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1914
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
#define L(x)
Definition: ntvdm.h:50
MSIDATABASE * db
Definition: msipriv.h:394

Referenced by ACTION_HandleCustomAction().

◆ dialog_create()

static msi_dialog * dialog_create ( MSIPACKAGE package,
const WCHAR name,
msi_dialog parent,
control_event_handler  event_handler 
)
static

Definition at line 4014 of file dialog.c.

4016{
4017 MSIRECORD *rec = NULL;
4019
4020 TRACE("%s\n", debugstr_w(name));
4021
4023
4024 /* allocate the structure for the dialog to use */
4026 if( !dialog )
4027 return NULL;
4028 lstrcpyW( dialog->name, name );
4029 dialog->parent = parent;
4030 dialog->package = package;
4031 dialog->event_handler = event_handler;
4032 dialog->finished = 0;
4033 list_init( &dialog->controls );
4034 list_init( &dialog->fonts );
4035
4036 /* verify that the dialog exists */
4038 if( !rec )
4039 {
4040 msi_free( dialog );
4041 return NULL;
4042 }
4043 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
4044 dialog->control_default = strdupW( MSI_RecordGetString( rec, 9 ) );
4045 dialog->control_cancel = strdupW( MSI_RecordGetString( rec, 10 ) );
4046 msiobj_release( &rec->hdr );
4047
4048 rec = MSI_CreateRecord(2);
4049 if (!rec)
4050 {
4052 return NULL;
4053 }
4054 MSI_RecordSetStringW(rec, 1, name);
4055 MSI_RecordSetStringW(rec, 2, L"Dialog created");
4057 msiobj_release(&rec->hdr);
4058
4059 return dialog;
4060}
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
static void list_init(struct list_entry *head)
Definition: list.h:51
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static MSIRECORD * msi_get_dialog_record(msi_dialog *dialog)
Definition: dialog.c:3659
static HWND hMsiHiddenWindow
Definition: dialog.c:141
UINT(* event_handler)(msi_dialog *, const WCHAR *)
Definition: dialog.c:57
static BOOL dialog_register_class(void)
Definition: dialog.c:3982
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4137
r parent
Definition: btrfs.c:3010
#define debugstr_w
Definition: kernel32.h:32
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
static void * msi_alloc_zero(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1148
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
#define TRACE(s)
Definition: solgame.cpp:4
MSIOBJECTHDR hdr
Definition: msipriv.h:151
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by event_do_dialog(), and MSI_PreviewDialogW().

◆ dialog_create_window()

static msi_control * dialog_create_window ( msi_dialog dialog,
MSIRECORD rec,
DWORD  exstyle,
const WCHAR szCls,
const WCHAR name,
const WCHAR text,
DWORD  style,
HWND  parent 
)
static

Definition at line 380 of file dialog.c.

383{
384 DWORD x, y, width, height;
385 LPWSTR font = NULL, title_font = NULL;
387 msi_control *control;
388
389 style |= WS_CHILD;
390
391 control = msi_alloc( FIELD_OFFSET( msi_control, name[lstrlenW( name ) + 1] ));
392 if (!control)
393 return NULL;
394
395 lstrcpyW( control->name, name );
396 list_add_tail( &dialog->controls, &control->entry );
397 control->handler = NULL;
398 control->update = NULL;
399 control->property = NULL;
400 control->value = NULL;
401 control->hBitmap = NULL;
402 control->hIcon = NULL;
403 control->hImageList = NULL;
404 control->hDll = NULL;
405 control->tabnext = strdupW( MSI_RecordGetString( rec, 11) );
406 control->type = strdupW( MSI_RecordGetString( rec, 3 ) );
407 control->progress_current = 0;
408 control->progress_max = 100;
409 control->progress_backwards = FALSE;
410
411 x = MSI_RecordGetInteger( rec, 4 );
412 y = MSI_RecordGetInteger( rec, 5 );
413 width = MSI_RecordGetInteger( rec, 6 );
414 height = MSI_RecordGetInteger( rec, 7 );
415
420
421 if( text )
422 {
423 deformat_string( dialog->package, text, &title_font );
424 font = msi_dialog_get_style( title_font, &title );
425 }
426
427 control->hwnd = CreateWindowExW( exstyle, szCls, title, style,
428 x, y, width, height, parent, NULL, NULL, NULL );
429
430 TRACE("Dialog %s control %s hwnd %p\n",
431 debugstr_w(dialog->name), debugstr_w(text), control->hwnd );
432
434 font ? font : dialog->default_font );
435
436 msi_free( title_font );
437 msi_free( font );
438
439 return control;
440}
Arabic default style
Definition: afstyles.h:94
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define FALSE
Definition: types.h:117
static INT msi_dialog_scale_unit(msi_dialog *dialog, INT val)
Definition: dialog.c:162
static UINT msi_dialog_set_font(msi_dialog *dialog, HWND hwnd, LPCWSTR name)
Definition: dialog.c:333
static LPWSTR msi_dialog_get_style(LPCWSTR p, LPCWSTR *rest)
Definition: dialog.c:239
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
const WCHAR * text
Definition: package.c:1799
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
Definition: mk_font.cpp:20
#define WS_CHILD
Definition: pedump.c:617
static char title[]
Definition: ps.c:92
float progress_max
Definition: dialog.c:74
HBITMAP hBitmap
Definition: dialog.c:67
BOOL progress_backwards
Definition: dialog.c:75
msi_handler handler
Definition: dialog.c:63
LPWSTR type
Definition: dialog.c:71
HMODULE hDll
Definition: dialog.c:72
msi_update update
Definition: dialog.c:64
struct list entry
Definition: dialog.c:61
LPWSTR property
Definition: dialog.c:65
float progress_current
Definition: dialog.c:73
LPWSTR tabnext
Definition: dialog.c:70
HICON hIcon
Definition: dialog.c:68
WCHAR name[1]
Definition: dialog.c:77
HIMAGELIST hImageList
Definition: dialog.c:69
LPWSTR value
Definition: dialog.c:66
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)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by msi_dialog_add_control(), and msi_dialog_create_radiobutton().

◆ dialog_do_preview()

static void dialog_do_preview ( msi_dialog dialog)
static

Definition at line 4107 of file dialog.c.

4108{
4109 TRACE("\n");
4110 dialog->attributes |= msidbDialogAttributesVisible;
4111 dialog->attributes &= ~msidbDialogAttributesModal;
4113}
static UINT dialog_run_message_loop(msi_dialog *dialog)
Definition: dialog.c:3920
@ msidbDialogAttributesVisible
Definition: msidefs.h:47

Referenced by MSI_PreviewDialogW().

◆ dialog_event_handler()

static UINT dialog_event_handler ( msi_dialog dialog,
const WCHAR event,
const WCHAR argument 
)
static

Definition at line 4644 of file dialog.c.

4645{
4646 unsigned int i;
4647
4648 TRACE("handling event %s\n", debugstr_w(event));
4649
4650 if (!event) return ERROR_SUCCESS;
4651
4652 for (i = 0; control_events[i].event; i++)
4653 {
4654 if (!wcscmp( control_events[i].event, event ))
4655 return control_events[i].handler( dialog, argument );
4656 }
4657 FIXME("unhandled event %s arg(%s)\n", debugstr_w(event), debugstr_w(argument));
4658 return ERROR_SUCCESS;
4659}
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERROR_SUCCESS
Definition: deptool.c:10
static const struct control_event control_events[]
Definition: dialog.c:4622
struct _cl_event * event
Definition: glext.h:7739
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
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by event_do_dialog().

◆ dialog_handle_event()

static void dialog_handle_event ( msi_dialog dialog,
const WCHAR control,
const WCHAR attribute,
MSIRECORD rec 
)
static

Definition at line 560 of file dialog.c.

562{
564
565 ctrl = msi_dialog_find_control( dialog, control );
566 if (!ctrl)
567 return;
568 if( !wcscmp( attribute, L"Text" ) )
569 {
570 const WCHAR *font_text, *text = NULL;
571 WCHAR *font, *text_fmt = NULL;
572
573 font_text = MSI_RecordGetString( rec , 1 );
574 font = msi_dialog_get_style( font_text, &text );
575 deformat_string( dialog->package, text, &text_fmt );
576 if (text_fmt) text = text_fmt;
577 else text = L"";
578
579 SetWindowTextW( ctrl->hwnd, text );
580
581 msi_free( font );
582 msi_free( text_fmt );
584 }
585 else if( !wcscmp( attribute, L"Progress" ) )
586 {
587 DWORD func, val1, val2, units;
588
589 func = MSI_RecordGetInteger( rec, 1 );
590 val1 = MSI_RecordGetInteger( rec, 2 );
591 val2 = MSI_RecordGetInteger( rec, 3 );
592
593 TRACE( "progress: func %lu val1 %lu val2 %lu\n", func, val1, val2 );
594
595 units = val1 / 512;
596 switch (func)
597 {
598 case 0: /* init */
599 SendMessageW( ctrl->hwnd, PBM_SETRANGE, 0, MAKELPARAM(0,100) );
600 if (val2)
601 {
602 ctrl->progress_max = units ? units : 100;
603 ctrl->progress_current = units;
604 ctrl->progress_backwards = TRUE;
605 SendMessageW( ctrl->hwnd, PBM_SETPOS, 100, 0 );
606 }
607 else
608 {
609 ctrl->progress_max = units ? units : 100;
610 ctrl->progress_current = 0;
611 ctrl->progress_backwards = FALSE;
612 SendMessageW( ctrl->hwnd, PBM_SETPOS, 0, 0 );
613 }
614 break;
615 case 1: /* action data increment */
616 if (val2) dialog->package->action_progress_increment = val1;
617 else dialog->package->action_progress_increment = 0;
618 break;
619 case 2: /* move */
620 if (ctrl->progress_backwards)
621 {
622 if (units >= ctrl->progress_current) ctrl->progress_current -= units;
623 else ctrl->progress_current = 0;
624 }
625 else
626 {
627 if (ctrl->progress_current + units < ctrl->progress_max) ctrl->progress_current += units;
628 else ctrl->progress_current = ctrl->progress_max;
629 }
630 SendMessageW( ctrl->hwnd, PBM_SETPOS, MulDiv(100, ctrl->progress_current, ctrl->progress_max), 0 );
631 break;
632 case 3: /* add */
633 ctrl->progress_max += units;
634 break;
635 default:
636 FIXME( "unknown progress message %lu\n", func );
637 break;
638 }
639 }
640 else if ( !wcscmp( attribute, L"Property" ) )
641 {
643 if (feature) msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory );
644 }
645 else if ( !wcscmp( attribute, L"SelectionPath" ) )
646 {
649 if (!path) return;
650 SetWindowTextW( ctrl->hwnd, path );
651 msi_free(path);
652 }
653 else
654 {
655 FIXME("Attribute %s not being set\n", debugstr_w(attribute));
656 return;
657 }
658}
static void msi_dialog_set_property(MSIPACKAGE *package, LPCWSTR property, LPCWSTR value)
Definition: dialog.c:527
static msi_control * msi_dialog_find_control(msi_dialog *dialog, LPCWSTR name)
Definition: dialog.c:167
static MSIFEATURE * msi_seltree_get_selected_feature(msi_control *control)
Definition: dialog.c:554
static LPWSTR msi_dialog_dup_property(msi_dialog *dialog, LPCWSTR property, BOOL indirect)
Definition: dialog.c:217
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:4069
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum func
Definition: glext.h:6028
GLfloat units
Definition: glext.h:11727
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define ctrl
Definition: input.c:1756
@ msidbControlAttributesIndirect
Definition: msidefs.h:65
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
#define PBM_SETPOS
Definition: commctrl.h:2184
#define PBM_SETRANGE
Definition: commctrl.h:2183
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by msi_event_fire().

◆ dialog_map_events()

static void dialog_map_events ( msi_dialog dialog,
const WCHAR control 
)
static

Definition at line 702 of file dialog.c.

703{
704 MSIQUERY *view;
706 {
707 dialog,
708 control
709 };
710
711 if (!MSI_OpenQuery( dialog->package->db, &view,
712 L"SELECT * FROM `EventMapping` WHERE `Dialog_` = '%s' AND `Control_` = '%s'",
713 dialog->name, control ))
714 {
716 msiobj_release( &view->hdr );
717 }
718}
static UINT map_event(MSIRECORD *row, void *param)
Definition: dialog.c:692
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:163
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...) DECLSPEC_HIDDEN
Definition: msiquery.c:138
const WCHAR * control
Definition: dialog.c:689

Referenced by msi_dialog_add_control(), and msi_dialog_line_control().

◆ dialog_register_class()

static BOOL dialog_register_class ( void  )
static

Definition at line 3982 of file dialog.c.

3983{
3984 WNDCLASSW cls;
3985
3986 ZeroMemory( &cls, sizeof cls );
3988 cls.hInstance = NULL;
3991 cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
3992 cls.lpszMenuName = NULL;
3993 cls.lpszClassName = L"MsiDialogCloseClass";
3994
3995 if( !RegisterClassW( &cls ) )
3996 return FALSE;
3997
3999 cls.lpszClassName = L"MsiHiddenWindow";
4000
4001 if( !RegisterClassW( &cls ) )
4002 return FALSE;
4003
4005
4006 hMsiHiddenWindow = CreateWindowW( L"MsiHiddenWindow", NULL, WS_OVERLAPPED,
4007 0, 0, 100, 100, NULL, NULL, NULL, NULL );
4008 if( !hMsiHiddenWindow )
4009 return FALSE;
4010
4011 return TRUE;
4012}
static LRESULT WINAPI MSIHiddenWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3964
static DWORD uiThreadId
Definition: dialog.c:140
static LRESULT WINAPI MSIDialog_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3860
#define WS_OVERLAPPED
Definition: pedump.c:615
LPCWSTR lpszClassName
Definition: winuser.h:3175
LPCWSTR lpszMenuName
Definition: winuser.h:3174
HBRUSH hbrBackground
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3171
HINSTANCE hInstance
Definition: winuser.h:3170
WNDPROC lpfnWndProc
Definition: winuser.h:3167
HCURSOR hCursor
Definition: winuser.h:3172
#define ZeroMemory
Definition: winbase.h:1700
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:682
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define IDI_APPLICATION
Definition: winuser.h:699
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4306
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
#define COLOR_3DFACE
Definition: winuser.h:923

Referenced by dialog_create().

◆ dialog_run_message_loop()

static UINT dialog_run_message_loop ( msi_dialog dialog)
static

Definition at line 3920 of file dialog.c.

3921{
3922 DWORD style;
3923 HWND hwnd, parent;
3924
3927
3928 /* create the dialog window, don't show it yet */
3930 if( dialog->attributes & msidbDialogAttributesVisible )
3931 style |= WS_VISIBLE;
3932
3933 if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
3935
3936 parent = dialog->parent ? dialog->parent->hwnd : 0;
3937
3938 hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style,
3940 parent, NULL, NULL, dialog );
3941 if( !hwnd )
3942 {
3943 ERR("Failed to create dialog %s\n", debugstr_w( dialog->name ));
3944 return ERROR_FUNCTION_FAILED;
3945 }
3946
3948 /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
3949
3950 if( dialog->attributes & msidbDialogAttributesModal )
3951 {
3952 while( !dialog->finished )
3953 {
3956 }
3957 }
3958 else
3959 return ERROR_IO_PENDING;
3960
3961 return ERROR_SUCCESS;
3962}
#define ERROR_IO_PENDING
Definition: dderror.h:15
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3908
#define WM_MSI_DIALOG_CREATE
Definition: dialog.c:135
#define INFINITE
Definition: serial.h:102
@ msidbDialogAttributesModal
Definition: msidefs.h:48
@ msidbDialogAttributesMinimize
Definition: msidefs.h:49
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_MINIMIZEBOX
Definition: pedump.c:631
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define QS_ALLINPUT
Definition: winuser.h:897
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define SW_SHOW
Definition: winuser.h:769

Referenced by dialog_do_preview(), event_do_dialog(), and MSIHiddenWindowProc().

◆ dialog_setfocus()

static void dialog_setfocus ( msi_dialog dialog)
static

Definition at line 3850 of file dialog.c.

3851{
3852 HWND hwnd = dialog->hWndFocus;
3853
3856 SetFocus( hwnd );
3857 dialog->hWndFocus = hwnd;
3858}
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)
HWND WINAPI SetFocus(_In_opt_ HWND)

Referenced by MSIDialog_WndProc().

◆ event_add_local()

static UINT event_add_local ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4452 of file dialog.c.

4453{
4455
4456 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4457 {
4458 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4459 {
4460 if (feature->ActionRequest != INSTALLSTATE_LOCAL)
4461 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4463 }
4464 }
4465 return ERROR_SUCCESS;
4466}
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
uint32_t entry
Definition: isohybrid.c:63
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2100
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

◆ event_add_source()

static UINT event_add_source ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4484 of file dialog.c.

4485{
4487
4488 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4489 {
4490 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4491 {
4492 if (feature->ActionRequest != INSTALLSTATE_SOURCE)
4493 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4495 }
4496 }
4497 return ERROR_SUCCESS;
4498}
@ INSTALLSTATE_SOURCE
Definition: msi.h:47

◆ event_cleanup_subscriptions()

static void event_cleanup_subscriptions ( MSIPACKAGE package,
const WCHAR dialog 
)
static

Definition at line 4123 of file dialog.c.

4124{
4125 struct list *item, *next;
4126
4128 {
4129 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4130
4131 if (wcscmp( sub->dialog->name, dialog )) continue;
4132 list_remove( &sub->entry );
4133 free_subscriber( sub );
4134 }
4135}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4115
static ATOM item
Definition: dde.c:856
static unsigned __int64 next
Definition: rand_nt.c:6
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
WCHAR name[1]
Definition: dialog.c:107
struct list entry
Definition: dialog.c:112
msi_dialog * dialog
Definition: dialog.c:113
struct list subscriptions
Definition: msipriv.h:461
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by event_end_dialog(), and msi_dialog_destroy().

◆ event_directory_list_new()

static UINT event_directory_list_new ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4602 of file dialog.c.

4603{
4605}
static UINT msi_dialog_directorylist_new(msi_dialog *dialog)
Definition: dialog.c:2989

◆ event_directory_list_up()

static UINT event_directory_list_up ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4597 of file dialog.c.

4598{
4600}
static UINT msi_dialog_directorylist_up(msi_dialog *dialog)
Definition: dialog.c:2933

◆ event_do_action()

static UINT event_do_action ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4446 of file dialog.c.

4447{
4448 ACTION_PerformAction(dialog->package, argument);
4449 return ERROR_SUCCESS;
4450}
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610

◆ event_do_dialog()

static INT event_do_dialog ( MSIPACKAGE package,
const WCHAR name,
msi_dialog parent,
BOOL  destroy_modeless 
)
static

Definition at line 4333 of file dialog.c.

4334{
4336 UINT r;
4337 INT retval;
4338
4339 /* create a new dialog */
4341 if (dialog)
4342 {
4343 /* kill the current modeless dialog */
4344 if (destroy_modeless && package->dialog)
4345 {
4346 msi_dialog_destroy( package->dialog );
4347 package->dialog = NULL;
4348 }
4349
4350 /* modeless dialogs return an error message */
4352 if (r == ERROR_SUCCESS)
4353 {
4354 retval = dialog->retval;
4356 return retval;
4357 }
4358 else
4359 {
4360 package->dialog = dialog;
4361 return IDOK;
4362 }
4363 }
4364 else return 0;
4365}
static UINT dialog_event_handler(msi_dialog *, const WCHAR *, const WCHAR *)
Definition: dialog.c:4644
static msi_dialog * dialog_create(MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, control_event_handler event_handler)
Definition: dialog.c:4014
unsigned int UINT
Definition: ndis.h:50
msi_dialog * dialog
Definition: msipriv.h:453
#define IDOK
Definition: winuser.h:824

Referenced by ACTION_DialogBox(), and event_spawn_dialog().

◆ event_end_dialog()

static UINT event_end_dialog ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4368 of file dialog.c.

4369{
4370 if (!wcscmp( argument, L"Exit" ))
4371 dialog->retval = IDCANCEL;
4372 else if (!wcscmp( argument, L"Retry" ))
4373 dialog->retval = IDRETRY;
4374 else if (!wcscmp( argument, L"Ignore" ))
4375 dialog->retval = IDOK;
4376 else if (!wcscmp( argument, L"Return" ))
4377 dialog->retval = 0;
4378 else
4379 {
4380 ERR("Unknown argument string %s\n", debugstr_w(argument));
4381 dialog->retval = IDABORT;
4382 }
4383 event_cleanup_subscriptions( dialog->package, dialog->name );
4385 return ERROR_SUCCESS;
4386}
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4123
static void msi_dialog_end_dialog(msi_dialog *dialog)
Definition: dialog.c:4062
#define IDCANCEL
Definition: winuser.h:825
#define IDABORT
Definition: winuser.h:826
#define IDRETRY
Definition: winuser.h:827

Referenced by pending_event_end_dialog().

◆ event_new_dialog()

static UINT event_new_dialog ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4397 of file dialog.c.

4398{
4399 /* store the name of the next dialog, and signal this one to end */
4400 dialog->package->next_dialog = strdupW( argument );
4403 return ERROR_SUCCESS;
4404}
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4190

Referenced by pending_event_new_dialog().

◆ event_reinstall()

static UINT event_reinstall ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4612 of file dialog.c.

4613{
4614 return msi_set_property( dialog->package->db, L"REINSTALL", argument, -1 );
4615}

◆ event_reinstall_mode()

static UINT event_reinstall_mode ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4607 of file dialog.c.

4608{
4609 return msi_set_property( dialog->package->db, L"REINSTALLMODE", argument, -1 );
4610}

◆ event_remove()

static UINT event_remove ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4468 of file dialog.c.

4469{
4471
4472 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4473 {
4474 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4475 {
4476 if (feature->ActionRequest != INSTALLSTATE_ABSENT)
4477 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4479 }
4480 }
4481 return ERROR_SUCCESS;
4482}
@ INSTALLSTATE_ABSENT
Definition: msi.h:45

◆ event_reset()

static UINT event_reset ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4531 of file dialog.c.

4532{
4534 return ERROR_SUCCESS;
4535}
static UINT msi_dialog_reset(msi_dialog *dialog)
Definition: dialog.c:3621

◆ event_set_install_level()

static UINT event_set_install_level ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4589 of file dialog.c.

4590{
4591 int level = wcstol( argument, NULL, 10 );
4592
4593 TRACE("setting install level to %d\n", level);
4594 return MSI_SetInstallLevel( dialog->package, level );
4595}
UINT MSI_SetInstallLevel(MSIPACKAGE *package, int iInstallLevel)
Definition: install.c:1572
GLint level
Definition: gl.h:1546
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

◆ event_set_target_path()

static UINT event_set_target_path ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4513 of file dialog.c.

4514{
4515 WCHAR *path = msi_dup_property( dialog->package->db, argument );
4516 MSIRECORD *rec = MSI_CreateRecord( 1 );
4518
4519 MSI_RecordSetStringW( rec, 1, path );
4520 msi_event_fire( dialog->package, L"SelectionPath", rec );
4521 if (path)
4522 {
4523 /* failure to set the path halts the executing of control events */
4524 r = MSI_SetTargetPathW( dialog->package, argument, path );
4525 msi_free( path );
4526 }
4527 msi_free( &rec->hdr );
4528 return r;
4529}
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4500
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2283

◆ event_spawn_dialog()

static UINT event_spawn_dialog ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4415 of file dialog.c.

4416{
4417 INT r;
4418 /* don't destroy a modeless dialogs that might be our parent */
4419 r = event_do_dialog( dialog->package, argument, dialog, FALSE );
4420 if (r != 0)
4421 {
4422 dialog->retval = r;
4424 }
4425 else
4427
4428 return ERROR_SUCCESS;
4429}
static void msi_dialog_update_all_controls(msi_dialog *dialog)
Definition: dialog.c:516

Referenced by pending_event_spawn_dialog().

◆ event_spawn_wait_dialog()

static UINT event_spawn_wait_dialog ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4440 of file dialog.c.

4441{
4442 FIXME("doing nothing\n");
4443 return ERROR_SUCCESS;
4444}

◆ event_subscribe()

static void event_subscribe ( msi_dialog dialog,
const WCHAR event,
const WCHAR control,
const WCHAR attribute 
)
static

Definition at line 660 of file dialog.c.

661{
662 struct subscriber *sub;
663
664 TRACE("dialog %s event %s control %s attribute %s\n", debugstr_w(dialog->name), debugstr_w(event),
666
667 LIST_FOR_EACH_ENTRY( sub, &dialog->package->subscriptions, struct subscriber, entry )
668 {
669 if (sub->dialog == dialog &&
670 !wcsicmp( sub->event, event ) &&
671 !wcsicmp( sub->control, control ) &&
672 !wcsicmp( sub->attribute, attribute ))
673 {
674 TRACE("already subscribed\n");
675 return;
676 };
677 }
678 if (!(sub = msi_alloc( sizeof(*sub) ))) return;
679 sub->dialog = dialog;
680 sub->event = strdupW( event );
681 sub->control = strdupW( control );
682 sub->attribute = strdupW( attribute );
683 list_add_tail( &dialog->package->subscriptions, &sub->entry );
684}
#define wcsicmp
Definition: compat.h:15
WCHAR * event
Definition: dialog.c:114
WCHAR * attribute
Definition: dialog.c:116
WCHAR * control
Definition: dialog.c:115

Referenced by map_event(), msi_dialog_progress_bar(), msi_dialog_selection_tree(), and msi_dialog_text_control().

◆ event_validate_product_id()

static UINT event_validate_product_id ( msi_dialog dialog,
const WCHAR argument 
)
static

Definition at line 4617 of file dialog.c.

4618{
4619 return msi_validate_product_id( dialog->package );
4620}
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7148

◆ free_subscriber()

static void free_subscriber ( struct subscriber sub)
static

Definition at line 4115 of file dialog.c.

4116{
4117 msi_free( sub->event );
4118 msi_free( sub->control );
4119 msi_free( sub->attribute );
4120 msi_free( sub );
4121}

Referenced by event_cleanup_subscriptions(), and msi_event_cleanup_all_subscriptions().

◆ get_path_property()

static WCHAR * get_path_property ( msi_dialog dialog,
msi_control control 
)
static

Definition at line 2089 of file dialog.c.

2090{
2091 WCHAR *prop, *path;
2093 if (!(prop = msi_dialog_dup_property( dialog, control->property, indirect ))) return NULL;
2095 msi_free( prop );
2096 return path;
2097}
DWORD attributes
Definition: dialog.c:76

Referenced by msi_dialog_directorylist_new(), msi_dialog_update_directory_combo(), msi_dialog_update_directory_list(), and msi_dialog_update_pathedit().

◆ get_unique_folder_name()

static WCHAR * get_unique_folder_name ( const WCHAR root,
int ret_len 
)
static

Definition at line 2961 of file dialog.c.

2962{
2963 WCHAR newfolder[MAX_PATH], *path, *ptr;
2964 int len, count = 2;
2965
2966 len = LoadStringW( msi_hInstance, IDS_NEWFOLDER, newfolder, ARRAY_SIZE(newfolder) );
2967 len += lstrlenW(root) + 1;
2968 if (!(path = msi_alloc( (len + 4) * sizeof(WCHAR) ))) return NULL;
2969 lstrcpyW( path, root );
2970 lstrcatW( path, newfolder );
2971
2972 for (;;)
2973 {
2975 if (count > 99)
2976 {
2977 msi_free( path );
2978 return NULL;
2979 }
2980 swprintf( path, len + 4, L"%s%s %u", root, newfolder, count++ );
2981 }
2982
2983 ptr = wcsrchr( path, '\\' ) + 1;
2984 *ret_len = lstrlenW(ptr);
2985 memmove( path, ptr, *ret_len * sizeof(WCHAR) );
2986 return path;
2987}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define wcsrchr
Definition: compat.h:16
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
HINSTANCE msi_hInstance
Definition: msi_main.c:51
#define swprintf
Definition: precomp.h:40
#define IDS_NEWFOLDER
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static PVOID ptr
Definition: dispmode.c:27
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:79
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by msi_dialog_directorylist_new().

◆ map_event()

static UINT map_event ( MSIRECORD row,
void param 
)
static

Definition at line 692 of file dialog.c.

693{
694 struct dialog_control *dc = param;
695 const WCHAR *event = MSI_RecordGetString( row, 3 );
696 const WCHAR *attribute = MSI_RecordGetString( row, 4 );
697
698 event_subscribe( dc->dialog, event, dc->control, attribute );
699 return ERROR_SUCCESS;
700}
static void event_subscribe(msi_dialog *dialog, const WCHAR *event, const WCHAR *control, const WCHAR *attribute)
Definition: dialog.c:660
GLfloat param
Definition: glext.h:5796
static const WCHAR dc[]

Referenced by dialog_map_events().

◆ MSI_ClosePreview()

static void MSI_ClosePreview ( MSIOBJECTHDR arg)
static

Definition at line 4202 of file dialog.c.

4203{
4205 msiobj_release( &preview->package->hdr );
4206}
static previewinfo preview
Definition: print.c:56

Referenced by MSI_EnableUIPreview().

◆ msi_combobox_add_item()

static UINT msi_combobox_add_item ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 1452 of file dialog.c.

1453{
1454 struct msi_combobox_info *info = param;
1456 int pos;
1457
1458 value = MSI_RecordGetString( rec, 3 );
1459 text = MSI_RecordGetString( rec, 4 );
1460
1461 info->items[info->addpos_items] = strdupW( value );
1462
1463 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
1464 SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
1465 info->addpos_items++;
1466
1467 return ERROR_SUCCESS;
1468}
Definition: pdh_main.c:94
#define CB_SETITEMDATA
Definition: winuser.h:1956
#define CB_ADDSTRING
Definition: winuser.h:1926

Referenced by msi_combobox_add_items().

◆ msi_combobox_add_items()

static UINT msi_combobox_add_items ( struct msi_combobox_info info,
LPCWSTR  property 
)
static

Definition at line 1470 of file dialog.c.

1471{
1472 MSIQUERY *view;
1473 DWORD count;
1474 UINT r;
1475
1476 r = MSI_OpenQuery( info->dialog->package->db, &view,
1477 L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
1478 if (r != ERROR_SUCCESS)
1479 return r;
1480
1481 /* just get the number of records */
1482 count = 0;
1484 if (r != ERROR_SUCCESS)
1485 {
1486 msiobj_release( &view->hdr );
1487 return r;
1488 }
1489 info->num_items = count;
1490 info->items = msi_alloc( sizeof(*info->items) * count );
1491
1493 msiobj_release( &view->hdr );
1494 return r;
1495}
static UINT msi_combobox_add_item(MSIRECORD *rec, LPVOID param)
Definition: dialog.c:1452

Referenced by msi_dialog_combo_control().

◆ msi_destroy_control()

static void msi_destroy_control ( msi_control t)
static

Definition at line 361 of file dialog.c.

362{
363 list_remove( &t->entry );
364 /* leave dialog->hwnd - destroying parent destroys child windows */
365 msi_free( t->property );
366 msi_free( t->value );
367 if( t->hBitmap )
368 DeleteObject( t->hBitmap );
369 if( t->hIcon )
370 DestroyIcon( t->hIcon );
371 if ( t->hImageList )
372 ImageList_Destroy( t->hImageList );
373 msi_free( t->tabnext );
374 msi_free( t->type );
375 if (t->hDll)
376 FreeLibrary( t->hDll );
377 msi_free( t );
378}
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
#define FreeLibrary(x)
Definition: compat.h:748
pKey DeleteObject()
GLdouble GLdouble t
Definition: gl.h:2047
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022

Referenced by msi_dialog_destroy().

◆ msi_dialog_add_control()

static msi_control * msi_dialog_add_control ( msi_dialog dialog,
MSIRECORD rec,
LPCWSTR  szCls,
DWORD  style 
)
static

Definition at line 721 of file dialog.c.

723{
724 DWORD attributes;
725 const WCHAR *text = NULL, *name, *control_type;
726 DWORD exstyle = 0;
727
728 name = MSI_RecordGetString( rec, 2 );
730 attributes = MSI_RecordGetInteger( rec, 8 );
731 if (wcscmp( control_type, L"ScrollableText" )) text = MSI_RecordGetString( rec, 10 );
732
733 TRACE( "%s, %s, %#lx, %s, %#lx\n", debugstr_w(szCls), debugstr_w(name), attributes, debugstr_w(text), style );
734
735 if( attributes & msidbControlAttributesVisible )
736 style |= WS_VISIBLE;
737 if( ~attributes & msidbControlAttributesEnabled )
739 if( attributes & msidbControlAttributesSunken )
740 exstyle |= WS_EX_CLIENTEDGE;
741
743
744 return dialog_create_window( dialog, rec, exstyle, szCls, name, text, style, dialog->hwnd );
745}
static void dialog_map_events(msi_dialog *dialog, const WCHAR *control)
Definition: dialog.c:702
static msi_control * dialog_create_window(msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, const WCHAR *szCls, const WCHAR *name, const WCHAR *text, DWORD style, HWND parent)
Definition: dialog.c:380
static const char * control_type(DWORD dwControlType)
Definition: mixer.c:110
@ msidbControlAttributesSunken
Definition: msidefs.h:64
@ msidbControlAttributesEnabled
Definition: msidefs.h:63
@ msidbControlAttributesVisible
Definition: msidefs.h:62
#define WS_DISABLED
Definition: pedump.c:621
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

Referenced by msi_dialog_bitmap_control(), msi_dialog_button_control(), msi_dialog_checkbox_control(), msi_dialog_combo_control(), msi_dialog_directory_combo(), msi_dialog_directory_list(), msi_dialog_edit_control(), msi_dialog_group_box(), msi_dialog_hyperlink(), msi_dialog_icon_control(), msi_dialog_list_box(), msi_dialog_listview(), msi_dialog_maskedit_control(), msi_dialog_pathedit_control(), msi_dialog_progress_bar(), msi_dialog_radiogroup_control(), msi_dialog_scrolltext_control(), msi_dialog_selection_tree(), msi_dialog_text_control(), msi_dialog_volumecost_list(), and msi_dialog_volumeselect_combo().

◆ msi_dialog_add_font()

static UINT msi_dialog_add_font ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 276 of file dialog.c.

277{
279 msi_font *font;
281 LOGFONTW lf;
282 INT style;
283 HDC hdc;
284
285 /* create a font and add it to the list */
286 name = MSI_RecordGetString( rec, 1 );
288 lstrcpyW( font->name, name );
289 list_add_head( &dialog->fonts, &font->entry );
290
291 font->color = MSI_RecordGetInteger( rec, 4 );
292
293 memset( &lf, 0, sizeof lf );
294 face = MSI_RecordGetString( rec, 2 );
295 lf.lfHeight = MSI_RecordGetInteger( rec, 3 );
296 style = MSI_RecordGetInteger( rec, 5 );
298 lf.lfWeight = FW_BOLD;
300 lf.lfItalic = TRUE;
302 lf.lfUnderline = TRUE;
304 lf.lfStrikeOut = TRUE;
306
307 /* adjust the height */
308 hdc = GetDC( dialog->hwnd );
309 if (hdc)
310 {
312 ReleaseDC( dialog->hwnd, hdc );
313 }
314
315 font->hfont = CreateFontIndirectW( &lf );
316
317 TRACE("Adding font style %s\n", debugstr_w(font->name) );
318
319 return ERROR_SUCCESS;
320}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define LF_FACESIZE
Definition: dimm.idl:39
WORD face[3]
Definition: mesh.c:4747
#define lstrcpynW
Definition: compat.h:738
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
@ msidbTextStyleStyleBitsBold
Definition: msidefs.h:108
@ msidbTextStyleStyleBitsUnderline
Definition: msidefs.h:110
@ msidbTextStyleStyleBitsItalic
Definition: msidefs.h:109
@ msidbTextStyleStyleBitsStrike
Definition: msidefs.h:111
#define memset(x, y, z)
Definition: compat.h:39
BYTE lfStrikeOut
Definition: dimm.idl:66
BYTE lfItalic
Definition: dimm.idl:64
LONG lfHeight
Definition: dimm.idl:59
LONG lfWeight
Definition: dimm.idl:63
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define FW_BOLD
Definition: wingdi.h:378
#define LOGPIXELSY
Definition: wingdi.h:719
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by msi_dialog_build_font_list().

◆ msi_dialog_adjust_dialog_pos()

static void msi_dialog_adjust_dialog_pos ( msi_dialog dialog,
MSIRECORD rec,
LPRECT  pos 
)
static

Definition at line 3673 of file dialog.c.

3674{
3675 UINT xres, yres;
3676 POINT center;
3677 SIZE sz;
3678 LONG style;
3679
3680 center.x = MSI_RecordGetInteger( rec, 2 );
3681 center.y = MSI_RecordGetInteger( rec, 3 );
3682
3683 sz.cx = MSI_RecordGetInteger( rec, 4 );
3684 sz.cy = MSI_RecordGetInteger( rec, 5 );
3685
3686 sz.cx = msi_dialog_scale_unit( dialog, sz.cx );
3687 sz.cy = msi_dialog_scale_unit( dialog, sz.cy );
3688
3689 xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
3690 yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
3691
3692 center.x = MulDiv( center.x, xres, 100 );
3693 center.y = MulDiv( center.y, yres, 100 );
3694
3695 /* turn the client pos into the window rectangle */
3696 if (dialog->package->center_x && dialog->package->center_y)
3697 {
3698 pos->left = dialog->package->center_x - sz.cx / 2.0;
3699 pos->right = pos->left + sz.cx;
3700 pos->top = dialog->package->center_y - sz.cy / 2.0;
3701 pos->bottom = pos->top + sz.cy;
3702 }
3703 else
3704 {
3705 pos->left = center.x - sz.cx/2;
3706 pos->right = pos->left + sz.cx;
3707 pos->top = center.y - sz.cy/2;
3708 pos->bottom = pos->top + sz.cy;
3709
3710 /* save the center */
3711 dialog->package->center_x = center.x;
3712 dialog->package->center_y = center.y;
3713 }
3714
3715 dialog->size.cx = sz.cx;
3716 dialog->size.cy = sz.cy;
3717
3718 TRACE("%s\n", wine_dbgstr_rect(pos));
3719
3722}
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2305
long LONG
Definition: pedump.c:60
static __inline const char * wine_dbgstr_rect(const RECT *rect)
Definition: debug.h:219
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define GetWindowLongPtrW
Definition: winuser.h:4819
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:846

Referenced by msi_dialog_oncreate().

◆ msi_dialog_bitmap_control()

static UINT msi_dialog_bitmap_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1355 of file dialog.c.

1356{
1357 UINT cx, cy, flags, style, attributes;
1358 msi_control *control;
1359 LPWSTR name;
1360
1363
1364 attributes = MSI_RecordGetInteger( rec, 8 );
1365 if( attributes & msidbControlAttributesFixedSize )
1366 {
1369 }
1370
1371 control = msi_dialog_add_control( dialog, rec, L"Static", style );
1372 cx = MSI_RecordGetInteger( rec, 6 );
1373 cy = MSI_RecordGetInteger( rec, 7 );
1376
1377 name = msi_get_binary_name( dialog->package, rec );
1378 control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags );
1379 if( control->hBitmap )
1380 SendMessageW( control->hwnd, STM_SETIMAGE,
1381 IMAGE_BITMAP, (LPARAM) control->hBitmap );
1382 else
1383 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1384
1385 msi_free( name );
1386
1387 return ERROR_SUCCESS;
1388}
static msi_control * msi_dialog_add_control(msi_dialog *dialog, MSIRECORD *rec, LPCWSTR szCls, DWORD style)
Definition: dialog.c:721
static WCHAR * msi_get_binary_name(MSIPACKAGE *package, MSIRECORD *rec)
Definition: dialog.c:844
static HBITMAP msi_load_picture(MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags)
Definition: dialog.c:954
GLbitfield flags
Definition: glext.h:7161
@ msidbControlAttributesFixedSize
Definition: msidefs.h:98
#define WS_GROUP
Definition: pedump.c:633
#define SS_BITMAP
Definition: pedump.c:704
#define SS_LEFT
Definition: pedump.c:692
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_LOADFROMFILE
Definition: winuser.h:1086
#define SS_CENTERIMAGE
Definition: winuser.h:339
#define STM_SETIMAGE
Definition: winuser.h:2083
#define LR_DEFAULTSIZE
Definition: winuser.h:1088

◆ msi_dialog_build_font_list()

static UINT msi_dialog_build_font_list ( msi_dialog dialog)
static

Definition at line 345 of file dialog.c.

346{
347 MSIQUERY *view;
348 UINT r;
349
350 TRACE("dialog %p\n", dialog );
351
352 r = MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `TextStyle`" );
353 if( r != ERROR_SUCCESS )
354 return r;
355
357 msiobj_release( &view->hdr );
358 return r;
359}
static UINT msi_dialog_add_font(MSIRECORD *rec, LPVOID param)
Definition: dialog.c:276

Referenced by msi_dialog_oncreate().

◆ msi_dialog_button_control()

static UINT msi_dialog_button_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1018 of file dialog.c.

1019{
1020 msi_control *control;
1021 UINT attributes, style, cx = 0, cy = 0, flags = 0;
1022 WCHAR *name = NULL;
1023
1024 TRACE("%p %p\n", dialog, rec);
1025
1026 style = WS_TABSTOP;
1027 attributes = MSI_RecordGetInteger( rec, 8 );
1028 if (attributes & msidbControlAttributesIcon) style |= BS_ICON;
1029 else if (attributes & msidbControlAttributesBitmap)
1030 {
1031 style |= BS_BITMAP;
1033 else
1034 {
1037 }
1038 }
1039
1040 control = msi_dialog_add_control( dialog, rec, L"BUTTON", style );
1041 if (!control)
1042 return ERROR_FUNCTION_FAILED;
1043
1045
1046 if (attributes & msidbControlAttributesIcon)
1047 {
1048 name = msi_get_binary_name( dialog->package, rec );
1049 control->hIcon = msi_load_icon( dialog->package->db, name, attributes );
1050 if (control->hIcon)
1051 {
1052 SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM) control->hIcon );
1053 }
1054 else ERR("Failed to load icon %s\n", debugstr_w(name));
1055 }
1056 else if (attributes & msidbControlAttributesBitmap)
1057 {
1058 name = msi_get_binary_name( dialog->package, rec );
1059 control->hBitmap = msi_load_picture( dialog->package->db, name, cx, cy, flags );
1060 if (control->hBitmap)
1061 {
1062 SendMessageW( control->hwnd, BM_SETIMAGE, IMAGE_BITMAP, (LPARAM) control->hBitmap );
1063 }
1064 else ERR("Failed to load bitmap %s\n", debugstr_w(name));
1065 }
1066
1067 msi_free( name );
1068 return ERROR_SUCCESS;
1069}
static HICON msi_load_icon(MSIDATABASE *db, LPCWSTR text, UINT attributes)
Definition: dialog.c:482
static UINT msi_dialog_button_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:923
@ msidbControlAttributesBitmap
Definition: msidefs.h:96
@ msidbControlAttributesIcon
Definition: msidefs.h:97
#define WS_TABSTOP
Definition: pedump.c:634
#define BS_BITMAP
Definition: winuser.h:258
#define IMAGE_ICON
Definition: winuser.h:212
#define BS_ICON
Definition: winuser.h:264
#define BM_SETIMAGE
Definition: winuser.h:1912

◆ msi_dialog_button_handler()

static UINT msi_dialog_button_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 923 of file dialog.c.

924{
925 MSIQUERY *view;
926 UINT r;
927
928 if (HIWORD(param) != BN_CLICKED)
929 return ERROR_SUCCESS;
930
931 r = MSI_OpenQuery( dialog->package->db, &view,
932 L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`",
933 dialog->name, control->name );
934 if (r != ERROR_SUCCESS)
935 {
936 ERR("query failed\n");
937 return ERROR_SUCCESS;
938 }
940 msiobj_release( &view->hdr );
941
942 /* dialog control events must be processed last regardless of ordering */
943 if (dialog->pending_event)
944 {
945 r = dialog->pending_event( dialog, dialog->pending_argument );
946
947 msi_free( dialog->pending_argument );
948 dialog->pending_event = NULL;
949 dialog->pending_argument = NULL;
950 }
951 return r;
952}
static UINT msi_dialog_control_event(MSIRECORD *rec, LPVOID param)
Definition: dialog.c:903
#define HIWORD(l)
Definition: typedefs.h:247
#define BN_CLICKED
Definition: winuser.h:1915

Referenced by msi_dialog_button_control(), msi_dialog_checkbox_handler(), msi_dialog_radiogroup_handler(), and MSIScrollText_WndProc().

◆ msi_dialog_check_messages()

void msi_dialog_check_messages ( HANDLE  handle)

Definition at line 4069 of file dialog.c.

4070{
4071 DWORD r;
4072
4073 /* in threads other than the UI thread, block */
4075 {
4076 if (!handle) return;
4078 {
4079 MSG msg;
4080 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
4081 {
4084 }
4085 }
4086 return;
4087 }
4088
4089 /* there are two choices for the UI thread */
4090 while (1)
4091 {
4093
4094 if( !handle )
4095 break;
4096
4097 /*
4098 * block here until somebody creates a new dialog or
4099 * the handle we're waiting on becomes ready
4100 */
4102 if( r == WAIT_OBJECT_0 )
4103 break;
4104 }
4105}
#define msg(x)
Definition: auth_time.c:54
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:406
BOOL WINAPI TranslateMessage(_In_ const MSG *)
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1186
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by ACTION_FinishCustomActions(), dialog_handle_event(), ITERATE_Actions(), msi_ui_progress(), register_dll(), wait_process_handle(), and wait_thread_handle().

◆ msi_dialog_checkbox_control()

static UINT msi_dialog_checkbox_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1153 of file dialog.c.

1154{
1155 msi_control *control;
1156 LPCWSTR prop;
1157
1158 TRACE("%p %p\n", dialog, rec);
1159
1160 control = msi_dialog_add_control( dialog, rec, L"BUTTON", BS_CHECKBOX | BS_MULTILINE | WS_TABSTOP );
1163 prop = MSI_RecordGetString( rec, 9 );
1164 if (prop)
1165 {
1166 control->property = strdupW( prop );
1167 control->value = msi_get_checkbox_value( dialog, prop );
1168 TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value));
1169 }
1171 return ERROR_SUCCESS;
1172}
static UINT msi_dialog_checkbox_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:1136
static void msi_dialog_checkbox_sync_state(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:1130
static LPWSTR msi_get_checkbox_value(msi_dialog *dialog, LPCWSTR prop)
Definition: dialog.c:1071
#define BS_CHECKBOX
Definition: pedump.c:653
#define BS_MULTILINE
Definition: winuser.h:267

◆ msi_dialog_checkbox_handler()

static UINT msi_dialog_checkbox_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 1136 of file dialog.c.

1137{
1138 UINT state;
1139
1140 if (HIWORD(param) != BN_CLICKED)
1141 return ERROR_SUCCESS;
1142
1143 TRACE("clicked checkbox %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1144
1146 state = state ? 0 : 1;
1149
1150 return msi_dialog_button_handler( dialog, control, param );
1151}
static int state
Definition: maze.c:121
static void msi_dialog_set_checkbox_state(msi_dialog *dialog, msi_control *control, UINT state)
Definition: dialog.c:1110
static UINT msi_dialog_get_checkbox_state(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:1101

Referenced by msi_dialog_checkbox_control().

◆ msi_dialog_checkbox_sync_state()

static void msi_dialog_checkbox_sync_state ( msi_dialog dialog,
msi_control control 
)
static

Definition at line 1130 of file dialog.c.

1131{
1134}
#define BST_UNCHECKED
Definition: winuser.h:199
#define BM_SETCHECK
Definition: winuser.h:1911
#define BST_CHECKED
Definition: winuser.h:197

Referenced by msi_dialog_checkbox_control(), and msi_dialog_checkbox_handler().

◆ msi_dialog_combo_control()

static UINT msi_dialog_combo_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1608 of file dialog.c.

1609{
1610 struct msi_combobox_info *info;
1611 msi_control *control;
1612 DWORD attributes, style;
1613 LPCWSTR prop;
1614
1615 info = msi_alloc( sizeof *info );
1616 if (!info)
1617 return ERROR_FUNCTION_FAILED;
1618
1620 attributes = MSI_RecordGetInteger( rec, 8 );
1621 if ( ~attributes & msidbControlAttributesSorted)
1622 style |= CBS_SORT;
1623 if ( attributes & msidbControlAttributesComboList)
1625 else
1627
1628 control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
1629 if (!control)
1630 {
1631 msi_free( info );
1632 return ERROR_FUNCTION_FAILED;
1633 }
1634
1637
1638 prop = MSI_RecordGetString( rec, 9 );
1639 control->property = msi_dialog_dup_property( dialog, prop, FALSE );
1640
1641 /* subclass */
1642 info->dialog = dialog;
1643 info->hwnd = control->hwnd;
1644 info->items = NULL;
1645 info->addpos_items = 0;
1646 info->oldproc = (WNDPROC)SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
1648 SetPropW( control->hwnd, L"MSIDATA", info );
1649
1650 if (control->property)
1652
1654
1655 return ERROR_SUCCESS;
1656}
static void msi_dialog_combobox_update(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:1573
static UINT msi_dialog_combobox_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:1548
static UINT msi_combobox_add_items(struct msi_combobox_info *info, LPCWSTR property)
Definition: dialog.c:1470
static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1424
@ msidbControlAttributesSorted
Definition: msidefs.h:91
@ msidbControlAttributesComboList
Definition: msidefs.h:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WC_COMBOBOXW
Definition: commctrl.h:4717
#define GWLP_WNDPROC
Definition: treelist.c:66
#define CBS_AUTOHSCROLL
Definition: winuser.h:281
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
BOOL WINAPI SetPropW(_In_ HWND, _In_ LPCWSTR, _In_opt_ HANDLE)
#define CBS_DROPDOWN
Definition: winuser.h:283
#define CBS_SORT
Definition: winuser.h:292
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
#define SetWindowLongPtrW
Definition: winuser.h:5336

◆ msi_dialog_combobox_handler()

static UINT msi_dialog_combobox_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 1548 of file dialog.c.

1549{
1550 struct msi_combobox_info *info;
1551 int index;
1552 LPWSTR value;
1553
1555 return ERROR_SUCCESS;
1556
1557 info = GetPropW( control->hwnd, L"MSIDATA" );
1558 index = SendMessageW( control->hwnd, CB_GETCURSEL, 0, 0 );
1559 if (index == CB_ERR)
1560 value = msi_get_window_text( control->hwnd );
1561 else
1562 value = (LPWSTR) SendMessageW( control->hwnd, CB_GETITEMDATA, index, 0 );
1563
1564 msi_dialog_set_property( info->dialog->package, control->property, value );
1566
1567 if (index == CB_ERR)
1568 msi_free( value );
1569
1570 return ERROR_SUCCESS;
1571}
#define index(s, c)
Definition: various.h:29
static UINT msi_dialog_evaluate_control_conditions(msi_dialog *dialog)
Definition: dialog.c:1530
static LPWSTR msi_get_window_text(HWND hwnd)
Definition: dialog.c:143
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2425
#define CBN_SELCHANGE
Definition: winuser.h:1969
#define CB_GETITEMDATA
Definition: winuser.h:1940
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define CB_GETCURSEL
Definition: winuser.h:1933
#define CBN_EDITCHANGE
Definition: winuser.h:1965

Referenced by msi_dialog_combo_control().

◆ msi_dialog_combobox_update()

static void msi_dialog_combobox_update ( msi_dialog dialog,
msi_control control 
)
static

Definition at line 1573 of file dialog.c.

1574{
1575 struct msi_combobox_info *info;
1576 LPWSTR value, tmp;
1577 DWORD j;
1578
1579 info = GetPropW( control->hwnd, L"MSIDATA" );
1580
1581 value = msi_dup_property( dialog->package->db, control->property );
1582 if (!value)
1583 {
1584 SendMessageW( control->hwnd, CB_SETCURSEL, -1, 0 );
1585 return;
1586 }
1587
1588 for (j = 0; j < info->num_items; j++)
1589 {
1590 tmp = (LPWSTR) SendMessageW( control->hwnd, CB_GETITEMDATA, j, 0 );
1591 if (!wcscmp( value, tmp ))
1592 break;
1593 }
1594
1595 if (j < info->num_items)
1596 {
1597 SendMessageW( control->hwnd, CB_SETCURSEL, j, 0 );
1598 }
1599 else
1600 {
1601 SendMessageW( control->hwnd, CB_SETCURSEL, -1, 0 );
1602 SetWindowTextW( control->hwnd, value );
1603 }
1604
1605 msi_free(value);
1606}
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 GLint GLint j
Definition: glfuncs.h:250
#define CB_SETCURSEL
Definition: winuser.h:1951

Referenced by msi_dialog_combo_control().

◆ msi_dialog_control_event()

static UINT msi_dialog_control_event ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 903 of file dialog.c.

904{
907 UINT r;
908
909 condition = MSI_RecordGetString( rec, 5 );
912 {
913 event = MSI_RecordGetString( rec, 3 );
914 arg = MSI_RecordGetString( rec, 4 );
915 if (event[0] == '[')
917 else
919 }
920 return ERROR_SUCCESS;
921}
static UINT msi_dialog_send_event(msi_dialog *dialog, LPCWSTR event, LPCWSTR arg)
Definition: dialog.c:886
static UINT msi_dialog_set_property_event(msi_dialog *dialog, LPCWSTR event, LPCWSTR arg)
Definition: dialog.c:864
GLenum condition
Definition: glext.h:9255
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *, LPCWSTR) DECLSPEC_HIDDEN
@ MSICONDITION_NONE
Definition: msiquery.h:28
@ MSICONDITION_TRUE
Definition: msiquery.h:27
void * arg
Definition: msvc.h:10

Referenced by msi_dialog_button_handler().

◆ msi_dialog_create_controls()

static UINT msi_dialog_create_controls ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 3581 of file dialog.c.

3582{
3585 UINT i;
3586
3587 /* find and call the function that can create this type of control */
3589 for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ )
3591 break;
3594 else
3595 ERR("no handler for element type %s\n", debugstr_w(control_type));
3596
3597 return ERROR_SUCCESS;
3598}
static const struct control_handler msi_dialog_handler[]
Definition: dialog.c:3555

Referenced by msi_dialog_fill_controls().

◆ msi_dialog_create_radiobutton()

static UINT msi_dialog_create_radiobutton ( MSIRECORD rec,
LPVOID  param 
)
static

Definition at line 2226 of file dialog.c.

2227{
2229 msi_dialog *dialog = group->dialog;
2230 msi_control *control;
2231 LPCWSTR prop, text, name;
2233
2234 name = MSI_RecordGetString( rec, 3 );
2235 text = MSI_RecordGetString( rec, 8 );
2236
2237 control = dialog_create_window( dialog, rec, 0, L"BUTTON", name, text, style,
2238 group->parent->hwnd );
2239 if (!control)
2240 return ERROR_FUNCTION_FAILED;
2242
2243 if (group->propval && !wcscmp( control->name, group->propval ))
2245
2246 prop = MSI_RecordGetString( rec, 1 );
2247 if( prop )
2248 control->property = strdupW( prop );
2249
2250 return ERROR_SUCCESS;
2251}
static UINT msi_dialog_radiogroup_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:2213
GLboolean GLuint group
Definition: glext.h:11120
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660

Referenced by msi_dialog_radiogroup_control().

◆ msi_dialog_destroy()

void msi_dialog_destroy ( msi_dialog dialog)

Definition at line 4137 of file dialog.c.

4138{
4139 msi_font *font, *next;
4140
4142 {
4144 return;
4145 }
4146
4147 if( dialog->hwnd )
4148 {
4149 ShowWindow( dialog->hwnd, SW_HIDE );
4150 DestroyWindow( dialog->hwnd );
4151 }
4152
4153 /* unsubscribe events */
4154 event_cleanup_subscriptions( dialog->package, dialog->name );
4155
4156 /* destroy the list of controls */
4157 while( !list_empty( &dialog->controls ) )
4158 {
4159 msi_control *t;
4160
4161 t = LIST_ENTRY( list_head( &dialog->controls ),
4162 msi_control, entry );
4164 }
4165
4166 /* destroy the list of fonts */
4168 {
4169 list_remove( &font->entry );
4170 DeleteObject( font->hfont );
4171 msi_free( font );
4172 }
4173 msi_free( dialog->default_font );
4174
4175 msi_free( dialog->control_default );
4176 msi_free( dialog->control_cancel );
4177 dialog->package = NULL;
4178 msi_free( dialog );
4179}
static int list_empty(struct list_entry *head)
Definition: list.h:58
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:136
static void msi_destroy_control(msi_control *t)
Definition: dialog.c:361
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
Definition: list.h:15
#define SW_HIDE
Definition: winuser.h:762
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by dialog_create(), event_do_dialog(), MSI_FreePackage(), MSI_PreviewDialogW(), and MSIHiddenWindowProc().

◆ msi_dialog_directory_combo()

static UINT msi_dialog_directory_combo ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2864 of file dialog.c.

2865{
2866 msi_control *control;
2867 LPCWSTR prop;
2868 DWORD style;
2869
2870 /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
2873 control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
2874 if (!control)
2875 return ERROR_FUNCTION_FAILED;
2876
2877 control->attributes = MSI_RecordGetInteger( rec, 8 );
2878 prop = MSI_RecordGetString( rec, 9 );
2879 control->property = msi_dialog_dup_property( dialog, prop, FALSE );
2880
2882
2883 return ERROR_SUCCESS;
2884}
static void msi_dialog_update_directory_combo(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:2847
#define WS_VSCROLL
Definition: pedump.c:627
#define CBS_HASSTRINGS
Definition: winuser.h:285

◆ msi_dialog_directory_list()

static UINT msi_dialog_directory_list ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3079 of file dialog.c.

3080{
3081 msi_control *control;
3082 LPCWSTR prop;
3083 DWORD style;
3084
3088 control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
3089 if (!control)
3090 return ERROR_FUNCTION_FAILED;
3091
3092 control->attributes = MSI_RecordGetInteger( rec, 8 );
3094 prop = MSI_RecordGetString( rec, 9 );
3095 control->property = msi_dialog_dup_property( dialog, prop, FALSE );
3096
3097 /* double click to activate an item in the list */
3100
3102
3103 return ERROR_SUCCESS;
3104}
static UINT msi_dialog_dirlist_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:3014
static void msi_dialog_update_directory_list(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:2888
#define WS_BORDER
Definition: pedump.c:625
#define LVS_SINGLESEL
Definition: commctrl.h:2266
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2270
#define WC_LISTVIEWW
Definition: commctrl.h:2257
#define LVS_EX_TWOCLICKACTIVATE
Definition: commctrl.h:2736
#define LVS_SORTASCENDING
Definition: commctrl.h:2268
#define LVS_EDITLABELS
Definition: commctrl.h:2273
#define LVS_AUTOARRANGE
Definition: commctrl.h:2272
#define LVS_LIST
Definition: commctrl.h:2264
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2724

◆ msi_dialog_directorylist_new()

static UINT msi_dialog_directorylist_new ( msi_dialog dialog)
static

Definition at line 2989 of file dialog.c.

2990{
2991 msi_control *control;
2992 WCHAR *path;
2993 LVITEMW item;
2994 int index;
2995
2996 control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" );
2997
2998 if (!(path = get_path_property( dialog, control ))) return ERROR_OUTOFMEMORY;
2999
3000 item.mask = LVIF_TEXT;
3001 item.iItem = 0;
3002 item.iSubItem = 0;
3003 item.pszText = get_unique_folder_name( path, &item.cchTextMax );
3004
3005 index = SendMessageW( control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&item );
3006 SendMessageW( control->hwnd, LVM_ENSUREVISIBLE, index, 0 );
3007 SendMessageW( control->hwnd, LVM_EDITLABELW, index, -1 );
3008
3009 msi_free( path );
3010 msi_free( item.pszText );
3011 return ERROR_SUCCESS;
3012}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static WCHAR * get_unique_folder_name(const WCHAR *root, int *ret_len)
Definition: dialog.c:2961
static WCHAR * get_path_property(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:2089
static msi_control * msi_dialog_find_control_by_type(msi_dialog *dialog, LPCWSTR type)
Definition: dialog.c:181
#define LVM_EDITLABELW
Definition: commctrl.h:2536
#define LVM_ENSUREVISIBLE
Definition: commctrl.h:2518
#define LVIF_TEXT
Definition: commctrl.h:2309
#define LVM_INSERTITEMW
Definition: commctrl.h:2404

Referenced by event_directory_list_new().

◆ msi_dialog_directorylist_up()

static UINT msi_dialog_directorylist_up ( msi_dialog dialog)
static

Definition at line 2933 of file dialog.c.

2934{
2935 msi_control *control;
2936 LPWSTR prop, path, ptr;
2937 BOOL indirect;
2938
2939 control = msi_dialog_find_control_by_type( dialog, L"DirectoryList" );
2941 prop = msi_dialog_dup_property( dialog, control->property, indirect );
2943
2944 /* strip off the last directory */
2946 if (ptr != path) *(ptr - 1) = '\0';
2948
2949 msi_dialog_set_property( dialog->package, prop, path );
2950
2954
2955 msi_free( path );
2956 msi_free( prop );
2957
2958 return ERROR_SUCCESS;
2959}
static void msi_dialog_update_pathedit(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:2099
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:294
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
const GLvoid * indirect
Definition: glext.h:7408

Referenced by event_directory_list_up().

◆ msi_dialog_dirlist_handler()

static UINT msi_dialog_dirlist_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 3014 of file dialog.c.

3015{
3016 NMHDR *nmhdr = (NMHDR *)param;
3017 WCHAR text[MAX_PATH], *new_path, *path, *prop;
3018 BOOL indirect;
3019
3020 switch (nmhdr->code)
3021 {
3022 case LVN_ENDLABELEDITW:
3023 {
3025 if (!info->item.pszText) return ERROR_SUCCESS;
3026 lstrcpynW( text, info->item.pszText, ARRAY_SIZE(text) );
3027 text[ARRAY_SIZE(text) - 1] = 0;
3028 break;
3029 }
3030 case LVN_ITEMACTIVATE:
3031 {
3032 LVITEMW item;
3033 int index = SendMessageW( control->hwnd, LVM_GETNEXTITEM, -1, LVNI_SELECTED );
3034 if (index < 0)
3035 {
3036 ERR("no list-view item selected\n");
3037 return ERROR_FUNCTION_FAILED;
3038 }
3039
3040 item.iSubItem = 0;
3041 item.pszText = text;
3042 item.cchTextMax = MAX_PATH;
3044 text[ARRAY_SIZE(text) - 1] = 0;
3045 break;
3046 }
3047 default:
3048 return ERROR_SUCCESS;
3049 }
3050
3052 prop = msi_dialog_dup_property( dialog, control->property, indirect );
3054
3055 if (!(new_path = msi_alloc( (lstrlenW(path) + lstrlenW(text) + 2) * sizeof(WCHAR) )))
3056 {
3057 msi_free( prop );
3058 msi_free( path );
3059 return ERROR_OUTOFMEMORY;
3060 }
3061 lstrcpyW( new_path, path );
3062 lstrcatW( new_path, text );
3063 if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
3064 lstrcatW( new_path, L"\\" );
3065
3066 msi_dialog_set_property( dialog->package, prop, new_path );
3067
3071
3072 msi_free( prop );
3073 msi_free( path );
3074 msi_free( new_path );
3075
3076 return ERROR_SUCCESS;
3077}
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
#define LVNI_SELECTED
Definition: commctrl.h:2424
#define LVM_GETNEXTITEM
Definition: commctrl.h:2433
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3138
#define LVM_GETITEMTEXTW
Definition: commctrl.h:2680
#define LVN_ITEMACTIVATE
Definition: commctrl.h:3147
UINT code
Definition: winuser.h:3149

Referenced by msi_dialog_directory_list().

◆ msi_dialog_dup_property()

◆ msi_dialog_edit_control()

static UINT msi_dialog_edit_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1677 of file dialog.c.

1678{
1679 msi_control *control;
1680 LPCWSTR prop, text;
1681 LPWSTR val, begin, end;
1683 DWORD limit;
1684
1685 control = msi_dialog_add_control( dialog, rec, L"Edit",
1688
1689 text = MSI_RecordGetString( rec, 10 );
1690 if ( text )
1691 {
1692 begin = wcschr( text, '{' );
1693 end = wcschr( text, '}' );
1694
1695 if ( begin && end && end > begin &&
1696 begin[0] >= '0' && begin[0] <= '9' &&
1698 {
1699 lstrcpynW( num, begin + 1, end - begin );
1700 limit = wcstol( num, NULL, 10 );
1701
1702 SendMessageW( control->hwnd, EM_SETLIMITTEXT, limit, 0 );
1703 }
1704 }
1705
1706 prop = MSI_RecordGetString( rec, 9 );
1707 if( prop )
1708 control->property = strdupW( prop );
1709
1710 val = msi_dup_property( dialog->package->db, control->property );
1711 SetWindowTextW( control->hwnd, val );
1712 msi_free( val );
1713 return ERROR_SUCCESS;
1714}
#define wcschr
Definition: compat.h:17
#define MAX_NUM_DIGITS
Definition: dialog.c:1675
static UINT msi_dialog_edit_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:1658
GLuint GLuint end
Definition: gl.h:1545
GLint limit
Definition: glext.h:10326
GLuint GLfloat * val
Definition: glext.h:7180
GLuint GLuint num
Definition: glext.h:9618
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define EM_SETLIMITTEXT
Definition: winuser.h:2001
static clock_t begin
Definition: xmllint.c:458

◆ msi_dialog_edit_handler()

static UINT msi_dialog_edit_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 1658 of file dialog.c.

1659{
1660 LPWSTR buf;
1661
1662 if (HIWORD(param) != EN_CHANGE)
1663 return ERROR_SUCCESS;
1664
1665 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1666
1667 buf = msi_get_window_text( control->hwnd );
1668 msi_dialog_set_property( dialog->package, control->property, buf );
1669 msi_free( buf );
1670
1671 return ERROR_SUCCESS;
1672}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define EN_CHANGE
Definition: winuser.h:2012

Referenced by msi_dialog_edit_control().

◆ msi_dialog_end_dialog()

static void msi_dialog_end_dialog ( msi_dialog dialog)
static

Definition at line 4062 of file dialog.c.

4063{
4064 TRACE("%p\n", dialog);
4065 dialog->finished = 1;
4066 PostMessageW(dialog->hwnd, WM_NULL, 0, 0);
4067}
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1597

Referenced by event_end_dialog(), event_new_dialog(), and event_spawn_dialog().

◆ msi_dialog_evaluate_control_conditions()

static UINT msi_dialog_evaluate_control_conditions ( msi_dialog dialog)
static

Definition at line 1530 of file dialog.c.

1531{
1532 UINT r;
1533 MSIQUERY *view;
1534 MSIPACKAGE *package = dialog->package;
1535
1536 TRACE("%p %s\n", dialog, debugstr_w(dialog->name));
1537
1538 /* query the Control table for all the elements of the control */
1539 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `ControlCondition` WHERE `Dialog_` = '%s'", dialog->name );
1540 if (r != ERROR_SUCCESS)
1541 return ERROR_SUCCESS;
1542
1544 msiobj_release( &view->hdr );
1545 return r;
1546}
static UINT msi_dialog_set_control_condition(MSIRECORD *rec, LPVOID param)
Definition: dialog.c:1497

Referenced by msi_dialog_combobox_handler(), msi_dialog_listbox_handler(), msi_dialog_oncommand(), msi_dialog_oncreate(), msi_dialog_reset(), and msi_mask_control_change().

◆ msi_dialog_fill_controls()

static UINT msi_dialog_fill_controls ( msi_dialog dialog)
static

Definition at line 3600 of file dialog.c.

3601{
3602 UINT r;
3603 MSIQUERY *view;
3604 MSIPACKAGE *package = dialog->package;
3605
3606 TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
3607
3608 /* query the Control table for all the elements of the control */
3609 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `Control` WHERE `Dialog_` = '%s'", dialog->name );
3610 if( r != ERROR_SUCCESS )
3611 {
3612 ERR("query failed for dialog %s\n", debugstr_w(dialog->name));
3614 }
3615
3617 msiobj_release( &view->hdr );
3618 return r;
3619}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static UINT msi_dialog_create_controls(MSIRECORD *rec, LPVOID param)
Definition: dialog.c:3581

Referenced by msi_dialog_oncreate().

◆ msi_dialog_find_control()

static msi_control * msi_dialog_find_control ( msi_dialog dialog,
LPCWSTR  name 
)
static

Definition at line 167 of file dialog.c.

168{
169 msi_control *control;
170
171 if( !name )
172 return NULL;
173 if( !dialog->hwnd )
174 return NULL;
175 LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
176 if( !wcscmp( control->name, name ) ) /* FIXME: case sensitive? */
177 return control;
178 return NULL;
179}

Referenced by dialog_handle_event(), msi_dialog_oncommand(), msi_dialog_set_control_condition(), and msi_dialog_set_tab_order().

◆ msi_dialog_find_control_by_hwnd()

static msi_control * msi_dialog_find_control_by_hwnd ( msi_dialog dialog,
HWND  hwnd 
)
static

Definition at line 195 of file dialog.c.

196{
197 msi_control *control;
198
199 if( !dialog->hwnd )
200 return NULL;
201 LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
202 if( hwnd == control->hwnd )
203 return control;
204 return NULL;
205}

Referenced by msi_dialog_oncommand(), and msi_dialog_onnotify().

◆ msi_dialog_find_control_by_type()

static msi_control * msi_dialog_find_control_by_type ( msi_dialog dialog,
LPCWSTR  type 
)
static

Definition at line 181 of file dialog.c.

182{
183 msi_control *control;
184
185 if( !type )
186 return NULL;
187 if( !dialog->hwnd )
188 return NULL;
189 LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
190 if( !wcscmp( control->type, type ) ) /* FIXME: case sensitive? */
191 return control;
192 return NULL;
193}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by msi_dialog_directorylist_new(), msi_dialog_directorylist_up(), msi_dialog_update_directory_combo(), msi_dialog_update_directory_list(), and msi_dialog_update_pathedit().

◆ msi_dialog_find_font()

static msi_font * msi_dialog_find_font ( msi_dialog dialog,
LPCWSTR  name 
)
static

Definition at line 322 of file dialog.c.

323{
324 msi_font *font = NULL;
325
327 if( !wcscmp( font->name, name ) ) /* FIXME: case sensitive? */
328 break;
329
330 return font;
331}

Referenced by msi_dialog_set_font(), and msi_dialog_text_control().

◆ msi_dialog_get_checkbox_state()

static UINT msi_dialog_get_checkbox_state ( msi_dialog dialog,
msi_control control 
)
static

Definition at line 1101 of file dialog.c.

1102{
1103 WCHAR state[2] = {0};
1104 DWORD sz = 2;
1105
1106 msi_get_property( dialog->package->db, control->property, state, &sz );
1107 return state[0] ? 1 : 0;
1108}
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
Definition: package.c:2250

Referenced by msi_dialog_checkbox_handler(), and msi_dialog_checkbox_sync_state().

◆ msi_dialog_get_sans_serif_height()

static INT msi_dialog_get_sans_serif_height ( HWND  hwnd)
static

Definition at line 3628 of file dialog.c.

3629{
3630 LOGFONTW lf;
3632 BOOL r;
3633 LONG height = 0;
3634 HFONT hFont, hOldFont;
3635 HDC hdc;
3636
3637 hdc = GetDC( hwnd );
3638 if (hdc)
3639 {
3640 memset( &lf, 0, sizeof lf );
3641 lf.lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
3642 lstrcpyW( lf.lfFaceName, L"MS Sans Serif" );
3644 if (hFont)
3645 {
3646 hOldFont = SelectObject( hdc, hFont );
3647 r = GetTextMetricsW( hdc, &tm );
3648 if (r)
3649 height = tm.tmHeight;
3650 SelectObject( hdc, hOldFont );
3652 }
3653 ReleaseDC( hwnd, hdc );
3654 }
3655 return height;
3656}
HFONT hFont
Definition: main.c:53
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: time.h:68
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539

Referenced by msi_dialog_oncreate().

◆ msi_dialog_get_style()

static LPWSTR msi_dialog_get_style ( LPCWSTR  p,
LPCWSTR rest 
)
static

Definition at line 239 of file dialog.c.

240{
241 LPWSTR ret;
242 LPCWSTR q, i, first;
243 DWORD len;
244
245 q = NULL;
246 *rest = p;
247 if( !p )
248 return NULL;
249
250 while ((first = wcschr( p, '{' )) && (q = wcschr( first + 1, '}' )))
251 {
252 p = first + 1;
253 if( *p != '\\' && *p != '&' )
254 return NULL;
255
256 /* little bit of sanity checking to stop us getting confused with RTF */
257 for( i=++p; i<q; i++ )
258 if( *i == '}' || *i == '\\' )
259 return NULL;
260 }
261
262 if (!q)
263 return NULL;
264
265 *rest = ++q;
266 len = q - p;
267
268 ret = msi_alloc( len*sizeof(WCHAR) );
269 if( !ret )
270 return ret;
271 memcpy( ret, p, len*sizeof(WCHAR) );
272 ret[len-1] = 0;
273 return ret;
274}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
const GLint * first
Definition: glext.h:5794
GLfloat GLfloat p
Definition: glext.h:8902
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
int ret

Referenced by dialog_create_window(), dialog_handle_event(), msi_dialog_maskedit_control(), and msi_dialog_text_control().

◆ msi_dialog_get_uitext()

static LPWSTR msi_dialog_get_uitext ( msi_dialog dialog,
LPCWSTR  key 
)
static

Definition at line 442 of file dialog.c.

443{
444 MSIRECORD *rec;
445 LPWSTR text;
446
447 rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `UIText` WHERE `Key` = '%s'", key );
448 if (!rec) return NULL;
449 text = strdupW( MSI_RecordGetString( rec, 2 ) );
450 msiobj_release( &rec->hdr );
451 return text;
452}
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:201
Definition: copy.c:22

Referenced by msi_dialog_vcl_add_columns().

◆ msi_dialog_group_box()

static UINT msi_dialog_group_box ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2685 of file dialog.c.

2686{
2687 msi_control *control;
2688 DWORD style;
2689
2691 control = msi_dialog_add_control( dialog, rec, WC_BUTTONW, style );
2692 if (!control)
2693 return ERROR_FUNCTION_FAILED;
2694
2695 return ERROR_SUCCESS;
2696}
#define BS_GROUPBOX
Definition: pedump.c:658
#define WC_BUTTONW
Definition: commctrl.h:4623

◆ msi_dialog_hyperlink()

static UINT msi_dialog_hyperlink ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3431 of file dialog.c.

3432{
3433 msi_control *control;
3435 const WCHAR *text = MSI_RecordGetString( rec, 10 );
3436 int len = lstrlenW( text );
3437 LITEM item;
3438
3439 control = msi_dialog_add_control( dialog, rec, WC_LINK, style );
3440 if (!control)
3441 return ERROR_FUNCTION_FAILED;
3442
3443 control->attributes = MSI_RecordGetInteger( rec, 8 );
3445
3447 item.iLink = 0;
3448 item.state = LIS_ENABLED;
3449 item.stateMask = LIS_ENABLED;
3450 if (len < L_MAX_URL_LENGTH) lstrcpyW( item.szUrl, text );
3451 else item.szUrl[0] = 0;
3452
3453 SendMessageW( control->hwnd, LM_SETITEM, 0, (LPARAM)&item );
3454
3455 return ERROR_SUCCESS;
3456}
static UINT msi_dialog_hyperlink_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:3386
#define L_MAX_URL_LENGTH
Definition: commctrl.h:4735
#define LM_SETITEM
Definition: commctrl.h:4773
#define WC_LINK
Definition: commctrl.h:4737
#define LIF_URL
Definition: commctrl.h:4745
#define LIF_STATE
Definition: commctrl.h:4743
#define LIF_ITEMINDEX
Definition: commctrl.h:4742
#define LIS_ENABLED
Definition: commctrl.h:4748

◆ msi_dialog_hyperlink_handler()

static UINT msi_dialog_hyperlink_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 3386 of file dialog.c.

3387{
3388 int len, len_href = ARRAY_SIZE( L"href" ) - 1;
3389 const WCHAR *p, *q;
3390 WCHAR quote = 0;
3391 LITEM item;
3392
3393 item.mask = LIF_ITEMINDEX | LIF_URL;
3394 item.iLink = 0;
3395 item.szUrl[0] = 0;
3396
3397 SendMessageW( control->hwnd, LM_GETITEM, 0, (LPARAM)&item );
3398
3399 p = item.szUrl;
3400 while (*p && *p != '<') p++;
3401 if (!*p++) return ERROR_SUCCESS;
3402 if (towupper( *p++ ) != 'A' || !iswspace( *p++ )) return ERROR_SUCCESS;
3403 while (*p && iswspace( *p )) p++;
3404
3405 len = lstrlenW( p );
3406 if (len > len_href && !wcsnicmp( p, L"href", len_href ))
3407 {
3408 p += len_href;
3409 while (*p && iswspace( *p )) p++;
3410 if (!*p || *p++ != '=') return ERROR_SUCCESS;
3411 while (*p && iswspace( *p )) p++;
3412
3413 if (*p == '\"' || *p == '\'') quote = *p++;
3414 q = p;
3415 if (quote)
3416 {
3417 while (*q && *q != quote) q++;
3418 if (*q != quote) return ERROR_SUCCESS;
3419 }
3420 else
3421 {
3422 while (*q && *q != '>' && !iswspace( *q )) q++;
3423 if (!*q) return ERROR_SUCCESS;
3424 }
3425 item.szUrl[q - item.szUrl] = 0;
3426 ShellExecuteW( NULL, L"open", p, NULL, NULL, SW_SHOWNORMAL );
3427 }
3428 return ERROR_SUCCESS;
3429}
static const WCHAR quote[]
Definition: reg.c:40
#define wcsnicmp
Definition: compat.h:14
#define iswspace(_c)
Definition: ctype.h:669
#define LM_GETITEM
Definition: commctrl.h:4774
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2379
#define towupper(c)
Definition: wctype.h:99
#define SW_SHOWNORMAL
Definition: winuser.h:764

Referenced by msi_dialog_hyperlink().

◆ msi_dialog_icon_control()

static UINT msi_dialog_icon_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1390 of file dialog.c.

1391{
1392 msi_control *control;
1393 DWORD attributes;
1394 LPWSTR name;
1395
1396 TRACE("\n");
1397
1398 control = msi_dialog_add_control( dialog, rec, L"Static",
1400
1401 attributes = MSI_RecordGetInteger( rec, 8 );
1402 name = msi_get_binary_name( dialog->package, rec );
1403 control->hIcon = msi_load_icon( dialog->package->db, name, attributes );
1404 if( control->hIcon )
1405 SendMessageW( control->hwnd, STM_SETICON, (WPARAM) control->hIcon, 0 );
1406 else
1407 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1408 msi_free( name );
1409 return ERROR_SUCCESS;
1410}
#define SS_ICON
Definition: pedump.c:695
UINT_PTR WPARAM
Definition: windef.h:207
#define STM_SETICON
Definition: winuser.h:2082

◆ msi_dialog_line_control()

static UINT msi_dialog_line_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1174 of file dialog.c.

1175{
1176 DWORD attributes;
1177 LPCWSTR name;
1178 DWORD style, exstyle = 0;
1179 DWORD x, y, width, height;
1180 msi_control *control;
1181
1182 TRACE("%p %p\n", dialog, rec);
1183
1185
1186 name = MSI_RecordGetString( rec, 2 );
1187 attributes = MSI_RecordGetInteger( rec, 8 );
1188
1189 if( attributes & msidbControlAttributesVisible )
1190 style |= WS_VISIBLE;
1191 if( ~attributes & msidbControlAttributesEnabled )
1192 style |= WS_DISABLED;
1193 if( attributes & msidbControlAttributesSunken )
1194 exstyle |= WS_EX_CLIENTEDGE;
1195
1197
1198 control = msi_alloc( FIELD_OFFSET(msi_control, name[lstrlenW( name ) + 1] ));
1199 if (!control)
1200 return ERROR_OUTOFMEMORY;
1201
1202 lstrcpyW( control->name, name );
1203 list_add_head( &dialog->controls, &control->entry );
1204 control->handler = NULL;
1205 control->property = NULL;
1206 control->value = NULL;
1207 control->hBitmap = NULL;
1208 control->hIcon = NULL;
1209 control->hDll = NULL;
1210 control->tabnext = strdupW( MSI_RecordGetString( rec, 11) );
1211 control->type = strdupW( MSI_RecordGetString( rec, 3 ) );
1212 control->progress_current = 0;
1213 control->progress_max = 100;
1214 control->progress_backwards = FALSE;
1215
1216 x = MSI_RecordGetInteger( rec, 4 );
1217 y = MSI_RecordGetInteger( rec, 5 );
1218 width = MSI_RecordGetInteger( rec, 6 );
1219
1223 height = 2; /* line is exactly 2 units in height */
1224
1225 control->hwnd = CreateWindowExW( exstyle, L"Static", NULL, style,
1226 x, y, width, height, dialog->hwnd, NULL, NULL, NULL );
1227
1228 TRACE("Dialog %s control %s hwnd %p\n",
1229 debugstr_w(dialog->name), debugstr_w(name), control->hwnd );
1230
1231 return ERROR_SUCCESS;
1232}
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define SS_SUNKEN
Definition: winuser.h:358

◆ msi_dialog_list_box()

static UINT msi_dialog_list_box ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2802 of file dialog.c.

2803{
2804 struct msi_listbox_info *info;
2805 msi_control *control;
2806 DWORD attributes, style;
2807 LPCWSTR prop;
2808
2809 info = msi_alloc( sizeof *info );
2810 if (!info)
2811 return ERROR_FUNCTION_FAILED;
2812
2814 attributes = MSI_RecordGetInteger( rec, 8 );
2815 if (~attributes & msidbControlAttributesSorted)
2816 style |= LBS_SORT;
2817
2818 control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style );
2819 if (!control)
2820 {
2821 msi_free(info);
2822 return ERROR_FUNCTION_FAILED;
2823 }
2824
2826
2827 prop = MSI_RecordGetString( rec, 9 );
2828 control->property = msi_dialog_dup_property( dialog, prop, FALSE );
2829
2830 /* subclass */
2831 info->dialog = dialog;
2832 info->hwnd = control->hwnd;
2833 info->items = NULL;
2834 info->addpos_items = 0;
2835 info->oldproc = (WNDPROC)SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
2837 SetPropW( control->hwnd, L"MSIDATA", info );
2838
2839 if ( control->property )
2840 msi_listbox_add_items( info, control->property );
2841
2842 return ERROR_SUCCESS;
2843}
static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2710
static UINT msi_listbox_add_items(struct msi_listbox_info *info, LPCWSTR property)
Definition: dialog.c:2755
static UINT msi_dialog_listbox_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:2782
#define LBS_SORT
Definition: pedump.c:679
#define LBS_NOTIFY
Definition: pedump.c:678
#define WC_LISTBOXW
Definition: commctrl.h:4711

◆ msi_dialog_listbox_handler()

static UINT msi_dialog_listbox_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 2782 of file dialog.c.

2784{
2785 struct msi_listbox_info *info;
2786 int index;
2787 LPCWSTR value;
2788
2789 if( HIWORD(param) != LBN_SELCHANGE )
2790 return ERROR_SUCCESS;
2791
2792 info = GetPropW( control->hwnd, L"MSIDATA" );
2793 index = SendMessageW( control->hwnd, LB_GETCURSEL, 0, 0 );
2794 value = (LPCWSTR) SendMessageW( control->hwnd, LB_GETITEMDATA, index, 0 );
2795
2796 msi_dialog_set_property( info->dialog->package, control->property, value );
2798
2799 return ERROR_SUCCESS;
2800}
#define LB_GETITEMDATA
Definition: winuser.h:2031
#define LBN_SELCHANGE
Definition: winuser.h:2065
#define LB_GETCURSEL
Definition: winuser.h:2029

Referenced by msi_dialog_list_box().

◆ msi_dialog_listview()

static UINT msi_dialog_listview ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3515 of file dialog.c.

3516{
3517 msi_control *control;
3518 LPCWSTR prop;
3519 DWORD style, attributes;
3520 LVCOLUMNW col;
3521 RECT rc;
3522
3525 attributes = MSI_RecordGetInteger( rec, 8 );
3526 if ( ~attributes & msidbControlAttributesSorted )
3528 control = msi_dialog_add_control( dialog, rec, WC_LISTVIEWW, style );
3529 if (!control)
3530 return ERROR_FUNCTION_FAILED;
3531
3532 prop = MSI_RecordGetString( rec, 9 );
3533 control->property = msi_dialog_dup_property( dialog, prop, FALSE );
3534
3535 control->hImageList = ImageList_Create( 16, 16, ILC_COLOR32, 0, 1);
3537
3538 col.mask = LVCF_FMT | LVCF_WIDTH;
3539 col.fmt = LVCFMT_LEFT;
3540 col.cx = 16;
3541 SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, 0, (LPARAM)&col );
3542
3543 GetClientRect( control->hwnd, &rc );
3544 col.cx = rc.right - 16;
3545 SendMessageW( control->hwnd, LVM_INSERTCOLUMNW, 0, (LPARAM)&col );
3546
3547 if (control->property)
3548 msi_listview_add_items( dialog, control );
3549
3551
3552 return ERROR_SUCCESS;
3553}
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static UINT msi_dialog_listview_handler(msi_dialog *dialog, msi_control *control, WPARAM param)
Definition: dialog.c:3466
static UINT msi_listview_add_items(msi_dialog *dialog, msi_control *control)
Definition: dialog.c:3500
#define WS_HSCROLL
Definition: pedump.c:628
#define LVSIL_SMALL
Definition: commctrl.h:2299
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2284
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2267
#define LVS_REPORT
Definition: commctrl.h:2262
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVM_SETIMAGELIST
Definition: commctrl.h:2303
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2632
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCFMT_LEFT
Definition: commctrl.h:2598
LONG right
Definition: windef.h:308
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ msi_dialog_listview_handler()

static UINT msi_dialog_listview_handler ( msi_dialog dialog,
msi_control control,
WPARAM  param 
)
static

Definition at line 3466 of file dialog.c.

3467{
3468 NMHDR *nmhdr = (NMHDR *)param;
3469
3470 FIXME("code %#x (%d)\n", nmhdr->code, nmhdr->code);
3471
3472 return ERROR_SUCCESS;
3473}

Referenced by msi_dialog_listview().

◆ msi_dialog_maskedit_control()

static UINT msi_dialog_maskedit_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1992 of file dialog.c.

1993{
1994 LPWSTR font_mask, val = NULL, font;
1995 struct msi_maskedit_info *info = NULL;
1997 msi_control *control;
1998 LPCWSTR prop, mask;
1999
2000 TRACE("\n");
2001
2002 font_mask = msi_get_deformatted_field( dialog->package, rec, 10 );
2003 font = msi_dialog_get_style( font_mask, &mask );
2004 if( !mask )
2005 {
2006 WARN("mask template is empty\n");
2007 goto end;
2008 }
2009
2011 if( !