ReactOS 0.4.17-dev-357-ga8f14ff
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  control
 
struct  font
 
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 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
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static WCHARget_window_text (HWND hwnd)
 
static INT dialog_scale_unit (msi_dialog *dialog, INT val)
 
static struct controldialog_find_control (msi_dialog *dialog, const WCHAR *name)
 
static struct controldialog_find_control_by_type (msi_dialog *dialog, const WCHAR *type)
 
static struct controldialog_find_control_by_hwnd (msi_dialog *dialog, HWND hwnd)
 
static WCHARget_deformatted_field (MSIPACKAGE *package, MSIRECORD *rec, int field)
 
static WCHARdialog_dup_property (msi_dialog *dialog, const WCHAR *property, BOOL indirect)
 
static WCHARdialog_get_style (const WCHAR *p, const WCHAR **rest)
 
static UINT dialog_add_font (MSIRECORD *rec, void *param)
 
static struct fontdialog_find_font (msi_dialog *dialog, const WCHAR *name)
 
static UINT dialog_set_font (msi_dialog *dialog, HWND hwnd, const WCHAR *name)
 
static UINT dialog_build_font_list (msi_dialog *dialog)
 
static void destroy_control (struct control *t)
 
static struct controldialog_create_window (msi_dialog *dialog, MSIRECORD *rec, DWORD exstyle, const WCHAR *szCls, const WCHAR *name, const WCHAR *text, DWORD style, HWND parent)
 
static WCHARdialog_get_uitext (msi_dialog *dialog, const WCHAR *key)
 
static HANDLE load_image (MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags)
 
static HICON load_icon (MSIDATABASE *db, const WCHAR *text, UINT attributes)
 
static void dialog_update_controls (msi_dialog *dialog, const WCHAR *property)
 
static void dialog_update_all_controls (msi_dialog *dialog)
 
static void dialog_set_property (MSIPACKAGE *package, const WCHAR *property, const WCHAR *value)
 
static MSIFEATUREseltree_feature_from_item (HWND hwnd, HTREEITEM hItem)
 
static MSIFEATUREseltree_get_selected_feature (struct 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 struct controldialog_add_control (msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style)
 
static void text_on_settext (HWND hWnd)
 
static LRESULT WINAPI MSIText_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT dialog_text_control (msi_dialog *dialog, MSIRECORD *rec)
 
static WCHARget_binary_name (MSIPACKAGE *package, MSIRECORD *rec)
 
static UINT dialog_set_property_event (msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
 
static UINT dialog_send_event (msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
 
static UINT dialog_control_event (MSIRECORD *rec, void *param)
 
static UINT dialog_button_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static HBITMAP load_picture (MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags)
 
static UINT dialog_button_control (msi_dialog *dialog, MSIRECORD *rec)
 
static WCHARget_checkbox_value (msi_dialog *dialog, const WCHAR *prop)
 
static UINT dialog_get_checkbox_state (msi_dialog *dialog, struct control *control)
 
static void dialog_set_checkbox_state (msi_dialog *dialog, struct control *control, UINT state)
 
static void dialog_checkbox_sync_state (msi_dialog *dialog, struct control *control)
 
static UINT dialog_checkbox_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_checkbox_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_line_control (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIScrollText_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static DWORD CALLBACK richedit_stream_in (DWORD_PTR arg, BYTE *buffer, LONG count, LONG *pcb)
 
static void scrolltext_add_text (struct control *control, const WCHAR *text)
 
static UINT dialog_scrolltext_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_bitmap_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_icon_control (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIComboBox_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT combobox_add_item (MSIRECORD *rec, void *param)
 
static UINT combobox_add_items (struct msi_combobox_info *info, const WCHAR *property)
 
static UINT dialog_set_control_condition (MSIRECORD *rec, void *param)
 
static UINT dialog_evaluate_control_conditions (msi_dialog *dialog)
 
static UINT dialog_combobox_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static void dialog_combobox_update (msi_dialog *dialog, struct control *control)
 
static UINT dialog_combo_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_edit_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_edit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static BOOL mask_editable (WCHAR type)
 
static void mask_control_change (struct msi_maskedit_info *info)
 
static void 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 maskedit_set_text (struct msi_maskedit_info *info, const WCHAR *text)
 
static struct msi_maskedit_infodialog_parse_groups (const WCHAR *mask)
 
static void maskedit_create_children (struct msi_maskedit_info *info, const WCHAR *font)
 
static UINT dialog_maskedit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_progress_bar (msi_dialog *dialog, MSIRECORD *rec)
 
static WCHARget_path_property (msi_dialog *dialog, struct control *control)
 
static void dialog_update_pathedit (msi_dialog *dialog, struct control *control)
 
static BOOL dialog_verify_path (const WCHAR *path)
 
static BOOL dialog_onkillfocus (msi_dialog *dialog, struct control *control)
 
static LRESULT WINAPI MSIPathEdit_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT dialog_pathedit_control (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_radiogroup_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_create_radiobutton (MSIRECORD *rec, void *param)
 
static BOOL CALLBACK radioground_child_enum (HWND hWnd, LPARAM lParam)
 
static LRESULT WINAPI MSIRadioGroup_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT dialog_radiogroup_control (msi_dialog *dialog, MSIRECORD *rec)
 
static void seltree_sync_item_state (HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem)
 
static UINT seltree_popup_menu (HWND hwnd, INT x, INT y)
 
static void seltree_update_feature_installstate (HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state)
 
static void seltree_update_siblings_and_children_installstate (HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, INSTALLSTATE state)
 
static LRESULT seltree_menu (HWND hwnd, HTREEITEM hItem)
 
static LRESULT WINAPI MSISelectionTree_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void seltree_add_child_features (MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent)
 
static void seltree_create_imagelist (HWND hwnd)
 
static UINT dialog_seltree_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_selection_tree (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_group_box (msi_dialog *dialog, MSIRECORD *rec)
 
static LRESULT WINAPI MSIListBox_WndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static UINT listbox_add_item (MSIRECORD *rec, void *param)
 
static UINT listbox_add_items (struct msi_listbox_info *info, const WCHAR *property)
 
static UINT dialog_listbox_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_list_box (msi_dialog *dialog, MSIRECORD *rec)
 
static void dialog_update_directory_combo (msi_dialog *dialog, struct control *control)
 
static UINT dialog_directory_combo (msi_dialog *dialog, MSIRECORD *rec)
 
static void dialog_update_directory_list (msi_dialog *dialog, struct control *control)
 
static UINT dialog_directorylist_up (msi_dialog *dialog)
 
static WCHARget_unique_folder_name (const WCHAR *root, int *ret_len)
 
static UINT dialog_directorylist_new (msi_dialog *dialog)
 
static UINT dialog_dirlist_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_directory_list (msi_dialog *dialog, MSIRECORD *rec)
 
static BOOL str_is_number (LPCWSTR str)
 
static void dialog_vcl_add_columns (msi_dialog *dialog, struct control *control, MSIRECORD *rec)
 
static LONGLONG vcl_get_cost (msi_dialog *dialog)
 
static void dialog_vcl_add_drives (msi_dialog *dialog, struct control *control)
 
static UINT dialog_volumecost_list (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_volsel_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static void dialog_vsc_add_drives (msi_dialog *dialog, struct control *control)
 
static UINT dialog_volumeselect_combo (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_hyperlink_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT dialog_hyperlink (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_listview_handler (msi_dialog *dialog, struct control *control, WPARAM param)
 
static UINT listview_add_item (MSIRECORD *rec, void *param)
 
static UINT listview_add_items (msi_dialog *dialog, struct control *control)
 
static UINT dialog_listview (msi_dialog *dialog, MSIRECORD *rec)
 
static UINT dialog_create_controls (MSIRECORD *rec, void *param)
 
static UINT dialog_fill_controls (msi_dialog *dialog)
 
static UINT dialog_reset (msi_dialog *dialog)
 
static INT dialog_get_sans_serif_height (HWND hwnd)
 
static MSIRECORDget_dialog_record (msi_dialog *dialog)
 
static void dialog_adjust_dialog_pos (msi_dialog *dialog, MSIRECORD *rec, RECT *pos)
 
static void dialog_set_tab_order (msi_dialog *dialog, const WCHAR *first)
 
static LRESULT dialog_oncreate (HWND hwnd, CREATESTRUCTW *cs)
 
static LRESULT dialog_oncommand (msi_dialog *dialog, WPARAM param, HWND hwnd)
 
static LRESULT 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, UINT(*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *))
 
static void 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 1658 of file dialog.c.

◆ MAX_NUM_DIGITS

#define MAX_NUM_DIGITS   11

Definition at line 1616 of file dialog.c.

◆ USER_INSTALLSTATE_ALL

#define USER_INSTALLSTATE_ALL   0x1000

Definition at line 129 of file dialog.c.

◆ WM_MSI_DIALOG_CREATE

#define WM_MSI_DIALOG_CREATE   (WM_USER+0x100)

Definition at line 126 of file dialog.c.

◆ WM_MSI_DIALOG_DESTROY

#define WM_MSI_DIALOG_DESTROY   (WM_USER+0x101)

Definition at line 127 of file dialog.c.

Function Documentation

◆ ACTION_DialogBox()

INT ACTION_DialogBox ( MSIPACKAGE package,
const WCHAR dialog 
)

Definition at line 4486 of file dialog.c.

4487{
4488 INT r;
4489
4490 if (package->next_dialog) ERR("Already got next dialog... ignoring it\n");
4491 package->next_dialog = NULL;
4492
4493 /* Dialogs are chained through NewDialog, which sets the next_dialog member.
4494 * We fall out of the loop if we reach a modeless dialog, which immediately
4495 * returns IDOK, or an EndDialog event, which returns the value corresponding
4496 * to its argument.
4497 */
4498 r = event_do_dialog( package, dialog, NULL, TRUE );
4499 while (package->next_dialog)
4500 {
4501 WCHAR *name = package->next_dialog;
4502
4503 package->next_dialog = NULL;
4504 r = event_do_dialog( package, name, NULL, TRUE );
4505 free( name );
4506 }
4507 return r;
4508}
#define ERR(fmt,...)
Definition: precomp.h:57
#define free
Definition: debug_ros.c:5
#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:4254
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static HWND dialog
Definition: gui.c:33
short WCHAR
Definition: pedump.c:58
Definition: name.c:39
LPWSTR next_dialog
Definition: msipriv.h:454
int32_t INT
Definition: typedefs.h:58

Referenced by internal_ui_handler().

◆ ACTION_ShowDialog()

INT ACTION_ShowDialog ( MSIPACKAGE package,
const WCHAR dialog 
)

Definition at line 4458 of file dialog.c.

4459{
4460 MSIRECORD *row;
4461 INT rc;
4462
4463 if (!TABLE_Exists(package->db, L"Dialog")) return 0;
4464
4465 row = MSI_CreateRecord(0);
4466 if (!row) return -1;
4469 msiobj_release(&row->hdr);
4470
4471 if (rc == -2) rc = 0;
4472
4473 if (!rc)
4474 {
4476 if (!row) return -1;
4477 MSI_RecordSetInteger(row, 1, 2726);
4480
4481 msiobj_release(&row->hdr);
4482 }
4483 return rc;
4484}
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
#define L(x)
Definition: resources.c:13
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name)
Definition: table.c:962
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int)
Definition: record.c:280
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
MSIDATABASE * db
Definition: msipriv.h:394

Referenced by ACTION_HandleCustomAction().

◆ combobox_add_item()

static UINT combobox_add_item ( MSIRECORD rec,
void param 
)
static

Definition at line 1389 of file dialog.c.

1390{
1391 struct msi_combobox_info *info = param;
1393 int pos;
1394
1395 value = MSI_RecordGetString( rec, 3 );
1396 text = MSI_RecordGetString( rec, 4 );
1397
1398 info->items[info->addpos_items] = wcsdup( value );
1399
1400#ifdef __REACTOS__ /* Import fix from Wine-11.6 */
1401 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)(text ? text : value) );
1402#else
1403 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
1404#endif
1405 SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
1406 info->addpos_items++;
1407
1408 return ERROR_SUCCESS;
1409}
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * text
Definition: package.c:1794
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
GLfloat param
Definition: glext.h:5796
LONG_PTR LPARAM
Definition: minwindef.h:175
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
const uint16_t * LPCWSTR
Definition: typedefs.h:57
Definition: pdh_main.c:96
#define CB_SETITEMDATA
Definition: winuser.h:1995
#define CB_ADDSTRING
Definition: winuser.h:1965
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by combobox_add_items().

◆ combobox_add_items()

static UINT combobox_add_items ( struct msi_combobox_info info,
const WCHAR property 
)
static

Definition at line 1411 of file dialog.c.

1412{
1413 MSIQUERY *view;
1414 DWORD count;
1415 UINT r;
1416
1417 r = MSI_OpenQuery( info->dialog->package->db, &view,
1418 L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
1419 if (r != ERROR_SUCCESS)
1420 return r;
1421
1422 /* just get the number of records */
1423 count = 0;
1425 if (r != ERROR_SUCCESS)
1426 {
1427 msiobj_release( &view->hdr );
1428 return r;
1429 }
1430 info->num_items = count;
1431 info->items = malloc( sizeof(*info->items) * count );
1432
1434 msiobj_release( &view->hdr );
1435 return r;
1436}
#define malloc
Definition: debug_ros.c:4
static UINT combobox_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:1389
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID)
Definition: msiquery.c:163
unsigned int UINT
Definition: ndis.h:50

Referenced by dialog_combo_control().

◆ destroy_control()

static void destroy_control ( struct control t)
static

Definition at line 355 of file dialog.c.

356{
357 list_remove( &t->entry );
358 /* leave dialog->hwnd - destroying parent destroys child windows */
359 free( t->property );
360 free( t->value );
361 if( t->hBitmap )
362 DeleteObject( t->hBitmap );
363 if( t->hIcon )
364 DestroyIcon( t->hIcon );
365 if ( t->hImageList )
366 ImageList_Destroy( t->hImageList );
367 free( t->tabnext );
368 free( t->type );
369 if (t->hDll)
370 FreeLibrary( t->hDll );
371 free( t );
372}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
#define FreeLibrary(x)
Definition: compat.h:748
pKey DeleteObject()
GLdouble GLdouble t
Definition: gl.h:2047
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by msi_dialog_destroy().

◆ dialog_add_control()

static struct control * dialog_add_control ( msi_dialog dialog,
MSIRECORD rec,
const WCHAR szCls,
DWORD  style 
)
static

Definition at line 715 of file dialog.c.

716{
718 const WCHAR *text = NULL, *name, *control_type;
719 DWORD exstyle = 0;
720
721 name = MSI_RecordGetString( rec, 2 );
724 if (wcscmp( control_type, L"ScrollableText" )) text = MSI_RecordGetString( rec, 10 );
725
726 TRACE( "%s, %s, %#lx, %s, %#lx\n", debugstr_w(szCls), debugstr_w(name), attributes, debugstr_w(text), style );
727
729 style |= WS_VISIBLE;
733 exstyle |= WS_EX_CLIENTEDGE;
734
736
737 return dialog_create_window( dialog, rec, exstyle, szCls, name, text, style, dialog->hwnd );
738}
Arabic default style
Definition: afstyles.h:94
static void dialog_map_events(msi_dialog *dialog, const WCHAR *control)
Definition: dialog.c:696
static struct 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:374
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
#define debugstr_w
Definition: kernel32.h:32
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
int MSI_RecordGetInteger(MSIRECORD *, UINT)
Definition: record.c:213
static HANDLE ACCESS_MASK ULONG attributes
Definition: om.c:94
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_DISABLED
Definition: pedump.c:621
#define TRACE(s)
Definition: solgame.cpp:4
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

Referenced by dialog_bitmap_control(), dialog_button_control(), dialog_checkbox_control(), dialog_combo_control(), dialog_directory_combo(), dialog_directory_list(), dialog_edit_control(), dialog_group_box(), dialog_hyperlink(), dialog_icon_control(), dialog_line_control(), dialog_list_box(), dialog_listview(), dialog_maskedit_control(), dialog_pathedit_control(), dialog_progress_bar(), dialog_radiogroup_control(), dialog_scrolltext_control(), dialog_selection_tree(), dialog_text_control(), dialog_volumecost_list(), and dialog_volumeselect_combo().

◆ dialog_add_font()

static UINT dialog_add_font ( MSIRECORD rec,
void param 
)
static

Definition at line 270 of file dialog.c.

271{
273 struct font *font;
275 LOGFONTW lf;
276 INT style;
277 HDC hdc;
278
279 /* create a font and add it to the list */
280 name = MSI_RecordGetString( rec, 1 );
281 font = malloc( offsetof( struct font, name[wcslen( name ) + 1] ) );
282 lstrcpyW( font->name, name );
283 list_add_head( &dialog->fonts, &font->entry );
284
285 font->color = MSI_RecordGetInteger( rec, 4 );
286
287 memset( &lf, 0, sizeof lf );
288 face = MSI_RecordGetString( rec, 2 );
289 lf.lfHeight = MSI_RecordGetInteger( rec, 3 );
290 style = MSI_RecordGetInteger( rec, 5 );
292 lf.lfWeight = FW_BOLD;
294 lf.lfItalic = TRUE;
296 lf.lfUnderline = TRUE;
298 lf.lfStrikeOut = TRUE;
300
301 /* adjust the height */
302 hdc = GetDC( dialog->hwnd );
303 if (hdc)
304 {
306 ReleaseDC( dialog->hwnd, hdc );
307 }
308
309 font->hfont = CreateFontIndirectW( &lf );
310
311 TRACE("Adding font style %s\n", debugstr_w(font->name) );
312
313 return ERROR_SUCCESS;
314}
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 lstrcpyW
Definition: compat.h:749
#define lstrcpynW
Definition: compat.h:738
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
@ msidbTextStyleStyleBitsBold
Definition: msidefs.h:108
@ msidbTextStyleStyleBitsUnderline
Definition: msidefs.h:110
@ msidbTextStyleStyleBitsItalic
Definition: msidefs.h:109
@ msidbTextStyleStyleBitsStrike
Definition: msidefs.h:111
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
Definition: mk_font.cpp:20
#define offsetof(TYPE, MEMBER)
#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 dialog_build_font_list().

◆ dialog_adjust_dialog_pos()

static void dialog_adjust_dialog_pos ( msi_dialog dialog,
MSIRECORD rec,
RECT pos 
)
static

Definition at line 3596 of file dialog.c.

3597{
3598 UINT xres, yres;
3599 POINT center;
3600 SIZE sz;
3601 LONG style;
3602
3603 center.x = MSI_RecordGetInteger( rec, 2 );
3604 center.y = MSI_RecordGetInteger( rec, 3 );
3605
3606 sz.cx = MSI_RecordGetInteger( rec, 4 );
3607 sz.cy = MSI_RecordGetInteger( rec, 5 );
3608
3609 sz.cx = dialog_scale_unit( dialog, sz.cx );
3610 sz.cy = dialog_scale_unit( dialog, sz.cy );
3611
3612 xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
3613 yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
3614
3615 center.x = MulDiv( center.x, xres, 100 );
3616 center.y = MulDiv( center.y, yres, 100 );
3617
3618 /* turn the client pos into the window rectangle */
3619 if (dialog->package->center_x && dialog->package->center_y)
3620 {
3621 pos->left = dialog->package->center_x - sz.cx / 2.0;
3622 pos->right = pos->left + sz.cx;
3623 pos->top = dialog->package->center_y - sz.cy / 2.0;
3624 pos->bottom = pos->top + sz.cy;
3625 }
3626 else
3627 {
3628 pos->left = center.x - sz.cx/2;
3629 pos->right = pos->left + sz.cx;
3630 pos->top = center.y - sz.cy/2;
3631 pos->bottom = pos->top + sz.cy;
3632
3633 /* save the center */
3634 dialog->package->center_x = center.x;
3635 dialog->package->center_y = center.y;
3636 }
3637
3638 dialog->size.cx = sz.cx;
3639 dialog->size.cy = sz.cy;
3640
3641 TRACE("%s\n", wine_dbgstr_rect(pos));
3642
3645}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define FALSE
Definition: types.h:117
static INT dialog_scale_unit(msi_dialog *dialog, INT val)
Definition: dialog.c:156
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
long LONG
Definition: pedump.c:60
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:4983
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:863

Referenced by dialog_oncreate().

◆ dialog_bitmap_control()

static UINT dialog_bitmap_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1293 of file dialog.c.

1294{
1296 struct control *control;
1297 LPWSTR name;
1298
1301
1302 attributes = MSI_RecordGetInteger( rec, 8 );
1304 {
1307 }
1308
1309 control = dialog_add_control( dialog, rec, L"Static", style );
1310 cx = MSI_RecordGetInteger( rec, 6 );
1311 cy = MSI_RecordGetInteger( rec, 7 );
1314
1315 name = get_binary_name( dialog->package, rec );
1316 control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
1317 if( control->hBitmap )
1320 else
1321 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1322
1323 free( name );
1324
1325 return ERROR_SUCCESS;
1326}
static HBITMAP load_picture(MSIDATABASE *db, const WCHAR *name, INT cx, INT cy, DWORD flags)
Definition: dialog.c:946
static struct control * dialog_add_control(msi_dialog *dialog, MSIRECORD *rec, const WCHAR *szCls, DWORD style)
Definition: dialog.c:715
static WCHAR * get_binary_name(MSIPACKAGE *package, MSIRECORD *rec)
Definition: dialog.c:836
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
Definition: dialog.c:52
HBITMAP hBitmap
Definition: dialog.c:59
HWND hwnd
Definition: dialog.c:54
WCHAR name[1]
Definition: dialog.c:69
uint16_t * LPWSTR
Definition: typedefs.h:56
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_LOADFROMFILE
Definition: winuser.h:1103
#define SS_CENTERIMAGE
Definition: winuser.h:339
#define STM_SETIMAGE
Definition: winuser.h:2129
#define LR_DEFAULTSIZE
Definition: winuser.h:1105

◆ dialog_build_font_list()

static UINT dialog_build_font_list ( msi_dialog dialog)
static

Definition at line 339 of file dialog.c.

340{
341 MSIQUERY *view;
342 UINT r;
343
344 TRACE("dialog %p\n", dialog );
345
346 r = MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `TextStyle`" );
347 if( r != ERROR_SUCCESS )
348 return r;
349
351 msiobj_release( &view->hdr );
352 return r;
353}
static UINT dialog_add_font(MSIRECORD *rec, void *param)
Definition: dialog.c:270

Referenced by dialog_oncreate().

◆ dialog_button_control()

static UINT dialog_button_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1010 of file dialog.c.

1011{
1012 struct control *control;
1013 UINT attributes, style, cx = 0, cy = 0, flags = 0;
1014 WCHAR *name = NULL;
1015
1016 TRACE("%p %p\n", dialog, rec);
1017
1018 style = WS_TABSTOP;
1019 attributes = MSI_RecordGetInteger( rec, 8 );
1022 {
1023 style |= BS_BITMAP;
1025 else
1026 {
1029 }
1030 }
1031
1032 control = dialog_add_control( dialog, rec, L"BUTTON", style );
1033 if (!control)
1034 return ERROR_FUNCTION_FAILED;
1035
1037
1039 {
1040 name = get_binary_name( dialog->package, rec );
1041 control->hIcon = load_icon( dialog->package->db, name, attributes );
1042 if (control->hIcon)
1043 {
1045 }
1046 else ERR("Failed to load icon %s\n", debugstr_w(name));
1047 }
1049 {
1050 name = get_binary_name( dialog->package, rec );
1051 control->hBitmap = load_picture( dialog->package->db, name, cx, cy, flags );
1052 if (control->hBitmap)
1053 {
1055 }
1056 else ERR("Failed to load bitmap %s\n", debugstr_w(name));
1057 }
1058
1059 free( name );
1060 return ERROR_SUCCESS;
1061}
static UINT dialog_button_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:915
static HICON load_icon(MSIDATABASE *db, const WCHAR *text, UINT attributes)
Definition: dialog.c:477
@ msidbControlAttributesBitmap
Definition: msidefs.h:96
@ msidbControlAttributesIcon
Definition: msidefs.h:97
#define WS_TABSTOP
Definition: pedump.c:634
UINT(* handler)(msi_dialog *, struct control *, WPARAM)
Definition: dialog.c:55
HICON hIcon
Definition: dialog.c:60
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:1333
#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:1951

◆ dialog_button_handler()

static UINT dialog_button_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 915 of file dialog.c.

916{
917 MSIQUERY *view;
918 UINT r;
919
920 if (HIWORD(param) != BN_CLICKED)
921 return ERROR_SUCCESS;
922
923 r = MSI_OpenQuery( dialog->package->db, &view,
924 L"SELECT * FROM `ControlEvent` WHERE `Dialog_` = '%s' AND `Control_` = '%s' ORDER BY `Ordering`",
925 dialog->name, control->name );
926 if (r != ERROR_SUCCESS)
927 {
928 ERR("query failed\n");
929 return ERROR_SUCCESS;
930 }
932 msiobj_release( &view->hdr );
933
934 /* dialog control events must be processed last regardless of ordering */
935 if (dialog->pending_event)
936 {
937 r = dialog->pending_event( dialog, dialog->pending_argument );
938
939 free( dialog->pending_argument );
940 dialog->pending_event = NULL;
941 dialog->pending_argument = NULL;
942 }
943 return r;
944}
static UINT dialog_control_event(MSIRECORD *rec, void *param)
Definition: dialog.c:895
#define HIWORD(l)
Definition: typedefs.h:247
#define BN_CLICKED
Definition: winuser.h:1954

Referenced by dialog_button_control(), dialog_checkbox_handler(), dialog_radiogroup_handler(), and MSIScrollText_WndProc().

◆ dialog_checkbox_control()

static UINT dialog_checkbox_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1145 of file dialog.c.

1146{
1147 struct control *control;
1148 LPCWSTR prop;
1149
1150 TRACE("%p %p\n", dialog, rec);
1151
1155 prop = MSI_RecordGetString( rec, 9 );
1156 if (prop)
1157 {
1158 control->property = wcsdup( prop );
1160 TRACE("control %s value %s\n", debugstr_w(control->property), debugstr_w(control->value));
1161 }
1163 return ERROR_SUCCESS;
1164}
static WCHAR * get_checkbox_value(msi_dialog *dialog, const WCHAR *prop)
Definition: dialog.c:1063
static void dialog_checkbox_sync_state(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1122
static UINT dialog_checkbox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1128
#define BS_CHECKBOX
Definition: pedump.c:653
void(* update)(msi_dialog *, struct control *)
Definition: dialog.c:56
LPWSTR value
Definition: dialog.c:58
LPWSTR property
Definition: dialog.c:57
#define BS_MULTILINE
Definition: winuser.h:267

◆ dialog_checkbox_handler()

static UINT dialog_checkbox_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 1128 of file dialog.c.

1129{
1130 UINT state;
1131
1132 if (HIWORD(param) != BN_CLICKED)
1133 return ERROR_SUCCESS;
1134
1135 TRACE("clicked checkbox %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1136
1138 state = state ? 0 : 1;
1141
1143}
static int state
Definition: maze.c:121
static void dialog_set_checkbox_state(msi_dialog *dialog, struct control *control, UINT state)
Definition: dialog.c:1102
static UINT dialog_get_checkbox_state(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1093

Referenced by dialog_checkbox_control().

◆ dialog_checkbox_sync_state()

static void dialog_checkbox_sync_state ( msi_dialog dialog,
struct control control 
)
static

Definition at line 1122 of file dialog.c.

1123{
1126}
#define BST_UNCHECKED
Definition: winuser.h:199
#define BM_SETCHECK
Definition: winuser.h:1950
#define BST_CHECKED
Definition: winuser.h:197

Referenced by dialog_checkbox_control(), and dialog_checkbox_handler().

◆ dialog_combo_control()

static UINT dialog_combo_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1549 of file dialog.c.

1550{
1551 struct msi_combobox_info *info;
1552 struct control *control;
1554 LPCWSTR prop;
1555
1556 info = malloc( sizeof *info );
1557 if (!info)
1558 return ERROR_FUNCTION_FAILED;
1559
1561 attributes = MSI_RecordGetInteger( rec, 8 );
1563 style |= CBS_SORT;
1566 else
1568
1570 if (!control)
1571 {
1572 free( info );
1573 return ERROR_FUNCTION_FAILED;
1574 }
1575
1578
1579 prop = MSI_RecordGetString( rec, 9 );
1581
1582 /* subclass */
1583 info->dialog = dialog;
1584 info->hwnd = control->hwnd;
1585 info->items = NULL;
1586 info->addpos_items = 0;
1589 SetPropW( control->hwnd, L"MSIDATA", info );
1590
1591 if (control->property)
1593
1595
1596 return ERROR_SUCCESS;
1597}
static void dialog_combobox_update(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1514
static LRESULT WINAPI MSIComboBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1361
static WCHAR * dialog_dup_property(msi_dialog *dialog, const WCHAR *property, BOOL indirect)
Definition: dialog.c:211
static UINT combobox_add_items(struct msi_combobox_info *info, const WCHAR *property)
Definition: dialog.c:1411
static UINT dialog_combobox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1489
@ msidbControlAttributesSorted
Definition: msidefs.h:91
@ msidbControlAttributesComboList
Definition: msidefs.h:92
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_CHILD
Definition: pedump.c:617
#define WC_COMBOBOXW
Definition: commctrl.h:4722
#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:3014
#define SetWindowLongPtrW
Definition: winuser.h:5512

◆ dialog_combobox_handler()

static UINT dialog_combobox_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 1489 of file dialog.c.

1490{
1491 struct msi_combobox_info *info;
1492 int index;
1493 LPWSTR value;
1494
1496 return ERROR_SUCCESS;
1497
1498 info = GetPropW( control->hwnd, L"MSIDATA" );
1500 if (index == CB_ERR)
1502 else
1504
1505 dialog_set_property( info->dialog->package, control->property, value );
1507
1508 if (index == CB_ERR)
1509 free( value );
1510
1511 return ERROR_SUCCESS;
1512}
#define index(s, c)
Definition: various.h:29
static void dialog_set_property(MSIPACKAGE *package, const WCHAR *property, const WCHAR *value)
Definition: dialog.c:522
static UINT dialog_evaluate_control_conditions(msi_dialog *dialog)
Definition: dialog.c:1471
static WCHAR * get_window_text(HWND hwnd)
Definition: dialog.c:134
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2471
#define CBN_SELCHANGE
Definition: winuser.h:2008
#define CB_GETITEMDATA
Definition: winuser.h:1979
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define CB_GETCURSEL
Definition: winuser.h:1972
#define CBN_EDITCHANGE
Definition: winuser.h:2004

Referenced by dialog_combo_control().

◆ dialog_combobox_update()

static void dialog_combobox_update ( msi_dialog dialog,
struct control control 
)
static

Definition at line 1514 of file dialog.c.

1515{
1516 struct msi_combobox_info *info;
1517 LPWSTR value, tmp;
1518 DWORD j;
1519
1520 info = GetPropW( control->hwnd, L"MSIDATA" );
1521
1522 value = msi_dup_property( dialog->package->db, control->property );
1523 if (!value)
1524 {
1526 return;
1527 }
1528
1529 for (j = 0; j < info->num_items; j++)
1530 {
1532 if (!wcscmp( value, tmp ))
1533 break;
1534 }
1535
1536 if (j < info->num_items)
1537 {
1539 }
1540 else
1541 {
1544 }
1545
1546 free( value );
1547}
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
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
#define CB_SETCURSEL
Definition: winuser.h:1990
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)

Referenced by dialog_combo_control().

◆ dialog_control_event()

static UINT dialog_control_event ( MSIRECORD rec,
void param 
)
static

Definition at line 895 of file dialog.c.

896{
899 UINT r;
900
901 condition = MSI_RecordGetString( rec, 5 );
904 {
905 event = MSI_RecordGetString( rec, 3 );
906 arg = MSI_RecordGetString( rec, 4 );
907 if (event[0] == '[')
909 else
911 }
912 return ERROR_SUCCESS;
913}
static UINT dialog_set_property_event(msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
Definition: dialog.c:856
static UINT dialog_send_event(msi_dialog *dialog, const WCHAR *event, const WCHAR *arg)
Definition: dialog.c:878
struct _cl_event * event
Definition: glext.h:7739
GLenum condition
Definition: glext.h:9255
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *, LPCWSTR)
@ MSICONDITION_NONE
Definition: msiquery.h:28
@ MSICONDITION_TRUE
Definition: msiquery.h:27
void * arg
Definition: msvc.h:10

Referenced by dialog_button_handler().

◆ dialog_create()

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

Definition at line 3936 of file dialog.c.

3938{
3939 MSIRECORD *rec = NULL;
3941
3942 TRACE("%s\n", debugstr_w(name));
3943
3945
3946 /* allocate the structure for the dialog to use */
3947 dialog = calloc( 1, offsetof( msi_dialog, name[wcslen( name ) + 1] ) );
3948 if( !dialog )
3949 return NULL;
3950 lstrcpyW( dialog->name, name );
3951 dialog->parent = parent;
3952 dialog->package = package;
3953 dialog->event_handler = event_handler;
3954 dialog->finished = 0;
3955 list_init( &dialog->controls );
3956 list_init( &dialog->fonts );
3957
3958 /* verify that the dialog exists */
3959 rec = get_dialog_record( dialog );
3960 if( !rec )
3961 {
3962 free( dialog );
3963 return NULL;
3964 }
3965 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3966 dialog->control_default = wcsdup( MSI_RecordGetString( rec, 9 ) );
3967 dialog->control_cancel = wcsdup( MSI_RecordGetString( rec, 10 ) );
3968 msiobj_release( &rec->hdr );
3969
3970 rec = MSI_CreateRecord(2);
3971 if (!rec)
3972 {
3974 return NULL;
3975 }
3976 MSI_RecordSetStringW(rec, 1, name);
3977 MSI_RecordSetStringW(rec, 2, L"Dialog created");
3979 msiobj_release(&rec->hdr);
3980
3981 return dialog;
3982}
static void list_init(struct list_entry *head)
Definition: list.h:51
static HWND hMsiHiddenWindow
Definition: dialog.c:132
static BOOL dialog_register_class(void)
Definition: dialog.c:3904
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4059
static MSIRECORD * get_dialog_record(msi_dialog *dialog)
Definition: dialog.c:3582
r parent
Definition: btrfs.c:3010
@ INSTALLMESSAGE_ACTIONSTART
Definition: msi.h:102
#define calloc
Definition: rosglue.h:14
MSIOBJECTHDR hdr
Definition: msipriv.h:151

Referenced by event_do_dialog(), and MSI_PreviewDialogW().

◆ dialog_create_controls()

static UINT dialog_create_controls ( MSIRECORD rec,
void param 
)
static

Definition at line 3504 of file dialog.c.

3505{
3508 UINT i;
3509
3510 /* find and call the function that can create this type of control */
3512 for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ )
3514 break;
3517 else
3518 ERR("no handler for element type %s\n", debugstr_w(control_type));
3519
3520 return ERROR_SUCCESS;
3521}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define wcsicmp
Definition: compat.h:15
static const struct control_handler msi_dialog_handler[]
Definition: dialog.c:3478
GLenum func
Definition: glext.h:6028
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

Referenced by dialog_fill_controls().

◆ dialog_create_radiobutton()

static UINT dialog_create_radiobutton ( MSIRECORD rec,
void param 
)
static

Definition at line 2160 of file dialog.c.

2161{
2163 msi_dialog *dialog = group->dialog;
2164 struct control *control;
2165 LPCWSTR prop, text, name;
2167
2168 name = MSI_RecordGetString( rec, 3 );
2169 text = MSI_RecordGetString( rec, 8 );
2170
2171 control = dialog_create_window( dialog, rec, 0, L"BUTTON", name, text, style,
2172 group->parent->hwnd );
2173 if (!control)
2174 return ERROR_FUNCTION_FAILED;
2176
2177 if (group->propval && !wcscmp( control->name, group->propval ))
2179
2180 prop = MSI_RecordGetString( rec, 1 );
2181 if( prop )
2182 control->property = wcsdup( prop );
2183
2184 return ERROR_SUCCESS;
2185}
static UINT dialog_radiogroup_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2147
GLboolean GLuint group
Definition: glext.h:11120
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660

Referenced by dialog_radiogroup_control().

◆ dialog_create_window()

static struct 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 374 of file dialog.c.

377{
378 DWORD x, y, width, height;
379 LPWSTR font = NULL, title_font = NULL;
381 struct control *control;
382
383 style |= WS_CHILD;
384
385 control = malloc( offsetof( struct control, name[wcslen( name ) + 1] ) );
386 if (!control)
387 return NULL;
388
390 list_add_tail( &dialog->controls, &control->entry );
394 control->value = NULL;
396 control->hIcon = NULL;
398 control->hDll = NULL;
399 control->tabnext = wcsdup( MSI_RecordGetString( rec, 11 ) );
400 control->type = wcsdup( MSI_RecordGetString( rec, 3 ) );
402 control->progress_max = 100;
404
405 x = MSI_RecordGetInteger( rec, 4 );
406 y = MSI_RecordGetInteger( rec, 5 );
407 width = MSI_RecordGetInteger( rec, 6 );
408 height = MSI_RecordGetInteger( rec, 7 );
409
414
415 if( text )
416 {
417 deformat_string( dialog->package, text, &title_font );
418 font = dialog_get_style( title_font, &title );
419 }
420
421 if (!wcsicmp( MSI_RecordGetString( rec, 3 ), L"Line" ))
422 height = 2; /* line is exactly 2 units in height */
423
424 control->hwnd = CreateWindowExW( exstyle, szCls, title, style,
425 x, y, width, height, parent, NULL, NULL, NULL );
426
427 TRACE("Dialog %s control %s hwnd %p\n",
429
430 dialog_set_font( dialog, control->hwnd, font ? font : dialog->default_font );
431
432 free( title_font );
433 free( font );
434
435 return control;
436}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static UINT dialog_set_font(msi_dialog *dialog, HWND hwnd, const WCHAR *name)
Definition: dialog.c:327
static WCHAR * dialog_get_style(const WCHAR *p, const WCHAR **rest)
Definition: dialog.c:233
DWORD deformat_string(MSIPACKAGE *package, const WCHAR *fmt, WCHAR **data)
Definition: format.c:1016
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 char title[]
Definition: ps.c:92
LPWSTR type
Definition: dialog.c:63
float progress_current
Definition: dialog.c:65
HMODULE hDll
Definition: dialog.c:64
BOOL progress_backwards
Definition: dialog.c:67
struct list entry
Definition: dialog.c:53
HIMAGELIST hImageList
Definition: dialog.c:61
LPWSTR tabnext
Definition: dialog.c:62
float progress_max
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)

Referenced by dialog_add_control(), and dialog_create_radiobutton().

◆ dialog_directory_combo()

static UINT dialog_directory_combo ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2787 of file dialog.c.

2788{
2789 struct control *control;
2790 LPCWSTR prop;
2791 DWORD style;
2792
2793 /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
2797 if (!control)
2798 return ERROR_FUNCTION_FAILED;
2799
2801 prop = MSI_RecordGetString( rec, 9 );
2803
2805
2806 return ERROR_SUCCESS;
2807}
static void dialog_update_directory_combo(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2770
#define WS_VSCROLL
Definition: pedump.c:627
DWORD attributes
Definition: dialog.c:68
#define CBS_HASSTRINGS
Definition: winuser.h:285

◆ dialog_directory_list()

static UINT dialog_directory_list ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3005 of file dialog.c.

3006{
3007 struct control *control;
3008 LPCWSTR prop;
3009 DWORD style;
3010
3015 if (!control)
3016 return ERROR_FUNCTION_FAILED;
3017
3020 prop = MSI_RecordGetString( rec, 9 );
3022
3023 /* double click to activate an item in the list */
3026
3028
3029 return ERROR_SUCCESS;
3030}
static void dialog_update_directory_list(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2811
static UINT dialog_dirlist_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2940
#define WS_BORDER
Definition: pedump.c:625
#define LVS_SINGLESEL
Definition: commctrl.h:2271
#define LVS_SHAREIMAGELISTS
Definition: commctrl.h:2275
#define WC_LISTVIEWW
Definition: commctrl.h:2262
#define LVS_EX_TWOCLICKACTIVATE
Definition: commctrl.h:2741
#define LVS_SORTASCENDING
Definition: commctrl.h:2273
#define LVS_EDITLABELS
Definition: commctrl.h:2278
#define LVS_AUTOARRANGE
Definition: commctrl.h:2277
#define LVS_LIST
Definition: commctrl.h:2269
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2729

◆ dialog_directorylist_new()

static UINT dialog_directorylist_new ( msi_dialog dialog)
static

Definition at line 2915 of file dialog.c.

2916{
2917 struct control *control;
2918 WCHAR *path;
2919 LVITEMW item;
2920 int index;
2921
2922 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2923
2925
2926 item.mask = LVIF_TEXT;
2927 item.iItem = 0;
2928 item.iSubItem = 0;
2929 item.pszText = get_unique_folder_name( path, &item.cchTextMax );
2930
2934
2935 free( path );
2936 free( item.pszText );
2937 return ERROR_SUCCESS;
2938}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static struct control * dialog_find_control_by_type(msi_dialog *dialog, const WCHAR *type)
Definition: dialog.c:175
static WCHAR * get_unique_folder_name(const WCHAR *root, int *ret_len)
Definition: dialog.c:2887
static WCHAR * get_path_property(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2024
#define LVM_EDITLABELW
Definition: commctrl.h:2541
#define LVM_ENSUREVISIBLE
Definition: commctrl.h:2523
#define LVIF_TEXT
Definition: commctrl.h:2314
#define LVM_INSERTITEMW
Definition: commctrl.h:2409

Referenced by event_directory_list_new().

◆ dialog_directorylist_up()

static UINT dialog_directorylist_up ( msi_dialog dialog)
static

Definition at line 2856 of file dialog.c.

2857{
2858 struct control *control;
2859 LPWSTR prop, path, ptr;
2860 BOOL indirect;
2861
2862 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2865 path = dialog_dup_property( dialog, prop, TRUE );
2866
2867 /* strip off the last directory */
2869 if (ptr != path)
2870 {
2871 *(ptr - 1) = '\0';
2873 }
2874
2875 dialog_set_property( dialog->package, prop, path );
2876
2880
2881 free( path );
2882 free( prop );
2883
2884 return ERROR_SUCCESS;
2885}
WCHAR *WINAPI PathFindFileNameW(const WCHAR *path)
Definition: path.c:1677
static void dialog_update_pathedit(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2034
unsigned int BOOL
Definition: ntddk_ex.h:94
const GLvoid * indirect
Definition: glext.h:7408
static PVOID ptr
Definition: dispmode.c:27
@ msidbControlAttributesIndirect
Definition: msidefs.h:65
#define PathAddBackslashW
Definition: pathcch.h:302

Referenced by event_directory_list_up().

◆ dialog_dirlist_handler()

static UINT dialog_dirlist_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 2940 of file dialog.c.

2941{
2942 NMHDR *nmhdr = (NMHDR *)param;
2943 WCHAR text[MAX_PATH], *new_path, *path, *prop;
2944 BOOL indirect;
2945
2946 switch (nmhdr->code)
2947 {
2948 case LVN_ENDLABELEDITW:
2949 {
2951 if (!info->item.pszText) return ERROR_SUCCESS;
2952 lstrcpynW( text, info->item.pszText, ARRAY_SIZE(text) );
2953 text[ARRAY_SIZE(text) - 1] = 0;
2954 break;
2955 }
2956 case LVN_ITEMACTIVATE:
2957 {
2958 LVITEMW item;
2960 if (index < 0)
2961 {
2962 ERR("no list-view item selected\n");
2963 return ERROR_FUNCTION_FAILED;
2964 }
2965
2966 item.iSubItem = 0;
2967 item.pszText = text;
2968 item.cchTextMax = MAX_PATH;
2970 text[ARRAY_SIZE(text) - 1] = 0;
2971 break;
2972 }
2973 default:
2974 return ERROR_SUCCESS;
2975 }
2976
2979 path = dialog_dup_property( dialog, prop, TRUE );
2980
2981 if (!(new_path = malloc( (wcslen(path) + wcslen(text) + 2) * sizeof(WCHAR) )))
2982 {
2983 free( prop );
2984 free( path );
2985 return ERROR_OUTOFMEMORY;
2986 }
2987 lstrcpyW( new_path, path );
2988 lstrcatW( new_path, text );
2989 if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
2990 lstrcatW( new_path, L"\\" );
2991
2992 dialog_set_property( dialog->package, prop, new_path );
2993
2997
2998 free( prop );
2999 free( path );
3000 free( new_path );
3001
3002 return ERROR_SUCCESS;
3003}
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define LVNI_SELECTED
Definition: commctrl.h:2429
#define LVM_GETNEXTITEM
Definition: commctrl.h:2438
#define LVN_ENDLABELEDITW
Definition: commctrl.h:3143
#define LVM_GETITEMTEXTW
Definition: commctrl.h:2685
#define LVN_ITEMACTIVATE
Definition: commctrl.h:3152
UINT code
Definition: winuser.h:3267

Referenced by dialog_directory_list().

◆ dialog_do_preview()

static void dialog_do_preview ( msi_dialog dialog)
static

Definition at line 4029 of file dialog.c.

4030{
4031 TRACE("\n");
4032 dialog->attributes |= msidbDialogAttributesVisible;
4033 dialog->attributes &= ~msidbDialogAttributesModal;
4035}
static UINT dialog_run_message_loop(msi_dialog *dialog)
Definition: dialog.c:3843
@ msidbDialogAttributesVisible
Definition: msidefs.h:47

Referenced by MSI_PreviewDialogW().

◆ dialog_dup_property()

static WCHAR * dialog_dup_property ( msi_dialog dialog,
const WCHAR property,
BOOL  indirect 
)
static

◆ dialog_edit_control()

static UINT dialog_edit_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1618 of file dialog.c.

1619{
1620 struct control *control;
1621 LPCWSTR prop, text;
1622 LPWSTR val, begin, end;
1624 DWORD limit;
1625
1628
1629 text = MSI_RecordGetString( rec, 10 );
1630 if ( text )
1631 {
1632 begin = wcschr( text, '{' );
1633 end = wcschr( text, '}' );
1634
1635 if ( begin && end && end > begin &&
1636 begin[0] >= '0' && begin[0] <= '9' &&
1637 end - begin < MAX_NUM_DIGITS)
1638 {
1639 lstrcpynW( num, begin + 1, end - begin );
1640 limit = wcstol( num, NULL, 10 );
1641
1643 }
1644 }
1645
1646 prop = MSI_RecordGetString( rec, 9 );
1647 if( prop )
1648 control->property = wcsdup( prop );
1649
1650 val = msi_dup_property( dialog->package->db, control->property );
1652 free( val );
1653 return ERROR_SUCCESS;
1654}
#define wcschr
Definition: compat.h:17
#define MAX_NUM_DIGITS
Definition: dialog.c:1616
static UINT dialog_edit_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1599
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
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:2040

◆ dialog_edit_handler()

static UINT dialog_edit_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 1599 of file dialog.c.

1600{
1601 LPWSTR buf;
1602
1603 if (HIWORD(param) != EN_CHANGE)
1604 return ERROR_SUCCESS;
1605
1606 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1607
1610 free( buf );
1611
1612 return ERROR_SUCCESS;
1613}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define EN_CHANGE
Definition: winuser.h:2051

Referenced by dialog_edit_control().

◆ dialog_end_dialog()

static void dialog_end_dialog ( msi_dialog dialog)
static

Definition at line 3984 of file dialog.c.

3985{
3986 TRACE("%p\n", dialog);
3987 dialog->finished = 1;
3988 PostMessageW(dialog->hwnd, WM_NULL, 0, 0);
3989}
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1635

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

◆ dialog_evaluate_control_conditions()

static UINT dialog_evaluate_control_conditions ( msi_dialog dialog)
static

Definition at line 1471 of file dialog.c.

1472{
1473 UINT r;
1474 MSIQUERY *view;
1475 MSIPACKAGE *package = dialog->package;
1476
1477 TRACE("%p %s\n", dialog, debugstr_w(dialog->name));
1478
1479 /* query the Control table for all the elements of the control */
1480 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `ControlCondition` WHERE `Dialog_` = '%s'", dialog->name );
1481 if (r != ERROR_SUCCESS)
1482 return ERROR_SUCCESS;
1483
1485 msiobj_release( &view->hdr );
1486 return r;
1487}
static UINT dialog_set_control_condition(MSIRECORD *rec, void *param)
Definition: dialog.c:1438

Referenced by dialog_combobox_handler(), dialog_listbox_handler(), dialog_oncommand(), dialog_oncreate(), dialog_reset(), and mask_control_change().

◆ dialog_event_handler()

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

Definition at line 4565 of file dialog.c.

4566{
4567 unsigned int i;
4568
4569 TRACE("handling event %s\n", debugstr_w(event));
4570
4571 if (!event) return ERROR_SUCCESS;
4572
4573 for (i = 0; control_events[i].event; i++)
4574 {
4575 if (!wcscmp( control_events[i].event, event ))
4576 return control_events[i].handler( dialog, argument );
4577 }
4578 FIXME("unhandled event %s arg(%s)\n", debugstr_w(event), debugstr_w(argument));
4579 return ERROR_SUCCESS;
4580}
#define FIXME(fmt,...)
Definition: precomp.h:53
static const struct control_event control_events[]
Definition: dialog.c:4543

Referenced by event_do_dialog().

◆ dialog_fill_controls()

static UINT dialog_fill_controls ( msi_dialog dialog)
static

Definition at line 3523 of file dialog.c.

3524{
3525 UINT r;
3526 MSIQUERY *view;
3527 MSIPACKAGE *package = dialog->package;
3528
3529 TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
3530
3531 /* query the Control table for all the elements of the control */
3532 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `Control` WHERE `Dialog_` = '%s'", dialog->name );
3533 if( r != ERROR_SUCCESS )
3534 {
3535 ERR("query failed for dialog %s\n", debugstr_w(dialog->name));
3537 }
3538
3540 msiobj_release( &view->hdr );
3541 return r;
3542}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
static UINT dialog_create_controls(MSIRECORD *rec, void *param)
Definition: dialog.c:3504

Referenced by dialog_oncreate().

◆ dialog_find_control()

static struct control * dialog_find_control ( msi_dialog dialog,
const WCHAR name 
)
static

Definition at line 161 of file dialog.c.

162{
163 struct control *control;
164
165 if( !name )
166 return NULL;
167 if( !dialog->hwnd )
168 return NULL;
169 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
170 if( !wcscmp( control->name, name ) ) /* FIXME: case sensitive? */
171 return control;
172 return NULL;
173}
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

Referenced by dialog_handle_event(), dialog_oncommand(), dialog_set_control_condition(), and dialog_set_tab_order().

◆ dialog_find_control_by_hwnd()

static struct control * dialog_find_control_by_hwnd ( msi_dialog dialog,
HWND  hwnd 
)
static

Definition at line 189 of file dialog.c.

190{
191 struct control *control;
192
193 if( !dialog->hwnd )
194 return NULL;
195 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
196 if( hwnd == control->hwnd )
197 return control;
198 return NULL;
199}
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by dialog_oncommand(), and dialog_onnotify().

◆ dialog_find_control_by_type()

static struct control * dialog_find_control_by_type ( msi_dialog dialog,
const WCHAR type 
)
static

Definition at line 175 of file dialog.c.

176{
177 struct control *control;
178
179 if( !type )
180 return NULL;
181 if( !dialog->hwnd )
182 return NULL;
183 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
184 if( !wcscmp( control->type, type ) ) /* FIXME: case sensitive? */
185 return control;
186 return NULL;
187}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

Referenced by dialog_directorylist_new(), dialog_directorylist_up(), dialog_update_directory_combo(), dialog_update_directory_list(), and dialog_update_pathedit().

◆ dialog_find_font()

static struct font * dialog_find_font ( msi_dialog dialog,
const WCHAR name 
)
static

Definition at line 316 of file dialog.c.

317{
318 struct font *font = NULL;
319
320 LIST_FOR_EACH_ENTRY( font, &dialog->fonts, struct font, entry )
321 if( !wcscmp( font->name, name ) ) /* FIXME: case sensitive? */
322 break;
323
324 return font;
325}

Referenced by dialog_set_font(), and dialog_text_control().

◆ dialog_get_checkbox_state()

static UINT dialog_get_checkbox_state ( msi_dialog dialog,
struct control control 
)
static

Definition at line 1093 of file dialog.c.

1094{
1095 WCHAR state[2] = {0};
1096 DWORD sz = 2;
1097
1098 msi_get_property( dialog->package->db, control->property, state, &sz );
1099 return state[0] ? 1 : 0;
1100}
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
Definition: package.c:2250

Referenced by dialog_checkbox_handler(), and dialog_checkbox_sync_state().

◆ dialog_get_sans_serif_height()

static INT dialog_get_sans_serif_height ( HWND  hwnd)
static

Definition at line 3551 of file dialog.c.

3552{
3553 LOGFONTW lf;
3555 BOOL r;
3556 LONG height = 0;
3557 HFONT hFont, hOldFont;
3558 HDC hdc;
3559
3560 hdc = GetDC( hwnd );
3561 if (hdc)
3562 {
3563 memset( &lf, 0, sizeof lf );
3564 lf.lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
3565 lstrcpyW( lf.lfFaceName, L"MS Sans Serif" );
3567 if (hFont)
3568 {
3569 hOldFont = SelectObject( hdc, hFont );
3570 r = GetTextMetricsW( hdc, &tm );
3571 if (r)
3572 height = tm.tmHeight;
3573 SelectObject( hdc, hOldFont );
3575 }
3576 ReleaseDC( hwnd, hdc );
3577 }
3578 return height;
3579}
HFONT hFont
Definition: main.c:53
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546

Referenced by dialog_oncreate().

◆ dialog_get_style()

static WCHAR * dialog_get_style ( const WCHAR p,
const WCHAR **  rest 
)
static

Definition at line 233 of file dialog.c.

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

Referenced by dialog_create_window(), dialog_handle_event(), dialog_maskedit_control(), and dialog_text_control().

◆ dialog_get_uitext()

static WCHAR * dialog_get_uitext ( msi_dialog dialog,
const WCHAR key 
)
static

Definition at line 438 of file dialog.c.

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

Referenced by dialog_vcl_add_columns().

◆ dialog_group_box()

static UINT dialog_group_box ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2609 of file dialog.c.

2610{
2611 struct control *control;
2612 DWORD style;
2613
2616 if (!control)
2617 return ERROR_FUNCTION_FAILED;
2618
2619 return ERROR_SUCCESS;
2620}
#define BS_GROUPBOX
Definition: pedump.c:658
#define WC_BUTTONW
Definition: commctrl.h:4628

◆ dialog_handle_event()

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

Definition at line 555 of file dialog.c.

556{
557 struct control* ctrl;
558
560 if (!ctrl)
561 return;
562 if( !wcscmp( attribute, L"Text" ) )
563 {
564 const WCHAR *font_text, *text = NULL;
565 WCHAR *font, *text_fmt = NULL;
566
567 font_text = MSI_RecordGetString( rec , 1 );
568 font = dialog_get_style( font_text, &text );
569 deformat_string( dialog->package, text, &text_fmt );
570 if (text_fmt) text = text_fmt;
571 else text = L"";
572
573 SetWindowTextW( ctrl->hwnd, text );
574
575 free( font );
576 free( text_fmt );
578 }
579 else if( !wcscmp( attribute, L"Progress" ) )
580 {
581 DWORD func, val1, val2, units;
582
583 func = MSI_RecordGetInteger( rec, 1 );
584 val1 = MSI_RecordGetInteger( rec, 2 );
585 val2 = MSI_RecordGetInteger( rec, 3 );
586
587 TRACE( "progress: func %lu val1 %lu val2 %lu\n", func, val1, val2 );
588
589 units = val1 / 512;
590 switch (func)
591 {
592 case 0: /* init */
593 SendMessageW( ctrl->hwnd, PBM_SETRANGE, 0, MAKELPARAM(0,100) );
594 if (val2)
595 {
596 ctrl->progress_max = units ? units : 100;
597 ctrl->progress_current = units;
598 ctrl->progress_backwards = TRUE;
599 SendMessageW( ctrl->hwnd, PBM_SETPOS, 100, 0 );
600 }
601 else
602 {
603 ctrl->progress_max = units ? units : 100;
604 ctrl->progress_current = 0;
605 ctrl->progress_backwards = FALSE;
606 SendMessageW( ctrl->hwnd, PBM_SETPOS, 0, 0 );
607 }
608 break;
609 case 1: /* action data increment */
610 if (val2) dialog->package->action_progress_increment = val1;
611 else dialog->package->action_progress_increment = 0;
612 break;
613 case 2: /* move */
614 if (ctrl->progress_backwards)
615 {
616 if (units >= ctrl->progress_current) ctrl->progress_current -= units;
617 else ctrl->progress_current = 0;
618 }
619 else
620 {
621 if (ctrl->progress_current + units < ctrl->progress_max) ctrl->progress_current += units;
622 else ctrl->progress_current = ctrl->progress_max;
623 }
624 SendMessageW( ctrl->hwnd, PBM_SETPOS, MulDiv(100, ctrl->progress_current, ctrl->progress_max), 0 );
625 break;
626 case 3: /* add */
627 ctrl->progress_max += units;
628 break;
629 default:
630 FIXME( "unknown progress message %lu\n", func );
631 break;
632 }
633 }
634 else if ( !wcscmp( attribute, L"Property" ) )
635 {
637 if (feature) dialog_set_property( dialog->package, ctrl->property, feature->Directory );
638 }
639 else if ( !wcscmp( attribute, L"SelectionPath" ) )
640 {
643 if (!path) return;
644 SetWindowTextW( ctrl->hwnd, path );
645 free( path );
646 }
647 else
648 {
649 FIXME("Attribute %s not being set\n", debugstr_w(attribute));
650 return;
651 }
652}
static struct control * dialog_find_control(msi_dialog *dialog, const WCHAR *name)
Definition: dialog.c:161
static MSIFEATURE * seltree_get_selected_feature(struct control *control)
Definition: dialog.c:549
void msi_dialog_check_messages(HANDLE handle)
Definition: dialog.c:3991
GLfloat units
Definition: glext.h:11727
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define ctrl
Definition: input.c:3281
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define MAKELPARAM(l, h)
Definition: winuser.h:4116

Referenced by msi_event_fire().

◆ dialog_hyperlink()

static UINT dialog_hyperlink ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3354 of file dialog.c.

3355{
3356 struct control *control;
3358 const WCHAR *text = MSI_RecordGetString( rec, 10 );
3359 int len = lstrlenW( text );
3360 LITEM item;
3361
3363 if (!control)
3364 return ERROR_FUNCTION_FAILED;
3365
3368
3370 item.iLink = 0;
3371 item.state = LIS_ENABLED;
3372 item.stateMask = LIS_ENABLED;
3373 if (len < L_MAX_URL_LENGTH) lstrcpyW( item.szUrl, text );
3374 else item.szUrl[0] = 0;
3375
3377
3378 return ERROR_SUCCESS;
3379}
#define lstrlenW
Definition: compat.h:750
static UINT dialog_hyperlink_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3309
#define L_MAX_URL_LENGTH
Definition: commctrl.h:4740
#define LM_SETITEM
Definition: commctrl.h:4778
#define WC_LINK
Definition: commctrl.h:4742
#define LIF_URL
Definition: commctrl.h:4750
#define LIF_STATE
Definition: commctrl.h:4748
#define LIF_ITEMINDEX
Definition: commctrl.h:4747
#define LIS_ENABLED
Definition: commctrl.h:4753

◆ dialog_hyperlink_handler()

static UINT dialog_hyperlink_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 3309 of file dialog.c.

3310{
3311 int len, len_href = ARRAY_SIZE( L"href" ) - 1;
3312 const WCHAR *p, *q;
3313 WCHAR quote = 0;
3314 LITEM item;
3315
3316 item.mask = LIF_ITEMINDEX | LIF_URL;
3317 item.iLink = 0;
3318 item.szUrl[0] = 0;
3319
3321
3322 p = item.szUrl;
3323 while (*p && *p != '<') p++;
3324 if (!*p++) return ERROR_SUCCESS;
3325 if (towupper( *p++ ) != 'A' || !iswspace( *p++ )) return ERROR_SUCCESS;
3326 while (*p && iswspace( *p )) p++;
3327
3328 len = lstrlenW( p );
3329 if (len > len_href && !wcsnicmp( p, L"href", len_href ))
3330 {
3331 p += len_href;
3332 while (*p && iswspace( *p )) p++;
3333 if (!*p || *p++ != '=') return ERROR_SUCCESS;
3334 while (*p && iswspace( *p )) p++;
3335
3336 if (*p == '\"' || *p == '\'') quote = *p++;
3337 q = p;
3338 if (quote)
3339 {
3340 while (*q && *q != quote) q++;
3341 if (*q != quote) return ERROR_SUCCESS;
3342 }
3343 else
3344 {
3345 while (*q && *q != '>' && !iswspace( *q )) q++;
3346 if (!*q) return ERROR_SUCCESS;
3347 }
3348 item.szUrl[q - item.szUrl] = 0;
3349 ShellExecuteW( NULL, L"open", p, NULL, NULL, SW_SHOWNORMAL );
3350 }
3351 return ERROR_SUCCESS;
3352}
static const WCHAR quote[]
Definition: reg.c:40
#define wcsnicmp
Definition: compat.h:14
#define LM_GETITEM
Definition: commctrl.h:4779
#define iswspace(_c)
Definition: ctype.h:669
#define towupper(c)
Definition: wctype.h:99
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2778
#define SW_SHOWNORMAL
Definition: winuser.h:781

Referenced by dialog_hyperlink().

◆ dialog_icon_control()

static UINT dialog_icon_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1328 of file dialog.c.

1329{
1330 struct control *control;
1332 LPWSTR name;
1333
1334 TRACE("\n");
1335
1337
1338 attributes = MSI_RecordGetInteger( rec, 8 );
1339 name = get_binary_name( dialog->package, rec );
1340 control->hIcon = load_icon( dialog->package->db, name, attributes );
1341 if( control->hIcon )
1343 else
1344 ERR("Failed to load bitmap %s\n", debugstr_w(name));
1345 free( name );
1346 return ERROR_SUCCESS;
1347}
UINT_PTR WPARAM
Definition: minwindef.h:174
#define SS_ICON
Definition: pedump.c:695
#define STM_SETICON
Definition: winuser.h:2128

◆ dialog_line_control()

static UINT dialog_line_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1166 of file dialog.c.

1167{
1168 if (!dialog_add_control( dialog, rec, L"Static", SS_ETCHEDHORZ | SS_SUNKEN))
1169 return ERROR_FUNCTION_FAILED;
1170
1171 return ERROR_SUCCESS;
1172}
#define SS_ETCHEDHORZ
Definition: winuser.h:343
#define SS_SUNKEN
Definition: winuser.h:358

◆ dialog_list_box()

static UINT dialog_list_box ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2725 of file dialog.c.

2726{
2727 struct msi_listbox_info *info;
2728 struct control *control;
2730 LPCWSTR prop;
2731
2732 info = malloc( sizeof *info );
2733 if (!info)
2734 return ERROR_FUNCTION_FAILED;
2735
2737 attributes = MSI_RecordGetInteger( rec, 8 );
2739 style |= LBS_SORT;
2740
2742 if (!control)
2743 {
2744 free(info);
2745 return ERROR_FUNCTION_FAILED;
2746 }
2747
2749
2750 prop = MSI_RecordGetString( rec, 9 );
2752
2753 /* subclass */
2754 info->dialog = dialog;
2755 info->hwnd = control->hwnd;
2756 info->items = NULL;
2757 info->addpos_items = 0;
2760 SetPropW( control->hwnd, L"MSIDATA", info );
2761
2762 if ( control->property )
2764
2765 return ERROR_SUCCESS;
2766}
static UINT dialog_listbox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2706
static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2634
static UINT listbox_add_items(struct msi_listbox_info *info, const WCHAR *property)
Definition: dialog.c:2679
#define LBS_SORT
Definition: pedump.c:679
#define LBS_NOTIFY
Definition: pedump.c:678
#define WC_LISTBOXW
Definition: commctrl.h:4716

◆ dialog_listbox_handler()

static UINT dialog_listbox_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 2706 of file dialog.c.

2707{
2708 struct msi_listbox_info *info;
2709 int index;
2710 LPCWSTR value;
2711
2712 if( HIWORD(param) != LBN_SELCHANGE )
2713 return ERROR_SUCCESS;
2714
2715 info = GetPropW( control->hwnd, L"MSIDATA" );
2718
2719 dialog_set_property( info->dialog->package, control->property, value );
2721
2722 return ERROR_SUCCESS;
2723}
#define LB_GETITEMDATA
Definition: winuser.h:2070
#define LBN_SELCHANGE
Definition: winuser.h:2111
#define LB_GETCURSEL
Definition: winuser.h:2068

Referenced by dialog_list_box().

◆ dialog_listview()

static UINT dialog_listview ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3438 of file dialog.c.

3439{
3440 struct control *control;
3441 LPCWSTR prop;
3443 LVCOLUMNW col;
3444 RECT rc;
3445
3448 attributes = MSI_RecordGetInteger( rec, 8 );
3452 if (!control)
3453 return ERROR_FUNCTION_FAILED;
3454
3455 prop = MSI_RecordGetString( rec, 9 );
3457
3460
3461 col.mask = LVCF_FMT | LVCF_WIDTH;
3462 col.fmt = LVCFMT_LEFT;
3463 col.cx = 16;
3465
3466 GetClientRect( control->hwnd, &rc );
3467 col.cx = rc.right - 16;
3469
3470 if (control->property)
3472
3474
3475 return ERROR_SUCCESS;
3476}
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
static UINT dialog_listview_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3389
static UINT listview_add_items(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3423
#define WS_HSCROLL
Definition: pedump.c:628
#define LVSIL_SMALL
Definition: commctrl.h:2304
#define LVS_NOCOLUMNHEADER
Definition: commctrl.h:2289
#define LVS_SHOWSELALWAYS
Definition: commctrl.h:2272
#define LVS_REPORT
Definition: commctrl.h:2267
#define LVCF_WIDTH
Definition: commctrl.h:2592
#define LVM_SETIMAGELIST
Definition: commctrl.h:2308
#define ILC_COLOR32
Definition: commctrl.h:358
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2637
#define LVCF_FMT
Definition: commctrl.h:2591
#define LVCFMT_LEFT
Definition: commctrl.h:2603
LONG right
Definition: windef.h:108
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ dialog_listview_handler()

static UINT dialog_listview_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 3389 of file dialog.c.

3390{
3391 NMHDR *nmhdr = (NMHDR *)param;
3392
3393 FIXME("code %#x (%d)\n", nmhdr->code, nmhdr->code);
3394
3395 return ERROR_SUCCESS;
3396}

Referenced by dialog_listview().

◆ dialog_map_events()

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

Definition at line 696 of file dialog.c.

697{
698 MSIQUERY *view;
700 {
701 dialog,
702 control
703 };
704
705 if (!MSI_OpenQuery( dialog->package->db, &view,
706 L"SELECT * FROM `EventMapping` WHERE `Dialog_` = '%s' AND `Control_` = '%s'",
707 dialog->name, control ))
708 {
710 msiobj_release( &view->hdr );
711 }
712}
static UINT map_event(MSIRECORD *row, void *param)
Definition: dialog.c:686

Referenced by dialog_add_control().

◆ dialog_maskedit_control()

static UINT dialog_maskedit_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1928 of file dialog.c.

1929{
1930 LPWSTR font_mask, val = NULL, font;
1931 struct msi_maskedit_info *info = NULL;
1933 struct control *control;
1934 LPCWSTR prop, mask;
1935
1936 TRACE("\n");
1937
1938 font_mask = get_deformatted_field( dialog->package, rec, 10 );
1939 font = dialog_get_style( font_mask, &mask );
1940 if( !mask )
1941 {
1942 WARN("mask template is empty\n");
1943 goto end;
1944 }
1945
1947 if( !info )
1948 {
1949 ERR("template %s is invalid\n", debugstr_w(mask));
1950 goto end;
1951 }
1952
1953 info->dialog = dialog;
1954
1956 if( !control )
1957 {
1958 ERR("Failed to create maskedit container\n");
1960 goto end;
1961 }
1963
1964 info->hwnd = control->hwnd;
1965
1966 /* subclass the static control */
1967 info->oldproc = (WNDPROC) SetWindowLongPtrW( info->hwnd, GWLP_WNDPROC,
1969 SetPropW( control->hwnd, L"MSIDATA", info );
1970
1971 prop = MSI_RecordGetString( rec, 9 );
1972 if( prop )
1973 info->prop = wcsdup( prop );
1974
1976
1977 if( prop )
1978 {
1979 val = msi_dup_property( dialog->package->db, prop );
1980 if( val )
1981 {
1983 free( val );
1984 }
1985 }
1986
1987end:
1988 if( ret != ERROR_SUCCESS )
1989 free( info );
1990 free( font_mask );
1991 free( font );
1992 return ret;
1993}
#define WARN(fmt,...)
Definition: precomp.h:61
static struct msi_maskedit_info * dialog_parse_groups(const WCHAR *mask)
Definition: dialog.c:1819
static LRESULT WINAPI MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1764
static void maskedit_set_text(struct msi_maskedit_info *info, const WCHAR *text)
Definition: dialog.c:1795
static WCHAR * get_deformatted_field(MSIPACKAGE *package, MSIRECORD *rec, int field)
Definition: dialog.c:201
static void maskedit_create_children(struct msi_maskedit_info *info, const WCHAR *font)
Definition: dialog.c:1880
GLenum GLint GLuint mask
Definition: glext.h:6028
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
#define SS_OWNERDRAW
Definition: winuser.h:352
#define GWL_EXSTYLE
Definition: winuser.h:862

◆ dialog_oncommand()

static LRESULT dialog_oncommand ( msi_dialog dialog,
WPARAM  param,
HWND  hwnd 
)
static

Definition at line 3730 of file dialog.c.

3731{
3732 struct control *control = NULL;
3733
3734 TRACE( "%p, %#Ix, %p\n", dialog, param, hwnd );
3735
3736 switch (param)
3737 {
3738 case 1: /* enter */
3739 control = dialog_find_control( dialog, dialog->control_default );
3740 break;
3741 case 2: /* escape */
3742 control = dialog_find_control( dialog, dialog->control_cancel );
3743 break;
3744 default:
3746 }
3747
3748 if( control )
3749 {
3750 if( control->handler )
3751 {
3754 }
3755 }
3756
3757 return 0;
3758}
static struct control * dialog_find_control_by_hwnd(msi_dialog *dialog, HWND hwnd)
Definition: dialog.c:189

Referenced by MSIDialog_WndProc().

◆ dialog_oncreate()

static LRESULT dialog_oncreate ( HWND  hwnd,
CREATESTRUCTW cs 
)
static

Definition at line 3677 of file dialog.c.

3678{
3679 msi_dialog *dialog = cs->lpCreateParams;
3680 MSIRECORD *rec = NULL;
3681 LPWSTR title = NULL;
3682 RECT pos;
3683
3684 TRACE("%p %p\n", dialog, dialog->package);
3685
3686 dialog->hwnd = hwnd;
3688
3689 rec = get_dialog_record( dialog );
3690 if( !rec )
3691 {
3692 TRACE("No record found for dialog %s\n", debugstr_w(dialog->name));
3693 return -1;
3694 }
3695
3697
3699
3700 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3701
3702 dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
3703 if (!dialog->default_font)
3704 {
3705 dialog->default_font = wcsdup( L"MS Shell Dlg" );
3706 if (!dialog->default_font)
3707 {
3708 msiobj_release( &rec->hdr );
3709 return -1;
3710 }
3711 }
3712
3713 title = get_deformatted_field( dialog->package, rec, 7 );
3715 free( title );
3716
3717 SetWindowPos( hwnd, 0, pos.left, pos.top,
3718 pos.right - pos.left, pos.bottom - pos.top,
3720
3725 msiobj_release( &rec->hdr );
3726
3727 return 0;
3728}
static INT dialog_get_sans_serif_height(HWND hwnd)
Definition: dialog.c:3551
static void dialog_set_tab_order(msi_dialog *dialog, const WCHAR *first)
Definition: dialog.c:3647
static UINT dialog_build_font_list(msi_dialog *dialog)
Definition: dialog.c:339
static void dialog_adjust_dialog_pos(msi_dialog *dialog, MSIRECORD *rec, RECT *pos)
Definition: dialog.c:3596
static UINT dialog_fill_controls(msi_dialog *dialog)
Definition: dialog.c:3523
#define cs
Definition: i386-dis.c:442
#define GWLP_USERDATA
Definition: treelist.c:63
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_NOREDRAW
Definition: winuser.h:1257
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1258

Referenced by MSIDialog_WndProc().

◆ dialog_onkillfocus()

static BOOL dialog_onkillfocus ( msi_dialog dialog,
struct control control 
)
static

Definition at line 2060 of file dialog.c.

2061{
2062 LPWSTR buf, prop;
2063 BOOL indirect;
2064 BOOL valid;
2065
2068
2070
2071 if ( !dialog_verify_path( buf ) )
2072 {
2073 /* FIXME: display an error message box */
2074 ERR("Invalid path %s\n", debugstr_w( buf ));
2075 valid = FALSE;
2076 SetFocus( control->hwnd );
2077 }
2078 else
2079 {
2080 valid = TRUE;
2081 dialog_set_property( dialog->package, prop, buf );
2082 }
2083
2085
2086 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name),
2087 debugstr_w(prop));
2088
2089 free( buf );
2090 free( prop );
2091
2092 return valid;
2093}
static BOOL dialog_verify_path(const WCHAR *path)
Definition: dialog.c:2048
BOOLEAN valid
HWND WINAPI SetFocus(_In_opt_ HWND)

Referenced by MSIPathEdit_WndProc().

◆ dialog_onnotify()

static LRESULT dialog_onnotify ( msi_dialog dialog,
LPARAM  param 
)
static

Definition at line 3760 of file dialog.c.

3761{
3762 LPNMHDR nmhdr = (LPNMHDR) param;
3764
3765 TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
3766
3767 if ( control && control->handler )
3769
3770 return 0;
3771}
HWND hwndFrom
Definition: winuser.h:3265
struct tagNMHDR * LPNMHDR

Referenced by MSIDialog_WndProc().

◆ dialog_parse_groups()

static struct msi_maskedit_info * dialog_parse_groups ( const WCHAR mask)
static

Definition at line 1819 of file dialog.c.

1820{
1821 struct msi_maskedit_info *info;
1822 int i = 0, n = 0, total = 0;
1823 LPCWSTR p;
1824
1825 TRACE("masked control, template %s\n", debugstr_w(mask));
1826
1827 if( !mask )
1828 return NULL;
1829
1830 info = calloc( 1, sizeof *info );
1831 if( !info )
1832 return info;
1833
1834 p = wcschr(mask, '<');
1835 if( p )
1836 p++;
1837 else
1838 p = mask;
1839
1840 for( i=0; i<MASK_MAX_GROUPS; i++ )
1841 {
1842 /* stop at the end of the string */
1843 if( p[0] == 0 || p[0] == '>' )
1844 {
1845 if (!total)
1846 {
1847 /* create a group for the empty mask */
1848 info->group[0].type = '&';
1849 info->group[0].len = ~0u;
1850 i = 1;
1851 }
1852 break;
1853 }
1854
1855 /* count the number of the same identifier */
1856 for( n=0; p[n] == p[0]; n++ )
1857 ;
1858 info->group[i].ofs = total;
1859 info->group[i].type = p[0];
1860 if( p[n] == '=' )
1861 {
1862 n++;
1863 total++; /* an extra not part of the group */
1864 }
1865 info->group[i].len = n;
1866 total += n;
1867 p += n;
1868 }
1869
1870 TRACE("%d characters in %d groups\n", total, i );
1871 if( i == MASK_MAX_GROUPS )
1872 ERR("too many groups in PIDTemplate %s\n", debugstr_w(mask));
1873
1874 info->num_chars = total;
1875 info->num_groups = i;
1876
1877 return info;
1878}
#define MASK_MAX_GROUPS
Definition: dialog.c:1658
size_t total
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240

Referenced by dialog_maskedit_control().

◆ dialog_pathedit_control()

static UINT dialog_pathedit_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2120 of file dialog.c.

2121{
2122 struct msi_pathedit_info *info;
2123 struct control *control;
2124 LPCWSTR prop;
2125
2126 info = malloc( sizeof *info );
2127 if (!info)
2128 return ERROR_FUNCTION_FAILED;
2129
2132 prop = MSI_RecordGetString( rec, 9 );
2135
2136 info->dialog = dialog;
2137 info->control = control;
2140 SetPropW( control->hwnd, L"MSIDATA", info );
2141
2143
2144 return ERROR_SUCCESS;
2145}
static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2095

◆ dialog_progress_bar()

static UINT dialog_progress_bar ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1997 of file dialog.c.

1998{
1999 struct control *control;
2001
2002 style = WS_VISIBLE;
2003 attributes = MSI_RecordGetInteger( rec, 8 );
2005 style |= PBS_SMOOTH;
2006
2008 if( !control )
2009 return ERROR_FUNCTION_FAILED;
2010
2011 event_subscribe( dialog, L"SetProgress", control->name, L"Progress" );
2012 return ERROR_SUCCESS;
2013}
static void event_subscribe(msi_dialog *dialog, const WCHAR *event, const WCHAR *control, const WCHAR *attribute)
Definition: dialog.c:654
@ msidbControlAttributesProgress95
Definition: msidefs.h:81
#define PROGRESS_CLASSW
Definition: commctrl.h:2181
#define PBS_SMOOTH
Definition: commctrl.h:2185

◆ dialog_radiogroup_control()

static UINT dialog_radiogroup_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2212 of file dialog.c.

2213{
2214 UINT r;
2215 LPCWSTR prop;
2216 struct control *control;
2217 MSIQUERY *view;
2219 MSIPACKAGE *package = dialog->package;
2220 WNDPROC oldproc;
2222
2223 prop = MSI_RecordGetString( rec, 9 );
2224
2225 TRACE("%p %p %s\n", dialog, rec, debugstr_w( prop ));
2226
2227 attr = MSI_RecordGetInteger( rec, 8 );
2229 style |= WS_VISIBLE;
2231 style |= WS_DISABLED;
2233 style |= BS_GROUPBOX;
2234 else
2236
2237 /* Create parent group box to hold radio buttons */
2238 control = dialog_add_control( dialog, rec, L"BUTTON", style );
2239 if( !control )
2240 return ERROR_FUNCTION_FAILED;
2241
2244 SetPropW(control->hwnd, L"MSIDATA", oldproc);
2246
2247 if( prop )
2248 control->property = wcsdup( prop );
2249
2250 /* query the Radio Button table for all control in this group */
2251 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
2252 if( r != ERROR_SUCCESS )
2253 {
2254 ERR("query failed for dialog %s radio group %s\n",
2255 debugstr_w(dialog->name), debugstr_w(prop));
2257 }
2258
2259 group.dialog = dialog;
2260 group.parent = control;
2261 group.propval = msi_dup_property( dialog->package->db, control->property );
2262
2264 msiobj_release( &view->hdr );
2265 free( group.propval );
2266 return r;
2267}
static UINT dialog_create_radiobutton(MSIRECORD *rec, void *param)
Definition: dialog.c:2160
static LRESULT WINAPI MSIRadioGroup_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2193
@ msidbControlAttributesHasBorder
Definition: msidefs.h:103
#define BS_OWNERDRAW
Definition: pedump.c:661
Definition: cookie.c:202

◆ dialog_radiogroup_handler()

static UINT dialog_radiogroup_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 2147 of file dialog.c.

2148{
2149 if (HIWORD(param) != BN_CLICKED)
2150 return ERROR_SUCCESS;
2151
2152 TRACE("clicked radio button %s, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
2153
2155
2157}

Referenced by dialog_create_radiobutton().

◆ dialog_register_class()

static BOOL dialog_register_class ( void  )
static

Definition at line 3904 of file dialog.c.

3905{
3906 WNDCLASSW cls;
3907
3908 ZeroMemory( &cls, sizeof cls );
3910 cls.hInstance = NULL;
3913 cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
3914 cls.lpszMenuName = NULL;
3915 cls.lpszClassName = L"MsiDialogCloseClass";
3916
3917 if( !RegisterClassW( &cls ) )
3918 return FALSE;
3919
3921 cls.lpszClassName = L"MsiHiddenWindow";
3922
3923 if( !RegisterClassW( &cls ) )
3924 return FALSE;
3925
3927
3928 hMsiHiddenWindow = CreateWindowW( L"MsiHiddenWindow", NULL, WS_OVERLAPPED,
3929 0, 0, 100, 100, NULL, NULL, NULL, NULL );
3930 if( !hMsiHiddenWindow )
3931 return FALSE;
3932
3933 return TRUE;
3934}
static LRESULT WINAPI MSIHiddenWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3887
static DWORD uiThreadId
Definition: dialog.c:131
static LRESULT WINAPI MSIDialog_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3783
#define ZeroMemory
Definition: minwinbase.h:31
#define WS_OVERLAPPED
Definition: pedump.c:615
LPCWSTR lpszClassName
Definition: winuser.h:3293
LPCWSTR lpszMenuName
Definition: winuser.h:3292
HBRUSH hbrBackground
Definition: winuser.h:3291
HICON hIcon
Definition: winuser.h:3289
HINSTANCE hInstance
Definition: winuser.h:3288
WNDPROC lpfnWndProc
Definition: winuser.h:3285
HCURSOR hCursor
Definition: winuser.h:3290
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2474
#define IDI_APPLICATION
Definition: winuser.h:712
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2444
#define COLOR_3DFACE
Definition: winuser.h:940

Referenced by dialog_create().

◆ dialog_reset()

static UINT dialog_reset ( msi_dialog dialog)
static

Definition at line 3544 of file dialog.c.

3545{
3546 /* FIXME: should restore the original values of any properties we changed */
3548}

Referenced by event_reset().

◆ dialog_run_message_loop()

static UINT dialog_run_message_loop ( msi_dialog dialog)
static

Definition at line 3843 of file dialog.c.

3844{
3845 DWORD style;
3846 HWND hwnd, parent;
3847
3850
3851 /* create the dialog window, don't show it yet */
3853 if( dialog->attributes & msidbDialogAttributesVisible )
3854 style |= WS_VISIBLE;
3855
3856 if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
3858
3859 parent = dialog->parent ? dialog->parent->hwnd : 0;
3860
3861 hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style,
3863 parent, NULL, NULL, dialog );
3864 if( !hwnd )
3865 {
3866 ERR("Failed to create dialog %s\n", debugstr_w( dialog->name ));
3867 return ERROR_FUNCTION_FAILED;
3868 }
3869
3871 /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
3872
3873 if( dialog->attributes & msidbDialogAttributesModal )
3874 {
3875 while( !dialog->finished )
3876 {
3879 }
3880 }
3881 else
3882 return ERROR_IO_PENDING;
3883
3884 return ERROR_SUCCESS;
3885}
#define ERROR_IO_PENDING
Definition: dderror.h:15
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3831
#define WM_MSI_DIALOG_CREATE
Definition: dialog.c:126
#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_MINIMIZEBOX
Definition: pedump.c:631
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define QS_ALLINPUT
Definition: winuser.h:914
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:786

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

◆ dialog_scale_unit()

static INT dialog_scale_unit ( msi_dialog dialog,
INT  val 
)
static

Definition at line 156 of file dialog.c.

157{
158 return MulDiv( val, dialog->scale, 12 );
159}

Referenced by dialog_adjust_dialog_pos(), dialog_bitmap_control(), dialog_button_control(), and dialog_create_window().

◆ dialog_scrolltext_control()

static UINT dialog_scrolltext_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1250 of file dialog.c.

1251{
1252 struct msi_scrolltext_info *info;
1253 struct control *control;
1254 HMODULE hRichedit;
1255 LPCWSTR text;
1256 DWORD style;
1257
1258 info = malloc( sizeof *info );
1259 if (!info)
1260 return ERROR_FUNCTION_FAILED;
1261
1262 hRichedit = LoadLibraryA("riched20");
1263
1266 control = dialog_add_control( dialog, rec, L"RichEdit20W", style );
1267 if (!control)
1268 {
1269 FreeLibrary( hRichedit );
1270 free( info );
1271 return ERROR_FUNCTION_FAILED;
1272 }
1273
1274 control->hDll = hRichedit;
1275
1276 info->dialog = dialog;
1277 info->control = control;
1278
1279 /* subclass the static control */
1282 SetPropW( control->hwnd, L"MSIDATA", info );
1283
1284 /* add the text into the richedit */
1285 text = MSI_RecordGetString( rec, 10 );
1286 if (text)
1288
1289 return ERROR_SUCCESS;
1290}
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
static void scrolltext_add_text(struct control *control, const WCHAR *text)
Definition: dialog.c:1232
static LRESULT WINAPI MSIScrollText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1183
#define ES_READONLY
Definition: pedump.c:675
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define ES_MULTILINE
Definition: pedump.c:667

◆ dialog_selection_tree()

static UINT dialog_selection_tree ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 2563 of file dialog.c.

2564{
2565 struct control *control;
2566 LPCWSTR prop, control_name;
2567 MSIPACKAGE *package = dialog->package;
2568 DWORD style;
2570
2571 info = malloc( sizeof *info );
2572 if (!info)
2573 return ERROR_FUNCTION_FAILED;
2574
2575 /* create the treeview control */
2579 if (!control)
2580 {
2581 free(info);
2582 return ERROR_FUNCTION_FAILED;
2583 }
2584
2586 control_name = MSI_RecordGetString( rec, 2 );
2588 prop = MSI_RecordGetString( rec, 9 );
2590
2591 /* subclass */
2592 info->dialog = dialog;
2593 info->hwnd = control->hwnd;
2596 SetPropW( control->hwnd, L"MSIDATA", info );
2597
2598 event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
2599
2600 /* initialize it */
2603
2604 return ERROR_SUCCESS;
2605}
static void seltree_create_imagelist(HWND hwnd)
Definition: dialog.c:2470
static void seltree_add_child_features(MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent)
Definition: dialog.c:2420
static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2386
static UINT dialog_seltree_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2507
#define TVS_LINESATROOT
Definition: commctrl.h:3254
#define TVS_HASLINES
Definition: commctrl.h:3253
#define WC_TREEVIEWW
Definition: commctrl.h:3248
#define TVS_HASBUTTONS
Definition: commctrl.h:3252

◆ dialog_seltree_handler()

static UINT dialog_seltree_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 2507 of file dialog.c.

2508{
2509 struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
2511 MSIRECORD *row, *rec;
2514 LPCWSTR dir, title = NULL;
2516
2517 if (tv->hdr.code != TVN_SELCHANGINGW)
2518 return ERROR_SUCCESS;
2519
2520 info->selected = tv->itemNew.hItem;
2521
2522 if (!(tv->itemNew.mask & TVIF_TEXT))
2523 {
2525 if (feature)
2526 title = feature->Title;
2527 }
2528 else
2529 title = tv->itemNew.pszText;
2530
2531 row = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `Feature` WHERE `Title` = '%s'", title );
2532 if (!row)
2533 return ERROR_FUNCTION_FAILED;
2534
2535 rec = MSI_CreateRecord( 1 );
2536
2538 msi_event_fire( dialog->package, L"SelectionDescription", rec );
2539
2540 dir = MSI_RecordGetString( row, 7 );
2541 if (dir)
2542 {
2543 folder = msi_get_loaded_folder( dialog->package, dir );
2544 if (!folder)
2545 {
2547 goto done;
2548 }
2549 MSI_RecordSetStringW( rec, 1, folder->ResolvedTarget );
2550 }
2551 else
2552 MSI_RecordSetStringW( rec, 1, NULL );
2553
2554 msi_event_fire( dialog->package, L"SelectionPath", rec );
2555
2556done:
2557 msiobj_release(&row->hdr);
2558 msiobj_release(&rec->hdr);
2559
2560 return r;
2561}
unsigned int dir
Definition: maze.c:112
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:583
void msi_event_fire(MSIPACKAGE *package, const WCHAR *event, MSIRECORD *rec)
Definition: dialog.c:4421
static MSIFEATURE * seltree_feature_from_item(HWND hwnd, HTREEITEM hItem)
Definition: dialog.c:529
#define TVN_SELCHANGINGW
Definition: commctrl.h:3651
#define TVIF_TEXT
Definition: commctrl.h:3271
struct tagNMTREEVIEWW * LPNMTREEVIEWW
Definition: fci.c:116
TVITEMW itemNew
Definition: commctrl.h:3643
HTREEITEM hItem
Definition: commctrl.h:3322
UINT mask
Definition: commctrl.h:3321
LPWSTR pszText
Definition: commctrl.h:3325

Referenced by dialog_selection_tree().

◆ dialog_send_event()

static UINT dialog_send_event ( msi_dialog dialog,
const WCHAR event,
const WCHAR arg 
)
static

Definition at line 878 of file dialog.c.

879{
880 LPWSTR event_fmt = NULL, arg_fmt = NULL;
881
882 TRACE("Sending control event %s %s\n", debugstr_w(event), debugstr_w(arg));
883
884 deformat_string( dialog->package, event, &event_fmt );
885 deformat_string( dialog->package, arg, &arg_fmt );
886
887 dialog->event_handler( dialog, event_fmt, arg_fmt );
888
889 free( event_fmt );
890 free( arg_fmt );
891
892 return ERROR_SUCCESS;
893}

Referenced by dialog_control_event().

◆ dialog_set_checkbox_state()

static void dialog_set_checkbox_state ( msi_dialog dialog,
struct control control,
UINT  state 
)
static

Definition at line 1102 of file dialog.c.

1103{
1104 LPCWSTR val;
1105
1106 /* if uncheck then the property is set to NULL */
1107 if (!state)
1108 {
1110 return;
1111 }
1112
1113 /* check for a custom state */
1114 if (control->value && control->value[0])
1115 val = control->value;
1116 else
1117 val = L"1";
1118
1120}

Referenced by dialog_checkbox_handler().

◆ dialog_set_control_condition()

static UINT dialog_set_control_condition ( MSIRECORD rec,
void param 
)
static

Definition at line 1438 of file dialog.c.

1439{
1441 struct control *control;
1443 UINT r;
1444
1445 name = MSI_RecordGetString( rec, 2 );
1446 action = MSI_RecordGetString( rec, 3 );
1447 condition = MSI_RecordGetString( rec, 4 );
1450 if (r == MSICONDITION_TRUE && control)
1451 {
1452 TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
1453
1454 /* FIXME: case sensitive? */
1455 if (!wcscmp( action, L"Hide" ))
1457 else if (!wcscmp( action, L"Show" ))
1459 else if (!wcscmp( action, L"Disable" ))
1461 else if (!wcscmp( action, L"Enable" ))
1463 else if (!wcscmp( action, L"Default" ))
1465 else
1466 FIXME("Unhandled action %s\n", debugstr_w(action));
1467 }
1468 return ERROR_SUCCESS;
1469}
action
Definition: namespace.c:707
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)

Referenced by dialog_evaluate_control_conditions().

◆ dialog_set_font()

static UINT dialog_set_font ( msi_dialog dialog,
HWND  hwnd,
const WCHAR name 
)
static

Definition at line 327 of file dialog.c.

328{
329 struct font *font;
330
332 if( font )
334 else
335 ERR("No font entry for %s\n", debugstr_w(name));
336 return ERROR_SUCCESS;
337}
static struct font * dialog_find_font(msi_dialog *dialog, const WCHAR *name)
Definition: dialog.c:316
#define WM_SETFONT
Definition: winuser.h:1678

Referenced by dialog_create_window(), and maskedit_create_children().

◆ dialog_set_property()

static void dialog_set_property ( MSIPACKAGE package,
const WCHAR property,
const WCHAR value 
)
static

Definition at line 522 of file dialog.c.

523{
524 UINT r = msi_set_property( package->db, property, value, -1 );
525 if (r == ERROR_SUCCESS && !wcscmp( property, L"SourceDir" ))
526 msi_reset_source_folders( package );
527}
void msi_reset_source_folders(MSIPACKAGE *package)
Definition: package.c:2089
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100

Referenced by dialog_combobox_handler(), dialog_directorylist_up(), dialog_dirlist_handler(), dialog_edit_handler(), dialog_handle_event(), dialog_listbox_handler(), dialog_onkillfocus(), dialog_radiogroup_handler(), dialog_set_checkbox_state(), dialog_set_property_event(), dialog_volsel_handler(), and mask_control_change().

◆ dialog_set_property_event()

static UINT dialog_set_property_event ( msi_dialog dialog,
const WCHAR event,
const WCHAR arg 
)
static

Definition at line 856 of file dialog.c.

857{
858 LPWSTR p, prop, arg_fmt = NULL;
859 UINT len;
860
861 len = lstrlenW( event );
862 prop = malloc( len * sizeof(WCHAR) );
863 lstrcpyW( prop, &event[1] );
864 p = wcschr( prop, ']' );
865 if (p && (p[1] == 0 || p[1] == ' '))
866 {
867 *p = 0;
868 if (wcscmp( L"{}", arg )) deformat_string( dialog->package, arg, &arg_fmt );
869 dialog_set_property( dialog->package, prop, arg_fmt );
871 free( arg_fmt );
872 }
873 else ERR("Badly formatted property string - what happens?\n");
874 free( prop );
875 return ERROR_SUCCESS;
876}
static void dialog_update_controls(msi_dialog *dialog, const WCHAR *property)
Definition: dialog.c:500

Referenced by dialog_control_event().

◆ dialog_set_tab_order()

static void dialog_set_tab_order ( msi_dialog dialog,
const WCHAR first 
)
static

Definition at line 3647 of file dialog.c.

3648{
3649 struct list tab_chain;
3650 struct control *control;
3651 HWND prev = HWND_TOP;
3652
3653 list_init( &tab_chain );
3654 if (!(control = dialog_find_control( dialog, first ))) return;
3655
3656 dialog->hWndFocus = control->hwnd;
3657 while (control)
3658 {
3660 list_add_tail( &tab_chain, &control->entry );
3661 if (!control->tabnext) break;
3663 }
3664
3665 LIST_FOR_EACH_ENTRY( control, &tab_chain, struct control, entry )
3666 {
3667 SetWindowPos( control->hwnd, prev, 0, 0, 0, 0,
3670 prev = control->hwnd;
3671 }
3672
3673 /* put them back on the main list */
3674 list_move_head( &dialog->controls, &tab_chain );
3675}
Definition: list.h:37
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
Definition: list.h:176
#define SWP_NOREPOSITION
Definition: winuser.h:1261
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
#define HWND_TOP
Definition: winuser.h:1218
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262

Referenced by dialog_oncreate().

◆ dialog_setfocus()

static void dialog_setfocus ( msi_dialog dialog)
static

Definition at line 3773 of file dialog.c.

3774{
3775 HWND hwnd = dialog->hWndFocus;
3776
3779 SetFocus( hwnd );
3780 dialog->hWndFocus = hwnd;
3781}
HWND WINAPI GetNextDlgTabItem(_In_ HWND, _In_opt_ HWND, _In_ BOOL)

Referenced by MSIDialog_WndProc().

◆ dialog_text_control()

static UINT dialog_text_control ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 796 of file dialog.c.

797{
798 struct control *control;
799 struct msi_text_info *info;
800 LPCWSTR text, ptr, prop, control_name;
801 LPWSTR font_name;
802
803 TRACE("%p %p\n", dialog, rec);
804
805 control = dialog_add_control( dialog, rec, L"Static", SS_LEFT | WS_GROUP );
806 if( !control )
808
809 info = malloc( sizeof *info );
810 if( !info )
811 return ERROR_SUCCESS;
812
813 control_name = MSI_RecordGetString( rec, 2 );
815 prop = MSI_RecordGetString( rec, 9 );
817
818 text = MSI_RecordGetString( rec, 10 );
819 font_name = dialog_get_style( text, &ptr );
820 info->font = ( font_name ) ? dialog_find_font( dialog, font_name ) : NULL;
821 free( font_name );
822
823 info->attributes = MSI_RecordGetInteger( rec, 8 );
824 if( info->attributes & msidbControlAttributesTransparent )
826
829 SetPropW( control->hwnd, L"MSIDATA", info );
830
831 event_subscribe( dialog, L"SelectionPath", control_name, L"SelectionPath" );
832 return ERROR_SUCCESS;
833}
static LRESULT WINAPI MSIText_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:762
@ msidbControlAttributesTransparent
Definition: msidefs.h:72
#define WS_EX_TRANSPARENT
Definition: pedump.c:649

◆ dialog_update_all_controls()

static void dialog_update_all_controls ( msi_dialog dialog)
static

Definition at line 511 of file dialog.c.

512{
513 struct control *control;
514
515 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
516 {
517 if ( control->property && control->update )
519 }
520}

Referenced by event_spawn_dialog().

◆ dialog_update_controls()

static void dialog_update_controls ( msi_dialog dialog,
const WCHAR property 
)
static

Definition at line 500 of file dialog.c.

501{
502 struct control *control;
503
504 LIST_FOR_EACH_ENTRY( control, &dialog->controls, struct control, entry )
505 {
508 }
509}

Referenced by dialog_set_property_event().

◆ dialog_update_directory_combo()

static void dialog_update_directory_combo ( msi_dialog dialog,
struct control control 
)
static

Definition at line 2770 of file dialog.c.

2771{
2772 WCHAR *path;
2773
2774 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
2775 return;
2776
2777 if (!(path = get_path_property( dialog, control ))) return;
2780
2783
2784 free( path );
2785}
WCHAR *WINAPI PathRemoveBackslashW(WCHAR *path)
Definition: path.c:2016
void WINAPI PathStripPathW(WCHAR *path)
Definition: path.c:2304
#define CB_INSERTSTRING
Definition: winuser.h:1986

Referenced by dialog_directory_combo(), dialog_directorylist_up(), and dialog_dirlist_handler().

◆ dialog_update_directory_list()

static void dialog_update_directory_list ( msi_dialog dialog,
struct control control 
)
static

Definition at line 2811 of file dialog.c.

2812{
2813 WCHAR dir_spec[MAX_PATH], *path;
2814 WIN32_FIND_DATAW wfd;
2815 LVITEMW item;
2816 HANDLE file;
2817
2818 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryList" )))
2819 return;
2820
2821 /* clear the list-view */
2823
2824 if (!(path = get_path_property( dialog, control ))) return;
2825 lstrcpyW( dir_spec, path );
2826 lstrcatW( dir_spec, L"*" );
2827
2828 file = FindFirstFileW( dir_spec, &wfd );
2830 {
2831 free( path );
2832 return;
2833 }
2834
2835 do
2836 {
2838 continue;
2839
2840 if ( !wcscmp( wfd.cFileName, L"." ) || !wcscmp( wfd.cFileName, L".." ) )
2841 continue;
2842
2843 item.mask = LVIF_TEXT;
2844 item.cchTextMax = MAX_PATH;
2845 item.iItem = 0;
2846 item.iSubItem = 0;
2847 item.pszText = wfd.cFileName;
2848
2850 } while ( FindNextFileW( file, &wfd ) );
2851
2852 free( path );
2853 FindClose( file );
2854}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LVM_DELETEALLITEMS
Definition: commctrl.h:2418
_Field_z_ WCHAR cFileName[MAX_PATH]
Definition: minwinbase.h:291
DWORD dwFileAttributes
Definition: minwinbase.h:283
Definition: fci.c:127

Referenced by dialog_directory_list(), dialog_directorylist_up(), and dialog_dirlist_handler().

◆ dialog_update_pathedit()

static void dialog_update_pathedit ( msi_dialog dialog,
struct control control 
)
static

Definition at line 2034 of file dialog.c.

2035{
2036 WCHAR *path;
2037
2038 if (!control && !(control = dialog_find_control_by_type( dialog, L"PathEdit" )))
2039 return;
2040
2041 if (!(path = get_path_property( dialog, control ))) return;
2043 SendMessageW( control->hwnd, EM_SETSEL, 0, -1 );
2044 free( path );
2045}
#define EM_SETSEL
Definition: winuser.h:2047

Referenced by dialog_directorylist_up(), dialog_dirlist_handler(), dialog_onkillfocus(), and dialog_pathedit_control().

◆ dialog_vcl_add_columns()

static void dialog_vcl_add_columns ( msi_dialog dialog,
struct control control,
MSIRECORD rec 
)
static

Definition at line 3054 of file dialog.c.

3055{
3056 LPCWSTR text = MSI_RecordGetString( rec, 10 );
3057 LPCWSTR begin = text, end;
3058 WCHAR *num;
3059 LVCOLUMNW lvc;
3060 DWORD count = 0;
3061
3062 if (!text) return;
3063
3064 while ((begin = wcschr( begin, '{' )) && count < 5)
3065 {
3066 if (!(end = wcschr( begin, '}' )))
3067 return;
3068
3069 num = malloc( (end - begin + 1) * sizeof(WCHAR) );
3070 if (!num)
3071 return;
3072
3073 lstrcpynW( num, begin + 1, end - begin );
3074 begin += end - begin + 1;
3075
3076 /* empty braces or '0' hides the column */
3077 if ( !num[0] || !wcscmp( num, L"0" ) )
3078 {
3079 count++;
3080 free( num );
3081 continue;
3082 }
3083
3084 /* the width must be a positive number
3085 * if a width is invalid, all remaining columns are hidden
3086 */
3087 if ( !wcsncmp( num, L"-", 1 ) || !str_is_number( num ) ) {
3088#ifdef __REACTOS__
3089 // Skip in case of prefix the string of displayed characters with {\style} or {&style}.
3090 if (count == 0 && (!wcsncmp(num, L"\\", 1) || !wcsncmp(num, L"&", 1)))
3091 {
3092 FIXME("Style prefix not supported\n");
3093 free(num);
3094 continue;
3095 }
3096#endif
3097 free( num );
3098 return;
3099 }
3100
3101 ZeroMemory( &lvc, sizeof(lvc) );
3103 lvc.cx = wcstol( num, NULL, 10 );
3105
3107 free( lvc.pszText );
3108 free( num );
3109 }
3110}
static WCHAR * dialog_get_uitext(msi_dialog *dialog, const WCHAR *key)
Definition: dialog.c:438
static const WCHAR column_keys[][80]
Definition: dialog.c:3045
static BOOL str_is_number(LPCWSTR str)
Definition: dialog.c:3034
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:523
#define LVCF_SUBITEM
Definition: commctrl.h:2594
#define LVCF_TEXT
Definition: commctrl.h:2593
LPWSTR pszText
Definition: commctrl.h:2572

Referenced by dialog_volumecost_list().

◆ dialog_vcl_add_drives()

static void dialog_vcl_add_drives ( msi_dialog dialog,
struct control control 
)
static

Definition at line 3134 of file dialog.c.

3135{
3137 LONGLONG difference, cost;
3138 WCHAR size_text[MAX_PATH];
3139 WCHAR cost_text[MAX_PATH];
3140 LPWSTR drives, ptr;
3141 LVITEMW lvitem;
3142#ifdef __REACTOS__
3143 DWORD size;
3144#else
3145 DWORD size, flags;
3146#endif
3147 int i = 0;
3148
3149 cost = vcl_get_cost(dialog) * 512;
3150 StrFormatByteSizeW(cost, cost_text, MAX_PATH);
3151
3153 if ( !size ) return;
3154
3155 drives = malloc( (size + 1) * sizeof(WCHAR) );
3156 if ( !drives ) return;
3157
3158 GetLogicalDriveStringsW( size, drives );
3159
3160 ptr = drives;
3161 while (*ptr)
3162 {
3163#ifdef __REACTOS__
3165#else
3166 if (GetVolumeInformationW(ptr, NULL, 0, NULL, 0, &flags, NULL, 0) &&
3168#endif
3169 {
3170 ptr += lstrlenW(ptr) + 1;
3171 continue;
3172 }
3173
3174 lvitem.mask = LVIF_TEXT;
3175 lvitem.iItem = i;
3176 lvitem.iSubItem = 0;
3177 lvitem.pszText = ptr;
3178 lvitem.cchTextMax = lstrlenW(ptr) + 1;
3180
3182 difference = unused.QuadPart - cost;
3183
3184 StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH);
3185 lvitem.iSubItem = 1;
3186 lvitem.pszText = size_text;
3187 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3188 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3189
3190 StrFormatByteSizeW(unused.QuadPart, size_text, MAX_PATH);
3191 lvitem.iSubItem = 2;
3192 lvitem.pszText = size_text;
3193 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3194 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3195
3196 lvitem.iSubItem = 3;
3197 lvitem.pszText = cost_text;
3198 lvitem.cchTextMax = lstrlenW(cost_text) + 1;
3199 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3200
3201 StrFormatByteSizeW(difference, size_text, MAX_PATH);
3202 lvitem.iSubItem = 4;
3203 lvitem.pszText = size_text;
3204 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3205 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3206
3207 ptr += lstrlenW(ptr) + 1;
3208 i++;
3209 }
3210
3211 free( drives );
3212}
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
UINT WINAPI GetDriveTypeW(IN LPCWSTR lpRootPathName)
Definition: disk.c:497
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
BOOL WINAPI GetVolumeInformationW(IN LPCWSTR lpRootPathName, IN LPWSTR lpVolumeNameBuffer, IN DWORD nVolumeNameSize, OUT LPDWORD lpVolumeSerialNumber OPTIONAL, OUT LPDWORD lpMaximumComponentLength OPTIONAL, OUT LPDWORD lpFileSystemFlags OPTIONAL, OUT LPWSTR lpFileSystemNameBuffer OPTIONAL, IN DWORD nFileSystemNameSize)
Definition: volume.c:226
static LONGLONG vcl_get_cost(msi_dialog *dialog)
Definition: dialog.c:3112
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:854
#define FILE_READ_ONLY_VOLUME
Definition: from_kernel.h:246
GLsizeiptr size
Definition: glext.h:5919
WORD unused[29]
Definition: crypt.c:1298
#define LVM_SETITEMW
Definition: commctrl.h:2402
LPWSTR pszText
Definition: commctrl.h:2370
int iSubItem
Definition: commctrl.h:2367
int cchTextMax
Definition: commctrl.h:2371
UINT mask
Definition: commctrl.h:2365
int64_t LONGLONG
Definition: typedefs.h:68
#define DRIVE_FIXED
Definition: winbase.h:277

Referenced by dialog_volumecost_list().

◆ dialog_verify_path()

static BOOL dialog_verify_path ( const WCHAR path)
static

Definition at line 2048 of file dialog.c.

2049{
2050 if ( !path[0] )
2051 return FALSE;
2052
2053 if ( PathIsRelativeW( path ) )
2054 return FALSE;
2055
2056 return TRUE;
2057}
BOOL WINAPI PathIsRelativeW(const WCHAR *path)
Definition: path.c:1006

Referenced by dialog_onkillfocus().

◆ dialog_volsel_handler()

static UINT dialog_volsel_handler ( msi_dialog dialog,
struct control control,
WPARAM  param 
)
static

Definition at line 3234 of file dialog.c.

3235{
3237 LPWSTR prop;
3238 BOOL indirect;
3239 int index;
3240
3241 if (HIWORD(param) != CBN_SELCHANGE)
3242 return ERROR_SUCCESS;
3243
3245 if ( index == CB_ERR )
3246 {
3247 ERR("No ComboBox item selected!\n");
3248 return ERROR_FUNCTION_FAILED;
3249 }
3250
3252
3255
3256 dialog_set_property( dialog->package, prop, text );
3257
3258 free( prop );
3259 return ERROR_SUCCESS;
3260}
#define CB_GETLBTEXT
Definition: winuser.h:1981

Referenced by dialog_volumeselect_combo().

◆ dialog_volumecost_list()

static UINT dialog_volumecost_list ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3214 of file dialog.c.

3215{
3216 struct control *control;
3217 DWORD style;
3218
3223 if (!control)
3224 return ERROR_FUNCTION_FAILED;
3225
3228
3229 return ERROR_SUCCESS;
3230}
static void dialog_vcl_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3134
static void dialog_vcl_add_columns(msi_dialog *dialog, struct control *control, MSIRECORD *rec)
Definition: dialog.c:3054

◆ dialog_volumeselect_combo()

static UINT dialog_volumeselect_combo ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3285 of file dialog.c.

3286{
3287 struct control *control;
3288 LPCWSTR prop;
3289 DWORD style;
3290
3291 /* FIXME: CBS_OWNERDRAWFIXED */
3296 if (!control)
3297 return ERROR_FUNCTION_FAILED;
3298
3301 prop = MSI_RecordGetString( rec, 9 );
3303
3305
3306 return ERROR_SUCCESS;
3307}
static void dialog_vsc_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3262
static UINT dialog_volsel_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3234
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
#define WS_EX_LTRREADING
Definition: winuser.h:393
#define WS_EX_LEFT
Definition: winuser.h:391

◆ dialog_vsc_add_drives()

static void dialog_vsc_add_drives ( msi_dialog dialog,
struct control control 
)
static

Definition at line 3262 of file dialog.c.

3263{
3264 LPWSTR drives, ptr;
3265 DWORD size;
3266
3268 if ( !size ) return;
3269
3270 drives = malloc( (size + 1) * sizeof(WCHAR) );
3271 if ( !drives ) return;
3272
3273 GetLogicalDriveStringsW( size, drives );
3274
3275 ptr = drives;
3276 while (*ptr)
3277 {
3279 ptr += lstrlenW(ptr) + 1;
3280 }
3281
3282 free( drives );
3283}

Referenced by dialog_volumeselect_combo().

◆ event_add_local()

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

Definition at line 4373 of file dialog.c.

4374{
4376
4377 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4378 {
4379 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4380 {
4381 if (feature->ActionRequest != INSTALLSTATE_LOCAL)
4382 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4384 }
4385 }
4386 return ERROR_SUCCESS;
4387}
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:915
@ INSTALLSTATE_LOCAL
Definition: msi.h:46

◆ event_add_source()

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

Definition at line 4405 of file dialog.c.

4406{
4408
4409 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4410 {
4411 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4412 {
4413 if (feature->ActionRequest != INSTALLSTATE_SOURCE)
4414 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4416 }
4417 }
4418 return ERROR_SUCCESS;
4419}
@ INSTALLSTATE_SOURCE
Definition: msi.h:47

◆ event_cleanup_subscriptions()

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

Definition at line 4045 of file dialog.c.

4046{
4047 struct list *item, *next;
4048
4050 {
4051 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4052
4053 if (wcscmp( sub->dialog->name, dialog )) continue;
4054 list_remove( &sub->entry );
4055 free_subscriber( sub );
4056 }
4057}
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4037
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:99
struct list entry
Definition: dialog.c:104
msi_dialog * dialog
Definition: dialog.c:105
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 4523 of file dialog.c.

4524{
4526}
static UINT dialog_directorylist_new(msi_dialog *dialog)
Definition: dialog.c:2915

◆ event_directory_list_up()

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

Definition at line 4518 of file dialog.c.

4519{
4521}
static UINT dialog_directorylist_up(msi_dialog *dialog)
Definition: dialog.c:2856

◆ event_do_action()

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

Definition at line 4367 of file dialog.c.

4368{
4369 ACTION_PerformAction(dialog->package, argument);
4370 return ERROR_SUCCESS;
4371}
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7640

◆ event_do_dialog()

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

Definition at line 4254 of file dialog.c.

4255{
4257 UINT r;
4258 INT retval;
4259
4260 /* create a new dialog */
4262 if (dialog)
4263 {
4264 /* kill the current modeless dialog */
4265 if (destroy_modeless && package->dialog)
4266 {
4267 msi_dialog_destroy( package->dialog );
4268 package->dialog = NULL;
4269 }
4270
4271 /* modeless dialogs return an error message */
4273 if (r == ERROR_SUCCESS)
4274 {
4275 retval = dialog->retval;
4277 return retval;
4278 }
4279 else
4280 {
4281 package->dialog = dialog;
4282 return IDOK;
4283 }
4284 }
4285 else return 0;
4286}
static UINT dialog_event_handler(msi_dialog *, const WCHAR *, const WCHAR *)
Definition: dialog.c:4565
static msi_dialog * dialog_create(MSIPACKAGE *package, const WCHAR *name, msi_dialog *parent, UINT(*event_handler)(msi_dialog *, const WCHAR *, const WCHAR *))
Definition: dialog.c:3936
msi_dialog * dialog
Definition: msipriv.h:453
int retval
Definition: wcstombs.cpp:91
#define IDOK
Definition: winuser.h:841

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 4289 of file dialog.c.

4290{
4291 if (!wcscmp( argument, L"Exit" ))
4292 dialog->retval = IDCANCEL;
4293 else if (!wcscmp( argument, L"Retry" ))
4294 dialog->retval = IDRETRY;
4295 else if (!wcscmp( argument, L"Ignore" ))
4296 dialog->retval = IDOK;
4297 else if (!wcscmp( argument, L"Return" ))
4298 dialog->retval = 0;
4299 else
4300 {
4301 ERR("Unknown argument string %s\n", debugstr_w(argument));
4302 dialog->retval = IDABORT;
4303 }
4304 event_cleanup_subscriptions( dialog->package, dialog->name );
4306 return ERROR_SUCCESS;
4307}
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4045
static void dialog_end_dialog(msi_dialog *dialog)
Definition: dialog.c:3984
#define IDCANCEL
Definition: winuser.h:842
#define IDABORT
Definition: winuser.h:843
#define IDRETRY
Definition: winuser.h:844

Referenced by pending_event_end_dialog().

◆ event_new_dialog()

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

Definition at line 4318 of file dialog.c.

4319{
4320 /* store the name of the next dialog, and signal this one to end */
4321 dialog->package->next_dialog = wcsdup( argument );
4324 return ERROR_SUCCESS;
4325}
void msi_event_cleanup_all_subscriptions(MSIPACKAGE *package)
Definition: dialog.c:4111

Referenced by pending_event_new_dialog().

◆ event_reinstall()

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

Definition at line 4533 of file dialog.c.

4534{
4535 return msi_set_property( dialog->package->db, L"REINSTALL", argument, -1 );
4536}

◆ event_reinstall_mode()

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

Definition at line 4528 of file dialog.c.

4529{
4530 return msi_set_property( dialog->package->db, L"REINSTALLMODE", argument, -1 );
4531}

◆ event_remove()

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

Definition at line 4389 of file dialog.c.

4390{
4392
4393 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4394 {
4395 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4396 {
4397 if (feature->ActionRequest != INSTALLSTATE_ABSENT)
4398 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4400 }
4401 }
4402 return ERROR_SUCCESS;
4403}
@ INSTALLSTATE_ABSENT
Definition: msi.h:45

◆ event_reset()

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

Definition at line 4452 of file dialog.c.

4453{
4455 return ERROR_SUCCESS;
4456}
static UINT dialog_reset(msi_dialog *dialog)
Definition: dialog.c:3544

◆ event_set_install_level()

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

Definition at line 4510 of file dialog.c.

4511{
4512 int level = wcstol( argument, NULL, 10 );
4513
4514 TRACE("setting install level to %d\n", level);
4515 return MSI_SetInstallLevel( dialog->package, level );
4516}
UINT MSI_SetInstallLevel(MSIPACKAGE *package, int iInstallLevel)
Definition: install.c:1571
GLint level
Definition: gl.h:1546

◆ event_set_target_path()

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

Definition at line 4434 of file dialog.c.

4435{
4436 WCHAR *path = msi_dup_property( dialog->package->db, argument );
4437 MSIRECORD *rec = MSI_CreateRecord( 1 );
4439
4440 MSI_RecordSetStringW( rec, 1, path );
4441 msi_event_fire( dialog->package, L"SelectionPath", rec );
4442 if (path)
4443 {
4444 /* failure to set the path halts the executing of control events */
4445 r = MSI_SetTargetPathW( dialog->package, argument, path );
4446 free( path );
4447 }
4448 msiobj_release( &rec->hdr );
4449 return r;
4450}
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:564

◆ event_spawn_dialog()

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

Definition at line 4336 of file dialog.c.

4337{
4338 INT r;
4339 /* don't destroy a modeless dialogs that might be our parent */
4340 r = event_do_dialog( dialog->package, argument, dialog, FALSE );
4341 if (r != 0)
4342 {
4343 dialog->retval = r;
4345 }
4346 else
4348
4349 return ERROR_SUCCESS;
4350}
static void dialog_update_all_controls(msi_dialog *dialog)
Definition: dialog.c:511

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 4361 of file dialog.c.

4362{
4363 FIXME("doing nothing\n");
4364 return ERROR_SUCCESS;
4365}

◆ event_subscribe()

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

Definition at line 654 of file dialog.c.

655{
656 struct subscriber *sub;
657
658 TRACE("dialog %s event %s control %s attribute %s\n", debugstr_w(dialog->name), debugstr_w(event),
660
661 LIST_FOR_EACH_ENTRY( sub, &dialog->package->subscriptions, struct subscriber, entry )
662 {
663 if (sub->dialog == dialog &&
664 !wcsicmp( sub->event, event ) &&
665 !wcsicmp( sub->control, control ) &&
666 !wcsicmp( sub->attribute, attribute ))
667 {
668 TRACE("already subscribed\n");
669 return;
670 };
671 }
672 if (!(sub = malloc( sizeof(*sub) ))) return;
673 sub->dialog = dialog;
674 sub->event = wcsdup( event );
675 sub->control = wcsdup( control );
676 sub->attribute = wcsdup( attribute );
677 list_add_tail( &dialog->package->subscriptions, &sub->entry );
678}
WCHAR * event
Definition: dialog.c:106
WCHAR * attribute
Definition: dialog.c:108
WCHAR * control
Definition: dialog.c:107

Referenced by dialog_progress_bar(), dialog_selection_tree(), dialog_text_control(), and map_event().

◆ event_validate_product_id()

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

Definition at line 4538 of file dialog.c.

4539{
4540 return msi_validate_product_id( dialog->package );
4541}
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7188

◆ free_subscriber()

static void free_subscriber ( struct subscriber sub)
static

Definition at line 4037 of file dialog.c.

4038{
4039 free( sub->event );
4040 free( sub->control );
4041 free( sub->attribute );
4042 free( sub );
4043}

Referenced by event_cleanup_subscriptions(), and msi_event_cleanup_all_subscriptions().

◆ get_binary_name()

static WCHAR * get_binary_name ( MSIPACKAGE package,
MSIRECORD rec 
)
static

Definition at line 836 of file dialog.c.

837{
838 WCHAR *p, *text;
839
840 text = get_deformatted_field( package, rec, 10 );
841 if (!text)
842 return NULL;
843
844 p = text;
845 while (*p && *p != '{') p++;
846 if (!*p++) return text;
847
848 while (*p && *p != '}') p++;
849 if (!*p++) return text;
850
851 p = wcsdup( p );
852 free( text );
853 return p;
854}

Referenced by dialog_bitmap_control(), dialog_button_control(), and dialog_icon_control().

◆ get_checkbox_value()

static WCHAR * get_checkbox_value ( msi_dialog dialog,
const WCHAR prop 
)
static

Definition at line 1063 of file dialog.c.

1064{
1065 MSIRECORD *rec = NULL;
1066 LPWSTR ret = NULL;
1067
1068 /* find if there is a value associated with the checkbox */
1069 rec = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `CheckBox` WHERE `Property` = '%s'", prop );
1070 if (!rec)
1071 return ret;
1072
1073 ret = get_deformatted_field( dialog->package, rec, 2 );
1074 if( ret && !ret[0] )
1075 {
1076 free( ret );
1077 ret = NULL;
1078 }
1079 msiobj_release( &rec->hdr );
1080 if (ret)
1081 return ret;
1082
1083 ret = msi_dup_property( dialog->package->db, prop );
1084 if( ret && !ret[0] )
1085 {
1086 free( ret );
1087 ret = NULL;
1088 }
1089
1090 return ret;
1091}

Referenced by dialog_checkbox_control().

◆ get_deformatted_field()

static WCHAR * get_deformatted_field ( MSIPACKAGE package,
MSIRECORD rec,
int  field 
)
static

Definition at line 201 of file dialog.c.

202{
204 LPWSTR ret = NULL;
205
206 if (str)
207 deformat_string( package, str, &ret );
208 return ret;
209}
const WCHAR * str
Definition: parser.c:44

Referenced by dialog_maskedit_control(), dialog_oncreate(), get_binary_name(), and get_checkbox_value().

◆ get_dialog_record()

static MSIRECORD * get_dialog_record ( msi_dialog dialog)
static

Definition at line 3582 of file dialog.c.

3583{
3584 MSIPACKAGE *package = dialog->package;
3585 MSIRECORD *rec = NULL;
3586
3587 TRACE("%p %s\n", dialog, debugstr_w(dialog->name) );
3588
3589 rec = MSI_QueryGetRecord( package->db, L"SELECT * FROM `Dialog` WHERE `Dialog` = '%s'", dialog->name );
3590 if( !rec )
3591 WARN("query failed for dialog %s\n", debugstr_w(dialog->name));
3592
3593 return rec;
3594}

Referenced by dialog_create(), and dialog_oncreate().

◆ get_path_property()

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

Definition at line 2024 of file dialog.c.

2025{
2026 WCHAR *prop, *path;
2028 if (!(prop = dialog_dup_property( dialog, control->property, indirect ))) return NULL;
2029 path = dialog_dup_property( dialog, prop, TRUE );
2030 free( prop );
2031 return path;
2032}

Referenced by dialog_directorylist_new(), dialog_update_directory_combo(), dialog_update_directory_list(), and dialog_update_pathedit().

◆ get_unique_folder_name()

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

Definition at line 2887 of file dialog.c.

2888{
2889 WCHAR newfolder[MAX_PATH], *path, *ptr;
2890 int len, count = 2;
2891
2892 len = LoadStringW( msi_hInstance, IDS_NEWFOLDER, newfolder, ARRAY_SIZE(newfolder) );
2893 len += lstrlenW(root) + 1;
2894 if (!(path = malloc( (len + 4) * sizeof(WCHAR) ))) return NULL;
2895 lstrcpyW( path, root );
2896 lstrcatW( path, newfolder );
2897
2898 for (;;)
2899 {
2901 if (count > 99)
2902 {
2903 free( path );
2904 return NULL;
2905 }
2906 swprintf( path, len + 4, L"%s%s %u", root, newfolder, count++ );
2907 }
2908
2909 ptr = wcsrchr( path, '\\' ) + 1;
2910 *ret_len = lstrlenW(ptr);
2911 memmove( path, ptr, *ret_len * sizeof(WCHAR) );
2912 return path;
2913}
#define wcsrchr
Definition: compat.h:16
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:636
HINSTANCE msi_hInstance
Definition: msi_main.c:51
#define swprintf
Definition: precomp.h:40
#define IDS_NEWFOLDER
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static JOBOBJECTINFOCLASS LPVOID DWORD LPDWORD ret_len
Definition: process.c:81
#define LoadStringW
Definition: utils.h:64
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

Referenced by dialog_directorylist_new().

◆ get_window_text()

static WCHAR * get_window_text ( HWND  hwnd)
static

Definition at line 134 of file dialog.c.

135{
136 UINT sz, r;
137 WCHAR *buf, *new_buf;
138
139 sz = 0x20;
140 buf = malloc( sz * sizeof(WCHAR) );
141 while ( buf )
142 {
143 r = GetWindowTextW( hwnd, buf, sz );
144 if ( r < (sz - 1) )
145 break;
146 sz *= 2;
147 new_buf = realloc( buf, sz * sizeof(WCHAR) );
148 if ( !new_buf )
149 free( buf );
150 buf = new_buf;
151 }
152
153 return buf;
154}
#define realloc
Definition: debug_ros.c:6
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382

Referenced by dialog_combobox_handler(), dialog_edit_handler(), and dialog_onkillfocus().

◆ listbox_add_item()

static UINT listbox_add_item ( MSIRECORD rec,
void param 
)
static

Definition at line 2662 of file dialog.c.

2663{
2664 struct msi_listbox_info *info = param;
2666 int pos;
2667
2668 value = MSI_RecordGetString( rec, 3 );
2669 text = MSI_RecordGetString( rec, 4 );
2670
2671 info->items[info->addpos_items] = wcsdup( value );
2672
2673 pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
2674 SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
2675 info->addpos_items++;
2676 return ERROR_SUCCESS;
2677}
#define LB_ADDSTRING
Definition: winuser.h:2060
#define LB_SETITEMDATA
Definition: winuser.h:2101

Referenced by listbox_add_items().

◆ listbox_add_items()

static UINT listbox_add_items ( struct msi_listbox_info info,
const WCHAR property 
)
static

Definition at line 2679 of file dialog.c.

2680{
2681 MSIQUERY *view;
2682 DWORD count;
2683 UINT r;
2684
2685 r = MSI_OpenQuery( info->dialog->package->db, &view,
2686 L"SELECT * FROM `ListBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
2687 if ( r != ERROR_SUCCESS )
2688 return r;
2689
2690 /* just get the number of records */
2691 count = 0;
2693 if (r != ERROR_SUCCESS)
2694 {
2695 msiobj_release( &view->hdr );
2696 return r;
2697 }
2698 info->num_items = count;
2699 info->items = malloc( sizeof(*info->items) * count );
2700
2702 msiobj_release( &view->hdr );
2703 return r;
2704}
static UINT listbox_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:2662

Referenced by dialog_list_box().

◆ listview_add_item()

static UINT listview_add_item ( MSIRECORD rec,
void param 
)
static

Definition at line 3398 of file dialog.c.

3399{
3400 struct listview_param *lv_param = (struct listview_param *)param;
3402 LVITEMW item;
3403 HICON hIcon;
3404
3405 text = MSI_RecordGetString( rec, 4 );
3406 binary = MSI_RecordGetString( rec, 5 );
3407 hIcon = load_icon( lv_param->dialog->package->db, binary, 0 );
3408
3409 TRACE("Adding: text %s, binary %s, icon %p\n", debugstr_w(text), debugstr_w(binary), hIcon);
3410
3411 memset( &item, 0, sizeof(item) );
3412 item.mask = LVIF_TEXT | LVIF_IMAGE;
3413 deformat_string( lv_param->dialog->package, text, &item.pszText );
3414 item.iImage = ImageList_AddIcon( lv_param->control->hImageList, hIcon );
3415 item.iItem = item.iImage;
3416 SendMessageW( lv_param->control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&item );
3417
3418 DestroyIcon( hIcon );
3419
3420 return ERROR_SUCCESS;
3421}
const GLuint GLenum const GLvoid * binary
Definition: glext.h:7538
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define LVIF_IMAGE
Definition: commctrl.h:2315
struct control * control
Definition: dialog.c:3386
msi_dialog * dialog
Definition: dialog.c:3385
MSIPACKAGE * package
Definition: dialog.c:82

Referenced by listview_add_items().

◆ listview_add_items()

static UINT listview_add_items ( msi_dialog dialog,
struct control control 
)
static

Definition at line 3423 of file dialog.c.

3424{
3425 MSIQUERY *view;
3426 struct listview_param lv_param = { dialog, control };
3427
3428 if (MSI_OpenQuery( dialog->package->db, &view, L"SELECT * FROM `ListView` WHERE `Property` = '%s' ORDER BY `Order`",
3430 {
3432 msiobj_release( &view->hdr );
3433 }
3434
3435 return ERROR_SUCCESS;
3436}
static UINT listview_add_item(MSIRECORD *rec, void *param)
Definition: dialog.c:3398

Referenced by dialog_listview().

◆ load_icon()

static HICON load_icon ( MSIDATABASE db,
const WCHAR text,
UINT  attributes 
)
static

Definition at line 477 of file dialog.c.

478{
479 DWORD cx = 0, cy = 0, flags;
480
483 {
484 flags &= ~LR_DEFAULTSIZE;
486 {
487 cx += 16;
488 cy += 16;
489 }
491 {
492 cx += 32;
493 cy += 32;
494 }
495 /* msidbControlAttributesIconSize48 handled by above logic */
496 }
497 return load_image( db, text, IMAGE_ICON, cx, cy, flags );
498}
static HANDLE load_image(MSIDATABASE *db, const WCHAR *name, UINT type, UINT cx, UINT cy, UINT flags)
Definition: dialog.c:450
@ msidbControlAttributesIconSize32
Definition: msidefs.h:100
@ msidbControlAttributesIconSize16
Definition: msidefs.h:99

Referenced by dialog_button_control(), dialog_icon_control(), and listview_add_item().

◆ load_image()

static HANDLE load_image ( MSIDATABASE db,
const WCHAR name,
UINT  type,
UINT  cx,
UINT  cy,
UINT  flags 
)
static

Definition at line 450 of file dialog.c.

451{
452 MSIRECORD *rec;
453 HANDLE himage = NULL;
454 LPWSTR tmp;
455 UINT r;
456
457 TRACE("%p %s %u %u %08x\n", db, debugstr_w(name), cx, cy, flags);
458
459 if (!(tmp = msi_create_temp_file( db ))) return NULL;
460
461 rec = MSI_QueryGetRecord( db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", name );
462 if( rec )
463 {
464 r = MSI_RecordStreamToFile( rec, 2, tmp );
465 if( r == ERROR_SUCCESS )
466 {
467 himage = LoadImageW( 0, tmp, type, cx, cy, flags );
468 }
469 msiobj_release( &rec->hdr );
470 }
471 DeleteFileW( tmp );
472
473 free( tmp );
474 return himage;
475}
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
WCHAR * msi_create_temp_file(MSIDATABASE *db)
Definition: custom.c:215
UINT MSI_RecordStreamToFile(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:900
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572

Referenced by load_icon().

◆ load_picture()

static HBITMAP load_picture ( MSIDATABASE db,
const WCHAR name,
INT  cx,
INT  cy,
DWORD  flags 
)
static

Definition at line 946 of file dialog.c.

947{
948 HBITMAP hOleBitmap = 0, hBitmap = 0, hOldSrcBitmap, hOldDestBitmap;
949 MSIRECORD *rec = NULL;
950 IStream *stm = NULL;
951 IPicture *pic = NULL;
952 HDC srcdc, destdc;
953 BITMAP bm;
954 UINT r;
955
956 rec = MSI_QueryGetRecord( db, L"SELECT * FROM `Binary` WHERE `Name` = '%s'", name );
957 if (!rec)
958 goto end;
959
960 r = MSI_RecordGetIStream( rec, 2, &stm );
961 msiobj_release( &rec->hdr );
962 if (r != ERROR_SUCCESS)
963 goto end;
964
965 r = OleLoadPicture( stm, 0, TRUE, &IID_IPicture, (void **)&pic );
966 IStream_Release( stm );
967 if (FAILED( r ))
968 {
969 ERR("failed to load picture\n");
970 goto end;
971 }
972
973 r = IPicture_get_Handle( pic, (OLE_HANDLE *)&hOleBitmap );
974 if (FAILED( r ))
975 {
976 ERR("failed to get bitmap handle\n");
977 goto end;
978 }
979
980 /* make the bitmap the desired size */
981 r = GetObjectW( hOleBitmap, sizeof(bm), &bm );
982 if (r != sizeof(bm))
983 {
984 ERR("failed to get bitmap size\n");
985 goto end;
986 }
987
988 if (flags & LR_DEFAULTSIZE)
989 {
990 cx = bm.bmWidth;
991 cy = bm.bmHeight;
992 }
993
994 srcdc = CreateCompatibleDC( NULL );
995 hOldSrcBitmap = SelectObject( srcdc, hOleBitmap );
996 destdc = CreateCompatibleDC( NULL );
997 hBitmap = CreateCompatibleBitmap( srcdc, cx, cy );
998 hOldDestBitmap = SelectObject( destdc, hBitmap );
999 StretchBlt( destdc, 0, 0, cx, cy, srcdc, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY );
1000 SelectObject( srcdc, hOldSrcBitmap );
1001 SelectObject( destdc, hOldDestBitmap );
1002 DeleteDC( srcdc );
1003 DeleteDC( destdc );
1004
1005end:
1006 if (pic) IPicture_Release( pic );
1007 return hBitmap;
1008}
static HBITMAP hBitmap
Definition: timezone.c:26
HRESULT WINAPI OleLoadPicture(LPSTREAM lpstream, LONG lSize, BOOL fRunmode, REFIID riid, LPVOID *ppvObj)
Definition: olepicture.c:2344
#define FAILED(hr)
Definition: intsafe.h:51
static HBITMAP
Definition: button.c:44
UINT MSI_RecordGetIStream(MSIRECORD *, UINT, IStream **)
Definition: record.c:852
const GUID IID_IPicture
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
BOOL WINAPI DeleteDC(_In_ HDC)

Referenced by dialog_bitmap_control(), and dialog_button_control().

◆ map_event()

static UINT map_event ( MSIRECORD row,
void param 
)
static

Definition at line 686 of file dialog.c.

687{
688 struct dialog_control *dc = param;
689 const WCHAR *event = MSI_RecordGetString( row, 3 );
690 const WCHAR *attribute = MSI_RecordGetString( row, 4 );
691
692 event_subscribe( dc->dialog, event, dc->control, attribute );
693 return ERROR_SUCCESS;
694}
HDC dc
Definition: cylfrac.c:34

Referenced by dialog_map_events().

◆ mask_control_change()

static void mask_control_change ( struct msi_maskedit_info info)
static

Definition at line 1694 of file dialog.c.

1695{
1696 LPWSTR val;
1697 UINT i, n, r;
1698
1699 val = malloc( (info->num_chars + 1) * sizeof(WCHAR) );
1700 for( i=0, n=0; i<info->num_groups; i++ )
1701 {
1702 if (info->group[i].len == ~0u)
1703 {
1704 UINT len = SendMessageW( info->group[i].hwnd, WM_GETTEXTLENGTH, 0, 0 );
1705 val = realloc( val, (len + 1) * sizeof(WCHAR) );
1706 GetWindowTextW( info->group[i].hwnd, val, len + 1 );
1707 }
1708 else
1709 {
1710 if (info->group[i].len + n > info->num_chars)
1711 {
1712 ERR("can't fit control %d text into template\n",i);
1713 break;
1714 }
1715 if (!mask_editable(info->group[i].type))
1716 {
1717 for(r=0; r<info->group[i].len; r++)
1718 val[n+r] = info->group[i].type;
1719 val[n+r] = 0;
1720 }
1721 else
1722 {
1723 r = GetWindowTextW( info->group[i].hwnd, &val[n], info->group[i].len+1 );
1724 if( r != info->group[i].len )
1725 break;
1726 }
1727 n += r;
1728 }
1729 }
1730
1731 TRACE("%d/%d controls were good\n", i, info->num_groups);
1732
1733 if( i == info->num_groups )
1734 {
1735 TRACE("Set property %s to %s\n", debugstr_w(info->prop), debugstr_w(val));
1736 dialog_set_property( info->dialog->package, info->prop, val );
1738 }
1739 free( val );
1740}
static BOOL mask_editable(WCHAR type)
Definition: dialog.c:1679
#define WM_GETTEXTLENGTH
Definition: winuser.h:1647

Referenced by MSIMaskedEdit_WndProc().

◆ mask_editable()

static BOOL mask_editable ( WCHAR  type)
static

Definition at line 1679 of file dialog.c.

1680{
1681 switch (type)
1682 {
1683 case '%':
1684 case '#':
1685 case '&':
1686 case '`':
1687 case '?':
1688 case '^':
1689 return TRUE;
1690 }
1691 return FALSE;
1692}

Referenced by mask_control_change(), and maskedit_create_children().

◆ mask_next_control()

static void mask_next_control ( struct msi_maskedit_info info,
HWND  hWnd 
)
static

Definition at line 1743 of file dialog.c.

1744{
1745 HWND hWndNext;
1746 UINT len, i;
1747
1748 for( i=0; i<info->num_groups; i++ )
1749 if( info->group[i].hwnd == hWnd )
1750 break;
1751
1752 /* don't move from the last control */
1753 if( i >= (info->num_groups-1) )
1754 return;
1755
1757 if( len < info->group[i].len )
1758 return;
1759
1760 hWndNext = GetNextDlgTabItem( GetParent( hWnd ), hWnd, FALSE );
1761 SetFocus( hWndNext );
1762}
HWND hWnd
Definition: settings.c:17
HWND WINAPI GetParent(_In_ HWND)

Referenced by MSIMaskedEdit_WndProc().

◆ maskedit_create_children()

static void maskedit_create_children ( struct msi_maskedit_info info,
const WCHAR font 
)
static

Definition at line 1880 of file dialog.c.

1881{
1882 DWORD width, height, style, wx, ww;
1883 RECT rect;
1884 HWND hwnd;
1885 UINT i;
1886
1888
1889 GetClientRect( info->hwnd, &rect );
1890
1891 width = rect.right - rect.left;
1893
1894 for( i = 0; i < info->num_groups; i++ )
1895 {
1896 if (!mask_editable( info->group[i].type ))
1897 continue;
1898 if (info->num_chars)
1899 {
1900 wx = (info->group[i].ofs * width) / info->num_chars;
1901 ww = (info->group[i].len * width) / info->num_chars;
1902 }
1903 else
1904 {
1905 wx = 0;
1906 ww = width;
1907 }
1908 hwnd = CreateWindowW( L"Edit", NULL, style, wx, 0, ww, height,
1909 info->hwnd, NULL, NULL, NULL );
1910 if( !hwnd )
1911 {
1912 ERR("failed to create mask edit sub window\n");
1913 break;
1914 }
1915
1916 SendMessageW( hwnd, EM_LIMITTEXT, info->group[i].len, 0 );
1917
1918 dialog_set_font( info->dialog, hwnd, font?font:info->dialog->default_font );
1919 info->group[i].hwnd = hwnd;
1920 }
1921}
RECT rect
Definition: combotst.c:67
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define EM_LIMITTEXT
Definition: winuser.h:2029

Referenced by dialog_maskedit_control().

◆ maskedit_set_text()

static void maskedit_set_text ( struct msi_maskedit_info info,
const WCHAR text 
)
static

Definition at line 1795 of file dialog.c.

1796{
1797 LPCWSTR p;
1798 UINT i;
1799
1800 p = text;
1801 for( i = 0; i < info->num_groups; i++ )
1802 {
1803 if( info->group[i].len < lstrlenW( p ) )
1804 {
1805 WCHAR *chunk = wcsdup( p );
1806 chunk[ info->group[i].len ] = 0;
1807 SetWindowTextW( info->group[i].hwnd, chunk );
1808 free( chunk );
1809 }
1810 else
1811 {
1812 SetWindowTextW( info->group[i].hwnd, p );
1813 break;
1814 }
1815 p += info->group[i].len;
1816 }
1817}

Referenced by dialog_maskedit_control().

◆ MSI_ClosePreview()

static void MSI_ClosePreview ( MSIOBJECTHDR arg)
static

Definition at line 4123 of file dialog.c.

4124{
4126 msiobj_release( &preview->package->hdr );
4127}
static previewinfo preview
Definition: print.c:56

Referenced by MSI_EnableUIPreview().

◆ msi_dialog_check_messages()

void msi_dialog_check_messages ( HANDLE  handle)

Definition at line 3991 of file dialog.c.

3992{
3993 DWORD r;
3994
3995 /* in threads other than the UI thread, block */
3997 {
3998 if (!handle) return;
4000 {
4001 MSG msg;
4002 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
4003 {
4006 }
4007 }
4008 return;
4009 }
4010
4011 /* there are two choices for the UI thread */
4012 while (1)
4013 {
4015
4016 if( !handle )
4017 break;
4018
4019 /*
4020 * block here until somebody creates a new dialog or
4021 * the handle we're waiting on becomes ready
4022 */
4024 if( r == WAIT_OBJECT_0 )
4025 break;
4026 }
4027}
#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:383
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:1207
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_destroy()

void msi_dialog_destroy ( msi_dialog dialog)

Definition at line 4059 of file dialog.c.

4060{
4061 struct font *font, *next;
4062
4064 {
4066 return;
4067 }
4068
4069 if( dialog->hwnd )
4070 {
4071 ShowWindow( dialog->hwnd, SW_HIDE );
4072 DestroyWindow( dialog->hwnd );
4073 }
4074
4075 /* unsubscribe events */
4076 event_cleanup_subscriptions( dialog->package, dialog->name );
4077
4078 /* destroy the list of controls */
4079 while( !list_empty( &dialog->controls ) )
4080 {
4081 struct control *t;
4082
4083 t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
4084 destroy_control( t );
4085 }
4086
4087 /* destroy the list of fonts */
4088 LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
4089 {
4090 list_remove( &font->entry );
4091 DeleteObject( font->hfont );
4092 free( font );
4093 }
4094 free( dialog->default_font );
4095
4096 free( dialog->control_default );
4097 free( dialog->control_cancel );
4098 dialog->package = NULL;
4099 free( dialog );
4100}
static int list_empty(struct list_entry *head)
Definition: list.h:58
#define WM_MSI_DIALOG_DESTROY
Definition: dialog.c:127
static void destroy_control(struct control *t)
Definition: dialog.c:355
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
Definition: list.h:15
BOOL WINAPI DestroyWindow(_In_ HWND)

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

◆ msi_dialog_unregister_class()

void msi_dialog_unregister_class ( void  )

Definition at line 4102 of file dialog.c.

4103{
4106 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4107 UnregisterClassW( L"MsiHiddenWindow", NULL );
4108 uiThreadId = 0;
4109}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ MSI_EnableUIPreview()

static MSIPREVIEW * MSI_EnableUIPreview ( MSIDATABASE db)
static

Definition at line 4129 of file dialog.c.

4130{
4132 MSIPACKAGE *package;
4133
4134 package = MSI_CreatePackage( db );
4135 if (package)
4136 {
4138 if (preview)
4139 {
4140 preview->package = package;
4141 msiobj_addref( &package->hdr );
4142 }
4143 msiobj_release( &package->hdr );
4144 }
4145 return preview;
4146}
static void MSI_ClosePreview(MSIOBJECTHDR *arg)
Definition: dialog.c:4123
void * alloc_msiobject(UINT type, UINT size, msihandledestructor destroy)
Definition: handle.c:201
void msiobj_addref(MSIOBJECTHDR *info)
Definition: handle.c:217
#define MSIHANDLETYPE_PREVIEW
Definition: msipriv.h:727
MSIOBJECTHDR hdr
Definition: msipriv.h:393

Referenced by MsiEnableUIPreview().

◆ msi_event_cleanup_all_subscriptions()

void msi_event_cleanup_all_subscriptions ( MSIPACKAGE package)

Definition at line 4111 of file dialog.c.

4112{
4113 struct list *item, *next;
4114
4116 {
4117 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4118 list_remove( &sub->entry );
4119 free_subscriber( sub );
4120 }
4121}

Referenced by event_new_dialog(), and free_package_structures().

◆ msi_event_fire()

void msi_event_fire ( MSIPACKAGE package,
const WCHAR event,
MSIRECORD rec 
)

Definition at line 4421 of file dialog.c.

4422{
4423 struct subscriber *sub;
4424
4425 TRACE("firing event %s\n", debugstr_w(event));
4426
4427 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4428 {
4429 if (wcsicmp( sub->event, event )) continue;
4430 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4431 }
4432}
static void dialog_handle_event(msi_dialog *dialog, const WCHAR *control, const WCHAR *attribute, MSIRECORD *rec)
Definition: dialog.c:555

Referenced by dialog_seltree_handler(), event_set_target_path(), and internal_ui_handler().

◆ MSI_PreviewDialogW()

static UINT MSI_PreviewDialogW ( MSIPREVIEW preview,
LPCWSTR  szDialogName 
)
static

Definition at line 4178 of file dialog.c.

4179{
4182
4183 if (preview->dialog)
4184 msi_dialog_destroy( preview->dialog );
4185
4186 /* an empty name means we should just destroy the current preview dialog */
4187 if (szDialogName)
4188 {
4189 dialog = dialog_create( preview->package, szDialogName, NULL, preview_event_handler );
4190 if (dialog)
4192 else
4194 }
4195 preview->dialog = dialog;
4196 return r;
4197}
static UINT preview_event_handler(msi_dialog *dialog, const WCHAR *event, const WCHAR *argument)
Definition: dialog.c:4172
static void dialog_do_preview(msi_dialog *dialog)
Definition: dialog.c:4029

Referenced by MsiPreviewDialogW().

◆ MSIComboBox_WndProc()

static LRESULT WINAPI MSIComboBox_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1361 of file dialog.c.

1362{
1363 struct msi_combobox_info *info;
1364 LRESULT r;
1365 DWORD j;
1366
1367 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
1368
1369 info = GetPropW( hWnd, L"MSIDATA" );
1370 if (!info)
1371 return 0;
1372
1373 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
1374
1375 switch (msg)
1376 {
1377 case WM_NCDESTROY:
1378 for (j = 0; j < info->num_items; j++)
1379 free( info->items[j] );
1380 free( info->items );
1381 free( info );
1382 RemovePropW( hWnd, L"MSIDATA" );
1383 break;
1384 }
1385
1386 return r;
1387}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
LONG_PTR LRESULT
Definition: minwindef.h:176
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1712
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by dialog_combo_control().

◆ MSIDialog_WndProc()

static LRESULT WINAPI MSIDialog_WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 3783 of file dialog.c.

3785{
3787
3788 TRACE("0x%04x\n", msg);
3789
3790 switch (msg)
3791 {
3792 case WM_MOVE:
3793 dialog->package->center_x = LOWORD(lParam) + dialog->size.cx / 2.0;
3794 dialog->package->center_y = HIWORD(lParam) + dialog->size.cy / 2.0;
3795 break;
3796
3797 case WM_CREATE:
3799
3800 case WM_COMMAND:
3802
3803 case WM_CLOSE:
3804 /* Simulate escape press */
3805 return dialog_oncommand(dialog, 2, NULL);
3806
3807 case WM_ACTIVATE:
3808 if( LOWORD(wParam) == WA_INACTIVE )
3809 dialog->hWndFocus = GetFocus();
3810 else
3812 return 0;
3813
3814 case WM_SETFOCUS:
3816 return 0;
3817
3818 /* bounce back to our subclassed static control */
3819 case WM_CTLCOLORSTATIC:
3821
3822 case WM_DESTROY:
3823 dialog->hwnd = NULL;
3824 return 0;
3825 case WM_NOTIFY:
3826 return dialog_onnotify( dialog, lParam );
3827 }
3828 return DefWindowProcW(hwnd, msg, wParam, lParam);
3829}
static void dialog_setfocus(msi_dialog *dialog)
Definition: dialog.c:3773
static LRESULT dialog_oncommand(msi_dialog *dialog, WPARAM param, HWND hwnd)
Definition: dialog.c:3730
static LRESULT dialog_onnotify(msi_dialog *dialog, LPARAM param)
Definition: dialog.c:3760
static LRESULT dialog_oncreate(HWND hwnd, CREATESTRUCTW *cs)
Definition: dialog.c:3677
#define LPVOID
Definition: nt_native.h:45
#define LOWORD(l)
Definition: pedump.c:82
#define WM_NOTIFY
Definition: richedit.h:61
HWND WINAPI GetFocus(void)
Definition: window.c:1863
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1800
#define WM_CLOSE
Definition: winuser.h:1649
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1636
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_SETFOCUS
Definition: winuser.h:1641
#define WA_INACTIVE
Definition: winuser.h:2664
#define WM_ACTIVATE
Definition: winuser.h:1640
#define WM_MOVE
Definition: winuser.h:1638
#define WM_DESTROY
Definition: winuser.h:1637

Referenced by dialog_register_class().

◆ MsiEnableUIPreview()

UINT WINAPI MsiEnableUIPreview ( MSIHANDLE  hdb,
MSIHANDLE phPreview 
)

Definition at line 4148 of file dialog.c.

4149{
4150 MSIDATABASE *db;
4153
4154 TRACE( "%lu %p\n", hdb, phPreview );
4155
4156 if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
4157 return ERROR_INVALID_HANDLE;
4158
4160 if (preview)
4161 {
4162 *phPreview = alloc_msihandle( &preview->hdr );
4163 msiobj_release( &preview->hdr );
4164 r = ERROR_SUCCESS;
4165 if (!*phPreview)
4167 }
4168 msiobj_release( &db->hdr );
4169 return r;
4170}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static MSIPREVIEW * MSI_EnableUIPreview(MSIDATABASE *db)
Definition: dialog.c:4129
MSIHANDLE alloc_msihandle(MSIOBJECTHDR *obj)
Definition: handle.c:111
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:158
#define MSIHANDLETYPE_DATABASE
Definition: msipriv.h:722
MSIOBJECTHDR hdr
Definition: msipriv.h:108

Referenced by test_invalid_functions().

◆ MSIHiddenWindowProc()

static LRESULT WINAPI MSIHiddenWindowProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 3887 of file dialog.c.

3888{
3890
3891 TRACE("%d %p\n", msg, dialog);
3892
3893 switch (msg)
3894 {
3899 return 0;
3900 }
3901 return DefWindowProcW( hwnd, msg, wParam, lParam );
3902}

Referenced by dialog_register_class().

◆ MSIListBox_WndProc()

static LRESULT WINAPI MSIListBox_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2634 of file dialog.c.

2635{
2636 struct msi_listbox_info *info;
2637 LRESULT r;
2638 DWORD j;
2639
2640 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2641
2642 info = GetPropW( hWnd, L"MSIDATA" );
2643 if (!info)
2644 return 0;
2645
2646 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
2647
2648 switch( msg )
2649 {
2650 case WM_NCDESTROY:
2651 for (j = 0; j < info->num_items; j++)
2652 free( info->items[j] );
2653 free( info->items );
2654 free( info );
2655 RemovePropW( hWnd, L"MSIDATA" );
2656 break;
2657 }
2658
2659 return r;
2660}

Referenced by dialog_list_box().

◆ MSIMaskedEdit_WndProc()

static LRESULT WINAPI MSIMaskedEdit_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1764 of file dialog.c.

1765{
1766 struct msi_maskedit_info *info;
1767 HRESULT r;
1768
1769 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
1770
1771 info = GetPropW(hWnd, L"MSIDATA");
1772
1773 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
1774
1775 switch( msg )
1776 {
1777 case WM_COMMAND:
1778 if (HIWORD(wParam) == EN_CHANGE)
1779 {
1782 }
1783 break;
1784 case WM_NCDESTROY:
1785 free( info->prop );
1786 free( info );
1787 RemovePropW( hWnd, L"MSIDATA" );
1788 break;
1789 }
1790
1791 return r;
1792}
static void mask_next_control(struct msi_maskedit_info *info, HWND hWnd)
Definition: dialog.c:1743
static void mask_control_change(struct msi_maskedit_info *info)
Definition: dialog.c:1694

Referenced by dialog_maskedit_control().

◆ MSIPathEdit_WndProc()

static LRESULT WINAPI MSIPathEdit_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2095 of file dialog.c.

2096{
2097 struct msi_pathedit_info *info = GetPropW(hWnd, L"MSIDATA");
2098 LRESULT r = 0;
2099
2100 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2101
2102 if ( msg == WM_KILLFOCUS )
2103 {
2104 /* if the path is invalid, don't handle this message */
2105 if ( !dialog_onkillfocus( info->dialog, info->control ) )
2106 return 0;
2107 }
2108
2109 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
2110
2111 if ( msg == WM_NCDESTROY )
2112 {
2113 free( info );
2114 RemovePropW( hWnd, L"MSIDATA" );
2115 }
2116
2117 return r;
2118}
static BOOL dialog_onkillfocus(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2060
#define WM_KILLFOCUS
Definition: winuser.h:1642

Referenced by dialog_pathedit_control().

◆ MsiPreviewBillboardA()

UINT WINAPI MsiPreviewBillboardA ( MSIHANDLE  hPreview,
const char szControlName,
const char szBillboard 
)

Definition at line 4239 of file dialog.c.

4240{
4241 FIXME( "%lu %s %s\n", hPreview, debugstr_a(szControlName), debugstr_a(szBillboard) );
4243}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define debugstr_a
Definition: kernel32.h:31

◆ MsiPreviewBillboardW()

UINT WINAPI MsiPreviewBillboardW ( MSIHANDLE  hPreview,
const WCHAR szControlName,
const WCHAR szBillboard 
)

Definition at line 4233 of file dialog.c.

4234{
4235 FIXME( "%lu %s %s\n", hPreview, debugstr_w(szControlName), debugstr_w(szBillboard) );
4237}

◆ MsiPreviewDialogA()

UINT WINAPI MsiPreviewDialogA ( MSIHANDLE  hPreview,
LPCSTR  szDialogName 
)

Definition at line 4215 of file dialog.c.

4216{
4217 UINT r;
4218 LPWSTR strW = NULL;
4219
4220 TRACE( "%lu %s\n", hPreview, debugstr_a(szDialogName) );
4221
4222 if (szDialogName)
4223 {
4224 strW = strdupAtoW( szDialogName );
4225 if (!strW)
4226 return ERROR_OUTOFMEMORY;
4227 }
4228 r = MsiPreviewDialogW( hPreview, strW );
4229 free( strW );
4230 return r;
4231}
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:61
UINT WINAPI MsiPreviewDialogW(MSIHANDLE hPreview, LPCWSTR szDialogName)
Definition: dialog.c:4199
WCHAR strW[12]
Definition: clipboard.c:2216

◆ MsiPreviewDialogW()

UINT WINAPI MsiPreviewDialogW ( MSIHANDLE  hPreview,
LPCWSTR  szDialogName 
)

Definition at line 4199 of file dialog.c.

4200{
4202 UINT r;
4203
4204 TRACE( "%lu %s\n", hPreview, debugstr_w(szDialogName) );
4205
4207 if (!preview)
4208 return ERROR_INVALID_HANDLE;
4209
4210 r = MSI_PreviewDialogW( preview, szDialogName );
4211 msiobj_release( &preview->hdr );
4212 return r;
4213}
static UINT MSI_PreviewDialogW(MSIPREVIEW *preview, LPCWSTR szDialogName)
Definition: dialog.c:4178

Referenced by MsiPreviewDialogA().

◆ MSIRadioGroup_WndProc()

static LRESULT WINAPI MSIRadioGroup_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2193 of file dialog.c.

2194{
2195 WNDPROC oldproc = (WNDPROC)GetPropW( hWnd, L"MSIDATA" );
2196 LRESULT r;
2197
2198 TRACE( "hWnd %p msg %04x wParam %#Ix lParam %#Ix\n", hWnd, msg, wParam, lParam );
2199
2200 if (msg == WM_COMMAND) /* Forward notifications to dialog */
2202
2203 r = CallWindowProcW( oldproc, hWnd, msg, wParam, lParam );
2204
2205 /* make sure the radio buttons show as disabled if the parent is disabled */
2206 if (msg == WM_ENABLE)
2208
2209 return r;
2210}
static BOOL CALLBACK radioground_child_enum(HWND hWnd, LPARAM lParam)
Definition: dialog.c:2187
#define WM_ENABLE
Definition: winuser.h:1643
BOOL WINAPI EnumChildWindows(_In_opt_ HWND, _In_ WNDENUMPROC, _In_ LPARAM)

Referenced by dialog_radiogroup_control().

◆ MSIScrollText_WndProc()

static LRESULT WINAPI MSIScrollText_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1183 of file dialog.c.

1184{
1185 struct msi_scrolltext_info *info;
1186 HRESULT r;
1187
1188 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
1189
1190 info = GetPropW( hWnd, L"MSIDATA" );
1191
1192 r = CallWindowProcW( info->oldproc, hWnd, msg, wParam, lParam );
1193
1194 switch( msg )
1195 {
1196 case WM_GETDLGCODE:
1197 return DLGC_WANTARROWS;
1198 case WM_NCDESTROY:
1199 free( info );
1200 RemovePropW( hWnd, L"MSIDATA" );
1201 break;
1202 case WM_PAINT:
1203 /* native MSI sets a wait cursor here */
1204 dialog_button_handler( info->dialog, info->control, BN_CLICKED );
1205 break;
1206 }
1207 return r;
1208}
#define WM_PAINT
Definition: winuser.h:1648
#define DLGC_WANTARROWS
Definition: winuser.h:2652
#define WM_GETDLGCODE
Definition: winuser.h:1717

Referenced by dialog_scrolltext_control().

◆ MSISelectionTree_WndProc()

static LRESULT WINAPI MSISelectionTree_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 2386 of file dialog.c.

2387{
2389 TVHITTESTINFO tvhti;
2390 HRESULT r;
2391
2392 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2393
2394 info = GetPropW(hWnd, L"MSIDATA");
2395
2396 switch( msg )
2397 {
2398 case WM_LBUTTONDOWN:
2399 tvhti.pt.x = (short)LOWORD( lParam );
2400 tvhti.pt.y = (short)HIWORD( lParam );
2401 tvhti.flags = 0;
2402 tvhti.hItem = 0;
2403 CallWindowProcW(info->oldproc, hWnd, TVM_HITTEST, 0, (LPARAM) &tvhti );
2404 if (tvhti.flags & TVHT_ONITEMSTATEICON)
2405 return seltree_menu( hWnd, tvhti.hItem );
2406 break;
2407 }
2408 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
2409
2410 switch( msg )
2411 {
2412 case WM_NCDESTROY:
2413 free( info );
2414 RemovePropW( hWnd, L"MSIDATA" );
2415 break;
2416 }
2417 return r;
2418}
static LRESULT seltree_menu(HWND hwnd, HTREEITEM hItem)
Definition: dialog.c:2335
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define TVHT_ONITEMSTATEICON
Definition: commctrl.h:3536
#define TVM_HITTEST
Definition: commctrl.h:3517
HTREEITEM hItem
Definition: commctrl.h:3526
#define WM_LBUTTONDOWN
Definition: winuser.h:1804

Referenced by dialog_selection_tree().

◆ MSIText_WndProc()

static LRESULT WINAPI MSIText_WndProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 762 of file dialog.c.

763{
764 struct msi_text_info *info;
765 LRESULT r = 0;
766
767 TRACE( "%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam );
768
769 info = GetPropW(hWnd, L"MSIDATA");
770
771 if( msg == WM_CTLCOLORSTATIC &&
772 ( info->attributes & msidbControlAttributesTransparent ) )
773 {
776 }
777
778 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
779 if ( info->font )
780 SetTextColor( (HDC)wParam, info->font->color );
781
782 switch( msg )
783 {
784 case WM_SETTEXT:
786 break;
787 case WM_NCDESTROY:
788 free( info );
789 RemovePropW( hWnd, L"MSIDATA" );
790 break;
791 }
792
793 return r;
794}
static void text_on_settext(HWND hWnd)
Definition: dialog.c:751
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRANSPARENT
Definition: wingdi.h:950
#define NULL_BRUSH
Definition: wingdi.h:901
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
#define WM_SETTEXT
Definition: winuser.h:1645

Referenced by dialog_text_control().

◆ pending_event_end_dialog()

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

Definition at line 4309 of file dialog.c.

4310{
4311 dialog->pending_event = event_end_dialog;
4312 free( dialog->pending_argument );
4313 dialog->pending_argument = wcsdup( argument );
4314 return ERROR_SUCCESS;
4315}
static UINT event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4289

◆ pending_event_new_dialog()

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

Definition at line 4327 of file dialog.c.

4328{
4329 dialog->pending_event = event_new_dialog;
4330 free( dialog->pending_argument );
4331 dialog->pending_argument = wcsdup( argument );
4332 return ERROR_SUCCESS;
4333}
static UINT event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4318

◆ pending_event_spawn_dialog()

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

Definition at line 4352 of file dialog.c.

4353{
4354 dialog->pending_event = event_spawn_dialog;
4355 free( dialog->pending_argument );
4356 dialog->pending_argument = wcsdup( argument );
4357 return ERROR_SUCCESS;
4358}
static UINT event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4336

◆ preview_event_handler()

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

Definition at line 4172 of file dialog.c.

4173{
4174 MESSAGE("Preview dialog event '%s' (arg='%s')\n", debugstr_w(event), debugstr_w(argument));
4175 return ERROR_SUCCESS;
4176}
#define MESSAGE
Definition: options.h:86

Referenced by MSI_PreviewDialogW().

◆ process_pending_messages()

static void process_pending_messages ( HWND  hdlg)
static

Definition at line 3831 of file dialog.c.

3832{
3833 MSG msg;
3834
3835 while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
3836 {
3837 if (hdlg && IsDialogMessageW( hdlg, &msg )) continue;
3840 }
3841}
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)

Referenced by dialog_run_message_loop(), and msi_dialog_check_messages().

◆ radioground_child_enum()

static BOOL CALLBACK radioground_child_enum ( HWND  hWnd,
LPARAM  lParam 
)
static

Definition at line 2187 of file dialog.c.

2188{
2190 return TRUE;
2191}

Referenced by MSIRadioGroup_WndProc().

◆ richedit_stream_in()

static DWORD CALLBACK richedit_stream_in ( DWORD_PTR  arg,
BYTE buffer,
LONG  count,
LONG pcb 
)
static

Definition at line 1217 of file dialog.c.

1218{
1219 struct msi_streamin_info *info = (struct msi_streamin_info*) arg;
1220
1221 if( (count + info->offset) > info->length )
1222 count = info->length - info->offset;
1223 memcpy( buffer, &info->string[ info->offset ], count );
1224 *pcb = count;
1225 info->offset += count;
1226
1227 TRACE( "%lu/%lu\n", info->offset, info->length );
1228
1229 return 0;
1230}
GLuint buffer
Definition: glext.h:5915

Referenced by scrolltext_add_text().

◆ scrolltext_add_text()

static void scrolltext_add_text ( struct control control,
const WCHAR text 
)
static

Definition at line 1232 of file dialog.c.

1233{
1234 struct msi_streamin_info info;
1235 EDITSTREAM es;
1236
1237 info.string = strdupWtoA( text );
1238 info.offset = 0;
1239 info.length = lstrlenA( info.string ) + 1;
1240
1241 es.dwCookie = (DWORD_PTR) &info;
1242 es.dwError = 0;
1243 es.pfnCallback = richedit_stream_in;
1244
1246
1247 free( info.string );
1248}
static DWORD CALLBACK richedit_stream_in(DWORD_PTR arg, BYTE *buffer, LONG count, LONG *pcb)
Definition: dialog.c:1217
static LPSTR strdupWtoA(LPCWSTR str)
Definition: hhctrl.h:299
#define es
Definition: i386-dis.c:440
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define EM_STREAMIN
Definition: richedit.h:106
#define SF_RTF
Definition: richedit.h:721
#define DWORD_PTR
Definition: treelist.c:76

Referenced by dialog_scrolltext_control().

◆ seltree_add_child_features()

static void seltree_add_child_features ( MSIPACKAGE package,
HWND  hwnd,
const WCHAR parent,
HTREEITEM  hParent 
)
static

Definition at line 2420 of file dialog.c.

2421{
2422 struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" );
2424 TVINSERTSTRUCTW tvis;
2425 HTREEITEM hitem, hfirst = NULL;
2426
2428 {
2429 if ( parent && feature->Feature_Parent && wcscmp( parent, feature->Feature_Parent ))
2430 continue;
2431 else if ( parent && !feature->Feature_Parent )
2432 continue;
2433 else if ( !parent && feature->Feature_Parent )
2434 continue;
2435
2436 if ( !feature->Title )
2437 continue;
2438
2439 if ( !feature->Display )
2440 continue;
2441
2442 memset( &tvis, 0, sizeof tvis );
2443 tvis.hParent = hParent;
2444 tvis.hInsertAfter = TVI_LAST;
2445 tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
2446 tvis.item.pszText = feature->Title;
2447 tvis.item.lParam = (LPARAM) feature;
2448
2449 hitem = (HTREEITEM) SendMessageW( hwnd, TVM_INSERTITEMW, 0, (LPARAM) &tvis );
2450 if (!hitem)
2451 continue;
2452
2453 if (!hfirst)
2454 hfirst = hitem;
2455
2458 feature->Feature, hitem );
2459
2460 /* the node is expanded if Display is odd */
2461 if ( feature->Display % 2 != 0 )
2463 }
2464
2465 /* select the first item */
2467 info->selected = hfirst;
2468}
static void seltree_sync_item_state(HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem)
Definition: dialog.c:2269
#define TVI_LAST
Definition: commctrl.h:3375
struct _TREEITEM * HTREEITEM
Definition: commctrl.h:3269
#define TVE_EXPAND
Definition: commctrl.h:3428
#define TVGN_DROPHILITE
Definition: commctrl.h:3465
#define TVM_SELECTITEM
Definition: commctrl.h:3483
#define TVM_INSERTITEMW
Definition: commctrl.h:3413
#define TVGN_CARET
Definition: commctrl.h:3466
#define TVIF_PARAM
Definition: commctrl.h:3273
#define TVM_EXPAND
Definition: commctrl.h:3424
struct list features
Definition: msipriv.h:402
HTREEITEM hParent
Definition: commctrl.h:3398
HTREEITEM hInsertAfter
Definition: commctrl.h:3399

Referenced by dialog_selection_tree(), and seltree_add_child_features().

◆ seltree_create_imagelist()

static void seltree_create_imagelist ( HWND  hwnd)
static

Definition at line 2470 of file dialog.c.

2471{
2472 const int bm_width = 32, bm_height = 16, bm_count = 3;
2473 const int bm_resource = 0x1001;
2475 int i;
2476 HBITMAP hbmp;
2477
2478 himl = ImageList_Create( bm_width, bm_height, FALSE, 4, 0 );
2479 if (!himl)
2480 {
2481 ERR("failed to create image list\n");
2482 return;
2483 }
2484
2485 for (i=0; i<bm_count; i++)
2486 {
2487 hbmp = LoadBitmapW( msi_hInstance, MAKEINTRESOURCEW(i+bm_resource) );
2488 if (!hbmp)
2489 {
2490 ERR("failed to load bitmap %d\n", i);
2491 break;
2492 }
2493
2494 /*
2495 * Add a dummy bitmap at offset zero because the treeview
2496 * can't use it as a state mask (zero means no user state).
2497 */
2498 if (!i)
2500
2502 }
2503
2505}
HBITMAP hbmp
HIMAGELIST himl
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:458
#define TVSIL_STATE
Definition: commctrl.h:3449
#define TVM_SETIMAGELIST
Definition: commctrl.h:3451
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2532

Referenced by dialog_selection_tree().

◆ seltree_feature_from_item()

static MSIFEATURE * seltree_feature_from_item ( HWND  hwnd,
HTREEITEM  hItem 
)
static

Definition at line 529 of file dialog.c.

530{
531 TVITEMW tvi;
532
533 /* get the feature from the item */
534 memset( &tvi, 0, sizeof tvi );
535 tvi.hItem = hItem;
537 SendMessageW( hwnd, TVM_GETITEMW, 0, (LPARAM)&tvi );
538 return (MSIFEATURE *)tvi.lParam;
539}
#define TVM_GETITEMW
Definition: commctrl.h:3491
#define TVIF_HANDLE
Definition: commctrl.h:3275
LPARAM lParam
Definition: commctrl.h:3330
HTREEITEM hItem
Definition: treelist.h:37

Referenced by dialog_seltree_handler(), seltree_get_selected_feature(), seltree_menu(), and seltree_update_siblings_and_children_installstate().

◆ seltree_get_selected_feature()

static MSIFEATURE * seltree_get_selected_feature ( struct control control)
static

Definition at line 549 of file dialog.c.

550{
551 struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
552 return seltree_feature_from_item( control->hwnd, info->selected );
553}

Referenced by dialog_handle_event().

◆ seltree_menu()

static LRESULT seltree_menu ( HWND  hwnd,
HTREEITEM  hItem 
)
static

Definition at line 2335 of file dialog.c.

2336{
2339 MSIPACKAGE *package;
2340 union {
2341 RECT rc;
2342 POINT pt[2];
2344 } u;
2345 UINT r;
2346
2347 info = GetPropW(hwnd, L"MSIDATA");
2348 package = info->dialog->package;
2349
2351 if (!feature)
2352 {
2353 ERR("item %p feature was NULL\n", hItem);
2354 return 0;
2355 }
2356
2357 /* get the item's rectangle to put the menu just below it */
2358 u.hItem = hItem;
2360 MapWindowPoints( hwnd, NULL, u.pt, 2 );
2361
2362 r = seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
2363
2364 switch (r)
2365 {
2368 /* fall-through */
2371 {
2374 if (child)
2376 }
2377 /* fall-through */
2378 case INSTALLSTATE_LOCAL:
2380 break;
2381 }
2382
2383 return 0;
2384}
static void seltree_update_feature_installstate(HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state)
Definition: dialog.c:2307
#define USER_INSTALLSTATE_ALL
Definition: dialog.c:129
static UINT seltree_popup_menu(HWND hwnd, INT x, INT y)
Definition: dialog.c:2288
static void seltree_update_siblings_and_children_installstate(HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, INSTALLSTATE state)
Definition: dialog.c:2315
#define pt(x, y)
Definition: drawing.c:79
static HWND child
Definition: cursoricon.c:298
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
#define TVM_GETITEMRECT
Definition: commctrl.h:3433
#define TVGN_CHILD
Definition: commctrl.h:3461
#define TVM_GETNEXTITEM
Definition: commctrl.h:3454
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)

Referenced by MSISelectionTree_WndProc().

◆ seltree_popup_menu()

static UINT seltree_popup_menu ( HWND  hwnd,
INT  x,
INT  y 
)
static

Definition at line 2288 of file dialog.c.

2289{
2290 HMENU hMenu;
2291 INT r;
2292
2293 /* create a menu to display */
2294 hMenu = CreatePopupMenu();
2295
2296 /* FIXME: load strings from resources */
2297 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_LOCAL, "Install feature locally");
2298 AppendMenuA( hMenu, MF_ENABLED, USER_INSTALLSTATE_ALL, "Install entire feature");
2299 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ADVERTISED, "Install on demand");
2300 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ABSENT, "Don't install");
2302 x, y, 0, hwnd, NULL );
2303 DestroyMenu( hMenu );
2304 return r;
2305}
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define TPM_TOPALIGN
Definition: winuser.h:2419
#define MF_ENABLED
Definition: winuser.h:128
#define TPM_LEFTALIGN
Definition: winuser.h:2413
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define TPM_RETURNCMD
Definition: winuser.h:2423

Referenced by seltree_menu().

◆ seltree_sync_item_state()

static void seltree_sync_item_state ( HWND  hwnd,
MSIFEATURE feature,
HTREEITEM  hItem 
)
static

Definition at line 2269 of file dialog.c.

2270{
2271 TVITEMW tvi;
2272 DWORD index = feature->ActionRequest;
2273
2274 TRACE("Feature %s -> %d %d %d\n", debugstr_w(feature->Title),
2275 feature->Installed, feature->Action, feature->ActionRequest);
2276
2279
2280 tvi.mask = TVIF_STATE;
2281 tvi.hItem = hItem;
2284
2285 SendMessageW( hwnd, TVM_SETITEMW, 0, (LPARAM) &tvi );
2286}
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
#define TVM_SETITEMW
Definition: commctrl.h:3498
#define TVIS_STATEIMAGEMASK
Definition: commctrl.h:3293
#define INDEXTOSTATEIMAGEMASK(i)
Definition: commctrl.h:2333
#define TVIF_STATE
Definition: commctrl.h:3274
UINT state
Definition: commctrl.h:3323
UINT stateMask
Definition: commctrl.h:3324

Referenced by seltree_add_child_features(), and seltree_update_feature_installstate().

◆ seltree_update_feature_installstate()

static void seltree_update_feature_installstate ( HWND  hwnd,
HTREEITEM  hItem,
MSIPACKAGE package,
MSIFEATURE feature,
INSTALLSTATE  state 
)
static

Definition at line 2307 of file dialog.c.

2309{
2310 feature->ActionRequest = state;
2313}
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:833

Referenced by seltree_menu(), and seltree_update_siblings_and_children_installstate().

◆ seltree_update_siblings_and_children_installstate()

static void seltree_update_siblings_and_children_installstate ( HWND  hwnd,
HTREEITEM  curr,
MSIPACKAGE package,
INSTALLSTATE  state 
)
static

Definition at line 2315 of file dialog.c.

2317{
2318 /* update all siblings */
2319 do
2320 {
2323
2326
2327 /* update this sibling's children */
2329 if (child)
2331 }
2332 while ((curr = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)curr )));
2333}
#define TVGN_NEXT
Definition: commctrl.h:3458

Referenced by seltree_menu(), and seltree_update_siblings_and_children_installstate().

◆ str_is_number()

static BOOL str_is_number ( LPCWSTR  str)
static

Definition at line 3034 of file dialog.c.

3035{
3036 int i;
3037
3038 for (i = 0; i < lstrlenW( str ); i++)
3039 if (!iswdigit(str[i]))
3040 return FALSE;
3041
3042 return TRUE;
3043}
#define iswdigit(_c)
Definition: ctype.h:667

Referenced by dialog_vcl_add_columns().

◆ text_on_settext()

static void text_on_settext ( HWND  hWnd)
static

Definition at line 751 of file dialog.c.

752{
753 HWND hParent;
754 RECT rc;
755
756 hParent = GetParent( hWnd );
757 GetWindowRect( hWnd, &rc );
758 MapWindowPoints( NULL, hParent, (LPPOINT) &rc, 2 );
759 InvalidateRect( hParent, &rc, TRUE );
760}
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by MSIText_WndProc().

◆ vcl_get_cost()

static LONGLONG vcl_get_cost ( msi_dialog dialog)
static

Definition at line 3112 of file dialog.c.

3113{
3115 INT each_cost;
3116 LONGLONG total_cost = 0;
3117
3118 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
3119 {
3122 {
3123 total_cost += each_cost;
3124 }
3127 {
3128 total_cost -= each_cost;
3129 }
3130 }
3131 return total_cost;
3132}
UINT MSI_GetFeatureCost(MSIPACKAGE *package, MSIFEATURE *feature, MSICOSTTREE tree, INSTALLSTATE state, LPINT cost)
Definition: install.c:1155
@ MSICOSTTREE_SELFONLY
Definition: msiquery.h:42

Referenced by dialog_vcl_add_drives().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )

Variable Documentation

◆ column_keys

const WCHAR column_keys[][80]
static
Initial value:
=
{
L"VolumeCostVolume",
L"VolumeCostSize",
L"VolumeCostAvailable",
L"VolumeCostRequired",
L"VolumeCostDifference",
}

Definition at line 3045 of file dialog.c.

Referenced by dialog_vcl_add_columns().

◆ control_events

const struct control_event control_events[]
static
Initial value:
=
{
{ L"EndDialog", pending_event_end_dialog },
{ L"NewDialog", pending_event_new_dialog },
{ L"SpawnDialog", pending_event_spawn_dialog },
{ L"SpawnWaitDialog", event_spawn_wait_dialog },
{ L"DoAction", event_do_action },
{ L"AddLocal", event_add_local },
{ L"Remove", event_remove },
{ L"AddSource", event_add_source },
{ L"SetTargetPath", event_set_target_path },
{ L"Reset", event_reset },
{ L"SetInstallLevel", event_set_install_level },
{ L"DirectoryListUp", event_directory_list_up },
{ L"DirectoryListNew", event_directory_list_new },
{ L"SelectionBrowse", event_spawn_dialog },
{ L"ReinstallMode", event_reinstall_mode },
{ L"Reinstall", event_reinstall },
{ L"ValidateProductID", event_validate_product_id },
{ NULL, NULL }
}
static UINT event_do_action(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4367
static UINT event_remove(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4389
static UINT event_add_source(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4405
static UINT pending_event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4327
static UINT event_spawn_wait_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4361
static UINT pending_event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4309
static UINT event_validate_product_id(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4538
static UINT event_add_local(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4373
static UINT event_set_install_level(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4510
static UINT event_set_target_path(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4434
static UINT event_reset(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4452
static UINT event_reinstall(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4533
static UINT pending_event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4352
static UINT event_directory_list_up(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4518
static UINT event_reinstall_mode(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4528
static UINT event_directory_list_new(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4523

Definition at line 4543 of file dialog.c.

Referenced by dialog_event_handler().

◆ hMsiHiddenWindow

◆ msi_dialog_handler

const struct control_handler msi_dialog_handler[]
static
Initial value:
=
{
{ L"Text", dialog_text_control },
{ L"PushButton", dialog_button_control },
{ L"Line", dialog_line_control },
{ L"Bitmap", dialog_bitmap_control },
{ L"CheckBox", dialog_checkbox_control },
{ L"ScrollableText", dialog_scrolltext_control },
{ L"ComboBox", dialog_combo_control },
{ L"Edit", dialog_edit_control },
{ L"MaskedEdit", dialog_maskedit_control },
{ L"PathEdit", dialog_pathedit_control },
{ L"ProgressBar", dialog_progress_bar },
{ L"RadioButtonGroup", dialog_radiogroup_control },
{ L"Icon", dialog_icon_control },
{ L"SelectionTree", dialog_selection_tree },
{ L"GroupBox", dialog_group_box },
{ L"ListBox", dialog_list_box },
{ L"DirectoryCombo", dialog_directory_combo },
{ L"DirectoryList", dialog_directory_list },
{ L"VolumeCostList", dialog_volumecost_list },
{ L"VolumeSelectCombo", dialog_volumeselect_combo },
{ L"HyperLink", dialog_hyperlink },
{ L"ListView", dialog_listview }
}
static UINT dialog_line_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1166
static UINT dialog_button_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1010
static UINT dialog_listview(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3438
static UINT dialog_icon_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1328
static UINT dialog_scrolltext_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1250
static UINT dialog_radiogroup_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2212
static UINT dialog_hyperlink(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3354
static UINT dialog_edit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1618
static UINT dialog_progress_bar(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1997
static UINT dialog_group_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2609
static UINT dialog_list_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2725
static UINT dialog_maskedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1928
static UINT dialog_text_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:796
static UINT dialog_combo_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1549
static UINT dialog_selection_tree(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2563
static UINT dialog_checkbox_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1145
static UINT dialog_volumecost_list(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3214
static UINT dialog_directory_list(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3005
static UINT dialog_pathedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2120
static UINT dialog_directory_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2787
static UINT dialog_volumeselect_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3285
static UINT dialog_bitmap_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1293

Definition at line 3478 of file dialog.c.

Referenced by dialog_create_controls().

◆ msi_hInstance

◆ uiThreadId