ReactOS 0.4.16-dev-197-g92996da
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 1654 of file dialog.c.

◆ MAX_NUM_DIGITS

#define MAX_NUM_DIGITS   11

Definition at line 1612 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 4482 of file dialog.c.

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

Referenced by internal_ui_handler().

◆ ACTION_ShowDialog()

INT ACTION_ShowDialog ( MSIPACKAGE package,
const WCHAR dialog 
)

Definition at line 4454 of file dialog.c.

4455{
4456 MSIRECORD *row;
4457 INT rc;
4458
4459 if (!TABLE_Exists(package->db, L"Dialog")) return 0;
4460
4461 row = MSI_CreateRecord(0);
4462 if (!row) return -1;
4465 msiobj_release(&row->hdr);
4466
4467 if (rc == -2) rc = 0;
4468
4469 if (!rc)
4470 {
4472 if (!row) return -1;
4473 MSI_RecordSetInteger(row, 1, 2726);
4476
4477 msiobj_release(&row->hdr);
4478 }
4479 return rc;
4480}
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_SHOWDIALOG
Definition: msi.h:108
BOOL TABLE_Exists(MSIDATABASE *db, LPCWSTR name)
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
#define L(x)
Definition: ntvdm.h:50
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 pos = SendMessageW( info->hwnd, CB_ADDSTRING, 0, (LPARAM)text );
1401 SendMessageW( info->hwnd, CB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
1402 info->addpos_items++;
1403
1404 return ERROR_SUCCESS;
1405}
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * text
Definition: package.c:1794
GLfloat param
Definition: glext.h:5796
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
Definition: pdh_main.c:94
LONG_PTR LPARAM
Definition: windef.h:208
#define CB_SETITEMDATA
Definition: winuser.h:1969
#define CB_ADDSTRING
Definition: winuser.h:1939
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

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

1408{
1409 MSIQUERY *view;
1410 DWORD count;
1411 UINT r;
1412
1413 r = MSI_OpenQuery( info->dialog->package->db, &view,
1414 L"SELECT * FROM `ComboBox` WHERE `Property` = '%s' ORDER BY `Order`", property );
1415 if (r != ERROR_SUCCESS)
1416 return r;
1417
1418 /* just get the number of records */
1419 count = 0;
1421 if (r != ERROR_SUCCESS)
1422 {
1423 msiobj_release( &view->hdr );
1424 return r;
1425 }
1426 info->num_items = count;
1427 info->items = malloc( sizeof(*info->items) * count );
1428
1430 msiobj_release( &view->hdr );
1431 return r;
1432}
#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:928
#define FreeLibrary(x)
Definition: compat.h:748
pKey DeleteObject()
GLdouble GLdouble t
Definition: gl.h:2047
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2105

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{
717 DWORD attributes;
718 const WCHAR *text = NULL, *name, *control_type;
719 DWORD exstyle = 0;
720
721 name = MSI_RecordGetString( rec, 2 );
723 attributes = MSI_RecordGetInteger( rec, 8 );
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
728 if( attributes & msidbControlAttributesVisible )
729 style |= WS_VISIBLE;
730 if( ~attributes & msidbControlAttributesEnabled )
732 if( attributes & msidbControlAttributesSunken )
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
#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
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_DISABLED
Definition: pedump.c:621
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#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
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
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 3592 of file dialog.c.

3593{
3594 UINT xres, yres;
3595 POINT center;
3596 SIZE sz;
3597 LONG style;
3598
3599 center.x = MSI_RecordGetInteger( rec, 2 );
3600 center.y = MSI_RecordGetInteger( rec, 3 );
3601
3602 sz.cx = MSI_RecordGetInteger( rec, 4 );
3603 sz.cy = MSI_RecordGetInteger( rec, 5 );
3604
3605 sz.cx = dialog_scale_unit( dialog, sz.cx );
3606 sz.cy = dialog_scale_unit( dialog, sz.cy );
3607
3608 xres = msi_get_property_int( dialog->package->db, L"ScreenX", 0 );
3609 yres = msi_get_property_int( dialog->package->db, L"ScreenY", 0 );
3610
3611 center.x = MulDiv( center.x, xres, 100 );
3612 center.y = MulDiv( center.y, yres, 100 );
3613
3614 /* turn the client pos into the window rectangle */
3615 if (dialog->package->center_x && dialog->package->center_y)
3616 {
3617 pos->left = dialog->package->center_x - sz.cx / 2.0;
3618 pos->right = pos->left + sz.cx;
3619 pos->top = dialog->package->center_y - sz.cy / 2.0;
3620 pos->bottom = pos->top + sz.cy;
3621 }
3622 else
3623 {
3624 pos->left = center.x - sz.cx/2;
3625 pos->right = pos->left + sz.cx;
3626 pos->top = center.y - sz.cy/2;
3627 pos->bottom = pos->top + sz.cy;
3628
3629 /* save the center */
3630 dialog->package->center_x = center.x;
3631 dialog->package->center_y = center.y;
3632 }
3633
3634 dialog->size.cx = sz.cx;
3635 dialog->size.cy = sz.cy;
3636
3637 TRACE("%s\n", wine_dbgstr_rect(pos));
3638
3641}
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:4832
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:855

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{
1295 UINT cx, cy, flags, style, attributes;
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
DWORD attributes
Definition: dialog.c:68
WCHAR name[1]
Definition: dialog.c:69
#define IMAGE_BITMAP
Definition: winuser.h:211
#define LR_LOADFROMFILE
Definition: winuser.h:1095
#define SS_CENTERIMAGE
Definition: winuser.h:339
#define STM_SETIMAGE
Definition: winuser.h:2096
#define LR_DEFAULTSIZE
Definition: winuser.h:1097
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ 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:985
#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:1925

◆ 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:1928

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:1924
#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 1545 of file dialog.c.

1546{
1547 struct msi_combobox_info *info;
1548 struct control *control;
1550 LPCWSTR prop;
1551
1552 info = malloc( sizeof *info );
1553 if (!info)
1554 return ERROR_FUNCTION_FAILED;
1555
1557 attributes = MSI_RecordGetInteger( rec, 8 );
1559 style |= CBS_SORT;
1562 else
1564
1566 if (!control)
1567 {
1568 free( info );
1569 return ERROR_FUNCTION_FAILED;
1570 }
1571
1574
1575 prop = MSI_RecordGetString( rec, 9 );
1577
1578 /* subclass */
1579 info->dialog = dialog;
1580 info->hwnd = control->hwnd;
1581 info->items = NULL;
1582 info->addpos_items = 0;
1585 SetPropW( control->hwnd, L"MSIDATA", info );
1586
1587 if (control->property)
1589
1591
1592 return ERROR_SUCCESS;
1593}
static void dialog_combobox_update(msi_dialog *dialog, struct control *control)
Definition: dialog.c:1510
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:1407
static UINT dialog_combobox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1485
@ 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:2909
#define SetWindowLongPtrW
Definition: winuser.h:5358

◆ dialog_combobox_handler()

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

Definition at line 1485 of file dialog.c.

1486{
1487 struct msi_combobox_info *info;
1488 int index;
1489 LPWSTR value;
1490
1492 return ERROR_SUCCESS;
1493
1494 info = GetPropW( control->hwnd, L"MSIDATA" );
1496 if (index == CB_ERR)
1498 else
1500
1501 dialog_set_property( info->dialog->package, control->property, value );
1503
1504 if (index == CB_ERR)
1505 free( value );
1506
1507 return ERROR_SUCCESS;
1508}
#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:1467
static WCHAR * get_window_text(HWND hwnd)
Definition: dialog.c:134
GLuint index
Definition: glext.h:6031
#define CB_ERR
Definition: winuser.h:2438
#define CBN_SELCHANGE
Definition: winuser.h:1982
#define CB_GETITEMDATA
Definition: winuser.h:1953
HANDLE WINAPI GetPropW(_In_ HWND, _In_ LPCWSTR)
#define CB_GETCURSEL
Definition: winuser.h:1946
#define CBN_EDITCHANGE
Definition: winuser.h:1978

Referenced by dialog_combo_control().

◆ dialog_combobox_update()

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

Definition at line 1510 of file dialog.c.

1511{
1512 struct msi_combobox_info *info;
1513 LPWSTR value, tmp;
1514 DWORD j;
1515
1516 info = GetPropW( control->hwnd, L"MSIDATA" );
1517
1518 value = msi_dup_property( dialog->package->db, control->property );
1519 if (!value)
1520 {
1522 return;
1523 }
1524
1525 for (j = 0; j < info->num_items; j++)
1526 {
1528 if (!wcscmp( value, tmp ))
1529 break;
1530 }
1531
1532 if (j < info->num_items)
1533 {
1535 }
1536 else
1537 {
1540 }
1541
1542 free( value );
1543}
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:1964
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 3932 of file dialog.c.

3934{
3935 MSIRECORD *rec = NULL;
3937
3938 TRACE("%s\n", debugstr_w(name));
3939
3941
3942 /* allocate the structure for the dialog to use */
3943 dialog = calloc( 1, offsetof( msi_dialog, name[wcslen( name ) + 1] ) );
3944 if( !dialog )
3945 return NULL;
3946 lstrcpyW( dialog->name, name );
3947 dialog->parent = parent;
3948 dialog->package = package;
3949 dialog->event_handler = event_handler;
3950 dialog->finished = 0;
3951 list_init( &dialog->controls );
3952 list_init( &dialog->fonts );
3953
3954 /* verify that the dialog exists */
3955 rec = get_dialog_record( dialog );
3956 if( !rec )
3957 {
3958 free( dialog );
3959 return NULL;
3960 }
3961 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3962 dialog->control_default = wcsdup( MSI_RecordGetString( rec, 9 ) );
3963 dialog->control_cancel = wcsdup( MSI_RecordGetString( rec, 10 ) );
3964 msiobj_release( &rec->hdr );
3965
3966 rec = MSI_CreateRecord(2);
3967 if (!rec)
3968 {
3970 return NULL;
3971 }
3972 MSI_RecordSetStringW(rec, 1, name);
3973 MSI_RecordSetStringW(rec, 2, L"Dialog created");
3975 msiobj_release(&rec->hdr);
3976
3977 return dialog;
3978}
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:3900
void msi_dialog_destroy(msi_dialog *dialog)
Definition: dialog.c:4055
static MSIRECORD * get_dialog_record(msi_dialog *dialog)
Definition: dialog.c:3578
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 3500 of file dialog.c.

3501{
3504 UINT i;
3505
3506 /* find and call the function that can create this type of control */
3508 for( i = 0; i < ARRAY_SIZE( msi_dialog_handler ); i++ )
3510 break;
3513 else
3514 ERR("no handler for element type %s\n", debugstr_w(control_type));
3515
3516 return ERROR_SUCCESS;
3517}
#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:3474
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 2156 of file dialog.c.

2157{
2159 msi_dialog *dialog = group->dialog;
2160 struct control *control;
2161 LPCWSTR prop, text, name;
2163
2164 name = MSI_RecordGetString( rec, 3 );
2165 text = MSI_RecordGetString( rec, 8 );
2166
2167 control = dialog_create_window( dialog, rec, 0, L"BUTTON", name, text, style,
2168 group->parent->hwnd );
2169 if (!control)
2170 return ERROR_FUNCTION_FAILED;
2172
2173 if (group->propval && !wcscmp( control->name, group->propval ))
2175
2176 prop = MSI_RecordGetString( rec, 1 );
2177 if( prop )
2178 control->property = wcsdup( prop );
2179
2180 return ERROR_SUCCESS;
2181}
static UINT dialog_radiogroup_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2143
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 2783 of file dialog.c.

2784{
2785 struct control *control;
2786 LPCWSTR prop;
2787 DWORD style;
2788
2789 /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
2793 if (!control)
2794 return ERROR_FUNCTION_FAILED;
2795
2797 prop = MSI_RecordGetString( rec, 9 );
2799
2801
2802 return ERROR_SUCCESS;
2803}
static void dialog_update_directory_combo(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2766
#define WS_VSCROLL
Definition: pedump.c:627
#define CBS_HASSTRINGS
Definition: winuser.h:285

◆ dialog_directory_list()

static UINT dialog_directory_list ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3001 of file dialog.c.

3002{
3003 struct control *control;
3004 LPCWSTR prop;
3005 DWORD style;
3006
3011 if (!control)
3012 return ERROR_FUNCTION_FAILED;
3013
3016 prop = MSI_RecordGetString( rec, 9 );
3018
3019 /* double click to activate an item in the list */
3022
3024
3025 return ERROR_SUCCESS;
3026}
static void dialog_update_directory_list(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2807
static UINT dialog_dirlist_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2936
#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 2911 of file dialog.c.

2912{
2913 struct control *control;
2914 WCHAR *path;
2915 LVITEMW item;
2916 int index;
2917
2918 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2919
2921
2922 item.mask = LVIF_TEXT;
2923 item.iItem = 0;
2924 item.iSubItem = 0;
2925 item.pszText = get_unique_folder_name( path, &item.cchTextMax );
2926
2930
2931 free( path );
2932 free( item.pszText );
2933 return ERROR_SUCCESS;
2934}
#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:2883
static WCHAR * get_path_property(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2020
static ATOM item
Definition: dde.c:856
#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 2852 of file dialog.c.

2853{
2854 struct control *control;
2855 LPWSTR prop, path, ptr;
2856 BOOL indirect;
2857
2858 control = dialog_find_control_by_type( dialog, L"DirectoryList" );
2861 path = dialog_dup_property( dialog, prop, TRUE );
2862
2863 /* strip off the last directory */
2865 if (ptr != path)
2866 {
2867 *(ptr - 1) = '\0';
2869 }
2870
2871 dialog_set_property( dialog->package, prop, path );
2872
2876
2877 free( path );
2878 free( prop );
2879
2880 return ERROR_SUCCESS;
2881}
static void dialog_update_pathedit(msi_dialog *dialog, struct control *control)
Definition: dialog.c:2030
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
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:301

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

2937{
2938 NMHDR *nmhdr = (NMHDR *)param;
2939 WCHAR text[MAX_PATH], *new_path, *path, *prop;
2940 BOOL indirect;
2941
2942 switch (nmhdr->code)
2943 {
2944 case LVN_ENDLABELEDITW:
2945 {
2947 if (!info->item.pszText) return ERROR_SUCCESS;
2948 lstrcpynW( text, info->item.pszText, ARRAY_SIZE(text) );
2949 text[ARRAY_SIZE(text) - 1] = 0;
2950 break;
2951 }
2952 case LVN_ITEMACTIVATE:
2953 {
2954 LVITEMW item;
2956 if (index < 0)
2957 {
2958 ERR("no list-view item selected\n");
2959 return ERROR_FUNCTION_FAILED;
2960 }
2961
2962 item.iSubItem = 0;
2963 item.pszText = text;
2964 item.cchTextMax = MAX_PATH;
2966 text[ARRAY_SIZE(text) - 1] = 0;
2967 break;
2968 }
2969 default:
2970 return ERROR_SUCCESS;
2971 }
2972
2975 path = dialog_dup_property( dialog, prop, TRUE );
2976
2977 if (!(new_path = malloc( (wcslen(path) + wcslen(text) + 2) * sizeof(WCHAR) )))
2978 {
2979 free( prop );
2980 free( path );
2981 return ERROR_OUTOFMEMORY;
2982 }
2983 lstrcpyW( new_path, path );
2984 lstrcatW( new_path, text );
2985 if (nmhdr->code == LVN_ENDLABELEDITW) CreateDirectoryW( new_path, NULL );
2986 lstrcatW( new_path, L"\\" );
2987
2988 dialog_set_property( dialog->package, prop, new_path );
2989
2993
2994 free( prop );
2995 free( path );
2996 free( new_path );
2997
2998 return ERROR_SUCCESS;
2999}
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
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:3162

Referenced by dialog_directory_list().

◆ dialog_do_preview()

static void dialog_do_preview ( msi_dialog dialog)
static

Definition at line 4025 of file dialog.c.

4026{
4027 TRACE("\n");
4028 dialog->attributes |= msidbDialogAttributesVisible;
4029 dialog->attributes &= ~msidbDialogAttributesModal;
4031}
static UINT dialog_run_message_loop(msi_dialog *dialog)
Definition: dialog.c:3839
@ 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 1614 of file dialog.c.

1615{
1616 struct control *control;
1617 LPCWSTR prop, text;
1618 LPWSTR val, begin, end;
1620 DWORD limit;
1621
1624
1625 text = MSI_RecordGetString( rec, 10 );
1626 if ( text )
1627 {
1628 begin = wcschr( text, '{' );
1629 end = wcschr( text, '}' );
1630
1631 if ( begin && end && end > begin &&
1632 begin[0] >= '0' && begin[0] <= '9' &&
1634 {
1635 lstrcpynW( num, begin + 1, end - begin );
1636 limit = wcstol( num, NULL, 10 );
1637
1639 }
1640 }
1641
1642 prop = MSI_RecordGetString( rec, 9 );
1643 if( prop )
1644 control->property = wcsdup( prop );
1645
1646 val = msi_dup_property( dialog->package->db, control->property );
1648 free( val );
1649 return ERROR_SUCCESS;
1650}
#define wcschr
Definition: compat.h:17
#define MAX_NUM_DIGITS
Definition: dialog.c:1612
static UINT dialog_edit_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:1595
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
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define EM_SETLIMITTEXT
Definition: winuser.h:2014
static clock_t begin
Definition: xmllint.c:458

◆ dialog_edit_handler()

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

Definition at line 1595 of file dialog.c.

1596{
1597 LPWSTR buf;
1598
1599 if (HIWORD(param) != EN_CHANGE)
1600 return ERROR_SUCCESS;
1601
1602 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name), debugstr_w(control->property));
1603
1606 free( buf );
1607
1608 return ERROR_SUCCESS;
1609}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define EN_CHANGE
Definition: winuser.h:2025

Referenced by dialog_edit_control().

◆ dialog_end_dialog()

static void dialog_end_dialog ( msi_dialog dialog)
static

Definition at line 3980 of file dialog.c.

3981{
3982 TRACE("%p\n", dialog);
3983 dialog->finished = 1;
3984 PostMessageW(dialog->hwnd, WM_NULL, 0, 0);
3985}
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1610

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

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

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

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

Referenced by event_do_dialog().

◆ dialog_fill_controls()

static UINT dialog_fill_controls ( msi_dialog dialog)
static

Definition at line 3519 of file dialog.c.

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

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

3548{
3549 LOGFONTW lf;
3551 BOOL r;
3552 LONG height = 0;
3553 HFONT hFont, hOldFont;
3554 HDC hdc;
3555
3556 hdc = GetDC( hwnd );
3557 if (hdc)
3558 {
3559 memset( &lf, 0, sizeof lf );
3560 lf.lfHeight = MulDiv(12, GetDeviceCaps(hdc, LOGPIXELSY), 72);
3561 lstrcpyW( lf.lfFaceName, L"MS Sans Serif" );
3563 if (hFont)
3564 {
3565 hOldFont = SelectObject( hdc, hFont );
3566 r = GetTextMetricsW( hdc, &tm );
3567 if (r)
3568 height = tm.tmHeight;
3569 SelectObject( hdc, hOldFont );
3571 }
3572 ReleaseDC( hwnd, hdc );
3573 }
3574 return height;
3575}
HFONT hFont
Definition: main.c:53
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: time.h:68
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c: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}
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
int ret

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

2606{
2607 struct control *control;
2608 DWORD style;
2609
2612 if (!control)
2613 return ERROR_FUNCTION_FAILED;
2614
2615 return ERROR_SUCCESS;
2616}
#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:3987
GLfloat units
Definition: glext.h:11727
INTERNETFEATURELIST feature
Definition: misc.c:1719
#define ctrl
Definition: input.c:1756
#define PBM_SETPOS
Definition: commctrl.h:2189
#define PBM_SETRANGE
Definition: commctrl.h:2188
#define MAKELPARAM(l, h)
Definition: winuser.h:4011

Referenced by msi_event_fire().

◆ dialog_hyperlink()

static UINT dialog_hyperlink ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3350 of file dialog.c.

3351{
3352 struct control *control;
3354 const WCHAR *text = MSI_RecordGetString( rec, 10 );
3355 int len = lstrlenW( text );
3356 LITEM item;
3357
3359 if (!control)
3360 return ERROR_FUNCTION_FAILED;
3361
3364
3366 item.iLink = 0;
3367 item.state = LIS_ENABLED;
3368 item.stateMask = LIS_ENABLED;
3369 if (len < L_MAX_URL_LENGTH) lstrcpyW( item.szUrl, text );
3370 else item.szUrl[0] = 0;
3371
3373
3374 return ERROR_SUCCESS;
3375}
#define lstrlenW
Definition: compat.h:750
static UINT dialog_hyperlink_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3305
#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 3305 of file dialog.c.

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

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}
#define SS_ICON
Definition: pedump.c:695
UINT_PTR WPARAM
Definition: windef.h:207
#define STM_SETICON
Definition: winuser.h:2095

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

2722{
2723 struct msi_listbox_info *info;
2724 struct control *control;
2726 LPCWSTR prop;
2727
2728 info = malloc( sizeof *info );
2729 if (!info)
2730 return ERROR_FUNCTION_FAILED;
2731
2733 attributes = MSI_RecordGetInteger( rec, 8 );
2735 style |= LBS_SORT;
2736
2738 if (!control)
2739 {
2740 free(info);
2741 return ERROR_FUNCTION_FAILED;
2742 }
2743
2745
2746 prop = MSI_RecordGetString( rec, 9 );
2748
2749 /* subclass */
2750 info->dialog = dialog;
2751 info->hwnd = control->hwnd;
2752 info->items = NULL;
2753 info->addpos_items = 0;
2756 SetPropW( control->hwnd, L"MSIDATA", info );
2757
2758 if ( control->property )
2760
2761 return ERROR_SUCCESS;
2762}
static UINT dialog_listbox_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2702
static LRESULT WINAPI MSIListBox_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2630
static UINT listbox_add_items(struct msi_listbox_info *info, const WCHAR *property)
Definition: dialog.c:2675
#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 2702 of file dialog.c.

2703{
2704 struct msi_listbox_info *info;
2705 int index;
2706 LPCWSTR value;
2707
2708 if( HIWORD(param) != LBN_SELCHANGE )
2709 return ERROR_SUCCESS;
2710
2711 info = GetPropW( control->hwnd, L"MSIDATA" );
2714
2715 dialog_set_property( info->dialog->package, control->property, value );
2717
2718 return ERROR_SUCCESS;
2719}
#define LB_GETITEMDATA
Definition: winuser.h:2044
#define LBN_SELCHANGE
Definition: winuser.h:2078
#define LB_GETCURSEL
Definition: winuser.h:2042

Referenced by dialog_list_box().

◆ dialog_listview()

static UINT dialog_listview ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3434 of file dialog.c.

3435{
3436 struct control *control;
3437 LPCWSTR prop;
3439 LVCOLUMNW col;
3440 RECT rc;
3441
3444 attributes = MSI_RecordGetInteger( rec, 8 );
3448 if (!control)
3449 return ERROR_FUNCTION_FAILED;
3450
3451 prop = MSI_RecordGetString( rec, 9 );
3453
3456
3457 col.mask = LVCF_FMT | LVCF_WIDTH;
3458 col.fmt = LVCFMT_LEFT;
3459 col.cx = 16;
3461
3462 GetClientRect( control->hwnd, &rc );
3463 col.cx = rc.right - 16;
3465
3466 if (control->property)
3468
3470
3471 return ERROR_SUCCESS;
3472}
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static UINT dialog_listview_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3385
static UINT listview_add_items(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3419
#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:308
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 3385 of file dialog.c.

3386{
3387 NMHDR *nmhdr = (NMHDR *)param;
3388
3389 FIXME("code %#x (%d)\n", nmhdr->code, nmhdr->code);
3390
3391 return ERROR_SUCCESS;
3392}

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

1925{
1926 LPWSTR font_mask, val = NULL, font;
1927 struct msi_maskedit_info *info = NULL;
1929 struct control *control;
1930 LPCWSTR prop, mask;
1931
1932 TRACE("\n");
1933
1934 font_mask = get_deformatted_field( dialog->package, rec, 10 );
1935 font = dialog_get_style( font_mask, &mask );
1936 if( !mask )
1937 {
1938 WARN("mask template is empty\n");
1939 goto end;
1940 }
1941
1943 if( !info )
1944 {
1945 ERR("template %s is invalid\n", debugstr_w(mask));
1946 goto end;
1947 }
1948
1949 info->dialog = dialog;
1950
1952 if( !control )
1953 {
1954 ERR("Failed to create maskedit container\n");
1956 goto end;
1957 }
1959
1960 info->hwnd = control->hwnd;
1961
1962 /* subclass the static control */
1963 info->oldproc = (WNDPROC) SetWindowLongPtrW( info->hwnd, GWLP_WNDPROC,
1965 SetPropW( control->hwnd, L"MSIDATA", info );
1966
1967 prop = MSI_RecordGetString( rec, 9 );
1968 if( prop )
1969 info->prop = wcsdup( prop );
1970
1972
1973 if( prop )
1974 {
1975 val = msi_dup_property( dialog->package->db, prop );
1976 if( val )
1977 {
1979 free( val );
1980 }
1981 }
1982
1983end:
1984 if( ret != ERROR_SUCCESS )
1985 free( info );
1986 free( font_mask );
1987 free( font );
1988 return ret;
1989}
#define WARN(fmt,...)
Definition: precomp.h:61
static struct msi_maskedit_info * dialog_parse_groups(const WCHAR *mask)
Definition: dialog.c:1815
static LRESULT WINAPI MSIMaskedEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:1760
static void maskedit_set_text(struct msi_maskedit_info *info, const WCHAR *text)
Definition: dialog.c:1791
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:1876
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:854

◆ dialog_oncommand()

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

Definition at line 3726 of file dialog.c.

3727{
3728 struct control *control = NULL;
3729
3730 TRACE( "%p, %#Ix, %p\n", dialog, param, hwnd );
3731
3732 switch (param)
3733 {
3734 case 1: /* enter */
3735 control = dialog_find_control( dialog, dialog->control_default );
3736 break;
3737 case 2: /* escape */
3738 control = dialog_find_control( dialog, dialog->control_cancel );
3739 break;
3740 default:
3742 }
3743
3744 if( control )
3745 {
3746 if( control->handler )
3747 {
3750 }
3751 }
3752
3753 return 0;
3754}
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 3673 of file dialog.c.

3674{
3675 msi_dialog *dialog = cs->lpCreateParams;
3676 MSIRECORD *rec = NULL;
3677 LPWSTR title = NULL;
3678 RECT pos;
3679
3680 TRACE("%p %p\n", dialog, dialog->package);
3681
3682 dialog->hwnd = hwnd;
3684
3685 rec = get_dialog_record( dialog );
3686 if( !rec )
3687 {
3688 TRACE("No record found for dialog %s\n", debugstr_w(dialog->name));
3689 return -1;
3690 }
3691
3693
3695
3696 dialog->attributes = MSI_RecordGetInteger( rec, 6 );
3697
3698 dialog->default_font = msi_dup_property( dialog->package->db, L"DefaultUIFont" );
3699 if (!dialog->default_font)
3700 {
3701 dialog->default_font = wcsdup( L"MS Shell Dlg" );
3702 if (!dialog->default_font)
3703 {
3704 msiobj_release( &rec->hdr );
3705 return -1;
3706 }
3707 }
3708
3709 title = get_deformatted_field( dialog->package, rec, 7 );
3711 free( title );
3712
3713 SetWindowPos( hwnd, 0, pos.left, pos.top,
3714 pos.right - pos.left, pos.bottom - pos.top,
3716
3721 msiobj_release( &rec->hdr );
3722
3723 return 0;
3724}
static INT dialog_get_sans_serif_height(HWND hwnd)
Definition: dialog.c:3547
static void dialog_set_tab_order(msi_dialog *dialog, const WCHAR *first)
Definition: dialog.c:3643
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:3592
static UINT dialog_fill_controls(msi_dialog *dialog)
Definition: dialog.c:3519
#define cs
Definition: i386-dis.c:442
#define GWLP_USERDATA
Definition: treelist.c:63
#define SWP_NOACTIVATE
Definition: winuser.h:1245
#define SWP_NOREDRAW
Definition: winuser.h:1249
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1250

Referenced by MSIDialog_WndProc().

◆ dialog_onkillfocus()

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

Definition at line 2056 of file dialog.c.

2057{
2058 LPWSTR buf, prop;
2059 BOOL indirect;
2060 BOOL valid;
2061
2064
2066
2067 if ( !dialog_verify_path( buf ) )
2068 {
2069 /* FIXME: display an error message box */
2070 ERR("Invalid path %s\n", debugstr_w( buf ));
2071 valid = FALSE;
2072 SetFocus( control->hwnd );
2073 }
2074 else
2075 {
2076 valid = TRUE;
2077 dialog_set_property( dialog->package, prop, buf );
2078 }
2079
2081
2082 TRACE("edit %s contents changed, set %s\n", debugstr_w(control->name),
2083 debugstr_w(prop));
2084
2085 free( buf );
2086 free( prop );
2087
2088 return valid;
2089}
static BOOL dialog_verify_path(const WCHAR *path)
Definition: dialog.c:2044
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 3756 of file dialog.c.

3757{
3758 LPNMHDR nmhdr = (LPNMHDR) param;
3760
3761 TRACE("%p %p\n", dialog, nmhdr->hwndFrom);
3762
3763 if ( control && control->handler )
3765
3766 return 0;
3767}
HWND hwndFrom
Definition: winuser.h:3160
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 1815 of file dialog.c.

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

2117{
2118 struct msi_pathedit_info *info;
2119 struct control *control;
2120 LPCWSTR prop;
2121
2122 info = malloc( sizeof *info );
2123 if (!info)
2124 return ERROR_FUNCTION_FAILED;
2125
2128 prop = MSI_RecordGetString( rec, 9 );
2131
2132 info->dialog = dialog;
2133 info->control = control;
2136 SetPropW( control->hwnd, L"MSIDATA", info );
2137
2139
2140 return ERROR_SUCCESS;
2141}
static LRESULT WINAPI MSIPathEdit_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2091

◆ dialog_progress_bar()

static UINT dialog_progress_bar ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 1993 of file dialog.c.

1994{
1995 struct control *control;
1997
1998 style = WS_VISIBLE;
1999 attributes = MSI_RecordGetInteger( rec, 8 );
2001 style |= PBS_SMOOTH;
2002
2004 if( !control )
2005 return ERROR_FUNCTION_FAILED;
2006
2007 event_subscribe( dialog, L"SetProgress", control->name, L"Progress" );
2008 return ERROR_SUCCESS;
2009}
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 2208 of file dialog.c.

2209{
2210 UINT r;
2211 LPCWSTR prop;
2212 struct control *control;
2213 MSIQUERY *view;
2215 MSIPACKAGE *package = dialog->package;
2216 WNDPROC oldproc;
2218
2219 prop = MSI_RecordGetString( rec, 9 );
2220
2221 TRACE("%p %p %s\n", dialog, rec, debugstr_w( prop ));
2222
2223 attr = MSI_RecordGetInteger( rec, 8 );
2225 style |= WS_VISIBLE;
2227 style |= WS_DISABLED;
2229 style |= BS_GROUPBOX;
2230 else
2232
2233 /* Create parent group box to hold radio buttons */
2234 control = dialog_add_control( dialog, rec, L"BUTTON", style );
2235 if( !control )
2236 return ERROR_FUNCTION_FAILED;
2237
2240 SetPropW(control->hwnd, L"MSIDATA", oldproc);
2242
2243 if( prop )
2244 control->property = wcsdup( prop );
2245
2246 /* query the Radio Button table for all control in this group */
2247 r = MSI_OpenQuery( package->db, &view, L"SELECT * FROM `RadioButton` WHERE `Property` = '%s'", prop );
2248 if( r != ERROR_SUCCESS )
2249 {
2250 ERR("query failed for dialog %s radio group %s\n",
2251 debugstr_w(dialog->name), debugstr_w(prop));
2253 }
2254
2255 group.dialog = dialog;
2256 group.parent = control;
2257 group.propval = msi_dup_property( dialog->package->db, control->property );
2258
2260 msiobj_release( &view->hdr );
2261 free( group.propval );
2262 return r;
2263}
static UINT dialog_create_radiobutton(MSIRECORD *rec, void *param)
Definition: dialog.c:2156
static LRESULT WINAPI MSIRadioGroup_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2189
@ 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 2143 of file dialog.c.

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

Referenced by dialog_create_radiobutton().

◆ dialog_register_class()

static BOOL dialog_register_class ( void  )
static

Definition at line 3900 of file dialog.c.

3901{
3902 WNDCLASSW cls;
3903
3904 ZeroMemory( &cls, sizeof cls );
3906 cls.hInstance = NULL;
3909 cls.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
3910 cls.lpszMenuName = NULL;
3911 cls.lpszClassName = L"MsiDialogCloseClass";
3912
3913 if( !RegisterClassW( &cls ) )
3914 return FALSE;
3915
3917 cls.lpszClassName = L"MsiHiddenWindow";
3918
3919 if( !RegisterClassW( &cls ) )
3920 return FALSE;
3921
3923
3924 hMsiHiddenWindow = CreateWindowW( L"MsiHiddenWindow", NULL, WS_OVERLAPPED,
3925 0, 0, 100, 100, NULL, NULL, NULL, NULL );
3926 if( !hMsiHiddenWindow )
3927 return FALSE;
3928
3929 return TRUE;
3930}
static LRESULT WINAPI MSIHiddenWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3883
static DWORD uiThreadId
Definition: dialog.c:131
static LRESULT WINAPI MSIDialog_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:3779
#define WS_OVERLAPPED
Definition: pedump.c:615
LPCWSTR lpszClassName
Definition: winuser.h:3188
LPCWSTR lpszMenuName
Definition: winuser.h:3187
HBRUSH hbrBackground
Definition: winuser.h:3186
HICON hIcon
Definition: winuser.h:3184
HINSTANCE hInstance
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3180
HCURSOR hCursor
Definition: winuser.h:3185
#define ZeroMemory
Definition: winbase.h:1736
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
#define IDI_APPLICATION
Definition: winuser.h:704
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4319
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
#define COLOR_3DFACE
Definition: winuser.h:932

Referenced by dialog_create().

◆ dialog_reset()

static UINT dialog_reset ( msi_dialog dialog)
static

Definition at line 3540 of file dialog.c.

3541{
3542 /* FIXME: should restore the original values of any properties we changed */
3544}

Referenced by event_reset().

◆ dialog_run_message_loop()

static UINT dialog_run_message_loop ( msi_dialog dialog)
static

Definition at line 3839 of file dialog.c.

3840{
3841 DWORD style;
3842 HWND hwnd, parent;
3843
3846
3847 /* create the dialog window, don't show it yet */
3849 if( dialog->attributes & msidbDialogAttributesVisible )
3850 style |= WS_VISIBLE;
3851
3852 if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
3854
3855 parent = dialog->parent ? dialog->parent->hwnd : 0;
3856
3857 hwnd = CreateWindowW( L"MsiDialogCloseClass", dialog->name, style,
3859 parent, NULL, NULL, dialog );
3860 if( !hwnd )
3861 {
3862 ERR("Failed to create dialog %s\n", debugstr_w( dialog->name ));
3863 return ERROR_FUNCTION_FAILED;
3864 }
3865
3867 /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */
3868
3869 if( dialog->attributes & msidbDialogAttributesModal )
3870 {
3871 while( !dialog->finished )
3872 {
3875 }
3876 }
3877 else
3878 return ERROR_IO_PENDING;
3879
3880 return ERROR_SUCCESS;
3881}
#define ERROR_IO_PENDING
Definition: dderror.h:15
static void process_pending_messages(HWND hdlg)
Definition: dialog.c:3827
#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:906
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:778

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

2560{
2561 struct control *control;
2562 LPCWSTR prop, control_name;
2563 MSIPACKAGE *package = dialog->package;
2564 DWORD style;
2566
2567 info = malloc( sizeof *info );
2568 if (!info)
2569 return ERROR_FUNCTION_FAILED;
2570
2571 /* create the treeview control */
2575 if (!control)
2576 {
2577 free(info);
2578 return ERROR_FUNCTION_FAILED;
2579 }
2580
2582 control_name = MSI_RecordGetString( rec, 2 );
2584 prop = MSI_RecordGetString( rec, 9 );
2586
2587 /* subclass */
2588 info->dialog = dialog;
2589 info->hwnd = control->hwnd;
2592 SetPropW( control->hwnd, L"MSIDATA", info );
2593
2594 event_subscribe( dialog, L"SelectionPath", control_name, L"Property" );
2595
2596 /* initialize it */
2599
2600 return ERROR_SUCCESS;
2601}
static void seltree_create_imagelist(HWND hwnd)
Definition: dialog.c:2466
static void seltree_add_child_features(MSIPACKAGE *package, HWND hwnd, const WCHAR *parent, HTREEITEM hParent)
Definition: dialog.c:2416
static LRESULT WINAPI MSISelectionTree_WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: dialog.c:2382
static UINT dialog_seltree_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:2503
#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 2503 of file dialog.c.

2504{
2505 struct msi_selection_tree_info *info = GetPropW( control->hwnd, L"MSIDATA" );
2507 MSIRECORD *row, *rec;
2510 LPCWSTR dir, title = NULL;
2512
2513 if (tv->hdr.code != TVN_SELCHANGINGW)
2514 return ERROR_SUCCESS;
2515
2516 info->selected = tv->itemNew.hItem;
2517
2518 if (!(tv->itemNew.mask & TVIF_TEXT))
2519 {
2521 if (feature)
2522 title = feature->Title;
2523 }
2524 else
2525 title = tv->itemNew.pszText;
2526
2527 row = MSI_QueryGetRecord( dialog->package->db, L"SELECT * FROM `Feature` WHERE `Title` = '%s'", title );
2528 if (!row)
2529 return ERROR_FUNCTION_FAILED;
2530
2531 rec = MSI_CreateRecord( 1 );
2532
2534 msi_event_fire( dialog->package, L"SelectionDescription", rec );
2535
2536 dir = MSI_RecordGetString( row, 7 );
2537 if (dir)
2538 {
2539 folder = msi_get_loaded_folder( dialog->package, dir );
2540 if (!folder)
2541 {
2543 goto done;
2544 }
2545 MSI_RecordSetStringW( rec, 1, folder->ResolvedTarget );
2546 }
2547 else
2548 MSI_RecordSetStringW( rec, 1, NULL );
2549
2550 msi_event_fire( dialog->package, L"SelectionPath", rec );
2551
2552done:
2553 msiobj_release(&row->hdr);
2554 msiobj_release(&rec->hdr);
2555
2556 return r;
2557}
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:4417
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 1434 of file dialog.c.

1435{
1437 struct control *control;
1439 UINT r;
1440
1441 name = MSI_RecordGetString( rec, 2 );
1442 action = MSI_RecordGetString( rec, 3 );
1443 condition = MSI_RecordGetString( rec, 4 );
1446 if (r == MSICONDITION_TRUE && control)
1447 {
1448 TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
1449
1450 /* FIXME: case sensitive? */
1451 if (!wcscmp( action, L"Hide" ))
1453 else if (!wcscmp( action, L"Show" ))
1455 else if (!wcscmp( action, L"Disable" ))
1457 else if (!wcscmp( action, L"Enable" ))
1459 else if (!wcscmp( action, L"Default" ))
1461 else
1462 FIXME("Unhandled action %s\n", debugstr_w(action));
1463 }
1464 return ERROR_SUCCESS;
1465}
const WCHAR * action
Definition: action.c:7509
#define SW_HIDE
Definition: winuser.h:771
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:1653

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

3644{
3645 struct list tab_chain;
3646 struct control *control;
3647 HWND prev = HWND_TOP;
3648
3649 list_init( &tab_chain );
3650 if (!(control = dialog_find_control( dialog, first ))) return;
3651
3652 dialog->hWndFocus = control->hwnd;
3653 while (control)
3654 {
3656 list_add_tail( &tab_chain, &control->entry );
3657 if (!control->tabnext) break;
3659 }
3660
3661 LIST_FOR_EACH_ENTRY( control, &tab_chain, struct control, entry )
3662 {
3663 SetWindowPos( control->hwnd, prev, 0, 0, 0, 0,
3666 prev = control->hwnd;
3667 }
3668
3669 /* put them back on the main list */
3670 list_move_head( &dialog->controls, &tab_chain );
3671}
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:1253
#define SWP_NOMOVE
Definition: winuser.h:1247
#define SWP_NOSIZE
Definition: winuser.h:1248
#define HWND_TOP
Definition: winuser.h:1210
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252
#define SWP_NOSENDCHANGING
Definition: winuser.h:1254

Referenced by dialog_oncreate().

◆ dialog_setfocus()

static void dialog_setfocus ( msi_dialog dialog)
static

Definition at line 3769 of file dialog.c.

3770{
3771 HWND hwnd = dialog->hWndFocus;
3772
3775 SetFocus( hwnd );
3776 dialog->hWndFocus = hwnd;
3777}
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 2766 of file dialog.c.

2767{
2768 WCHAR *path;
2769
2770 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryCombo" )))
2771 return;
2772
2773 if (!(path = get_path_property( dialog, control ))) return;
2776
2779
2780 free( path );
2781}
void WINAPI PathStripPathW(LPWSTR lpszPath)
Definition: path.c:694
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
Definition: path.c:867
#define CB_INSERTSTRING
Definition: winuser.h:1960

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

2808{
2809 WCHAR dir_spec[MAX_PATH], *path;
2810 WIN32_FIND_DATAW wfd;
2811 LVITEMW item;
2812 HANDLE file;
2813
2814 if (!control && !(control = dialog_find_control_by_type( dialog, L"DirectoryList" )))
2815 return;
2816
2817 /* clear the list-view */
2819
2820 if (!(path = get_path_property( dialog, control ))) return;
2821 lstrcpyW( dir_spec, path );
2822 lstrcatW( dir_spec, L"*" );
2823
2824 file = FindFirstFileW( dir_spec, &wfd );
2826 {
2827 free( path );
2828 return;
2829 }
2830
2831 do
2832 {
2833 if ( wfd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY )
2834 continue;
2835
2836 if ( !wcscmp( wfd.cFileName, L"." ) || !wcscmp( wfd.cFileName, L".." ) )
2837 continue;
2838
2839 item.mask = LVIF_TEXT;
2840 item.cchTextMax = MAX_PATH;
2841 item.iItem = 0;
2842 item.iSubItem = 0;
2843 item.pszText = wfd.cFileName;
2844
2846 } while ( FindNextFileW( file, &wfd ) );
2847
2848 free( path );
2849 FindClose( file );
2850}
#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
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 2030 of file dialog.c.

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

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

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

3131{
3133 LONGLONG difference, cost;
3134 WCHAR size_text[MAX_PATH];
3135 WCHAR cost_text[MAX_PATH];
3136 LPWSTR drives, ptr;
3137 LVITEMW lvitem;
3138#ifdef __REACTOS__
3139 DWORD size;
3140#else
3141 DWORD size, flags;
3142#endif
3143 int i = 0;
3144
3145 cost = vcl_get_cost(dialog) * 512;
3146 StrFormatByteSizeW(cost, cost_text, MAX_PATH);
3147
3149 if ( !size ) return;
3150
3151 drives = malloc( (size + 1) * sizeof(WCHAR) );
3152 if ( !drives ) return;
3153
3154 GetLogicalDriveStringsW( size, drives );
3155
3156 ptr = drives;
3157 while (*ptr)
3158 {
3159#ifdef __REACTOS__
3161#else
3162 if (GetVolumeInformationW(ptr, NULL, 0, NULL, 0, &flags, NULL, 0) &&
3164#endif
3165 {
3166 ptr += lstrlenW(ptr) + 1;
3167 continue;
3168 }
3169
3170 lvitem.mask = LVIF_TEXT;
3171 lvitem.iItem = i;
3172 lvitem.iSubItem = 0;
3173 lvitem.pszText = ptr;
3174 lvitem.cchTextMax = lstrlenW(ptr) + 1;
3176
3178 difference = unused.QuadPart - cost;
3179
3180 StrFormatByteSizeW(total.QuadPart, size_text, MAX_PATH);
3181 lvitem.iSubItem = 1;
3182 lvitem.pszText = size_text;
3183 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3184 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3185
3186 StrFormatByteSizeW(unused.QuadPart, size_text, MAX_PATH);
3187 lvitem.iSubItem = 2;
3188 lvitem.pszText = size_text;
3189 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3190 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3191
3192 lvitem.iSubItem = 3;
3193 lvitem.pszText = cost_text;
3194 lvitem.cchTextMax = lstrlenW(cost_text) + 1;
3195 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3196
3197 StrFormatByteSizeW(difference, size_text, MAX_PATH);
3198 lvitem.iSubItem = 4;
3199 lvitem.pszText = size_text;
3200 lvitem.cchTextMax = lstrlenW(size_text) + 1;
3201 SendMessageW( control->hwnd, LVM_SETITEMW, 0, (LPARAM)&lvitem );
3202
3203 ptr += lstrlenW(ptr) + 1;
3204 i++;
3205 }
3206
3207 free( drives );
3208}
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:3108
LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax)
Definition: string.c:2388
#define FILE_READ_ONLY_VOLUME
Definition: from_kernel.h:246
GLsizeiptr size
Definition: glext.h:5919
WORD unused[29]
Definition: crypt.c:1155
#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 2044 of file dialog.c.

2045{
2046 if ( !path[0] )
2047 return FALSE;
2048
2049 if ( PathIsRelativeW( path ) )
2050 return FALSE;
2051
2052 return TRUE;
2053}
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: path.c:1579

Referenced by dialog_onkillfocus().

◆ dialog_volsel_handler()

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

Definition at line 3230 of file dialog.c.

3231{
3233 LPWSTR prop;
3234 BOOL indirect;
3235 int index;
3236
3237 if (HIWORD(param) != CBN_SELCHANGE)
3238 return ERROR_SUCCESS;
3239
3241 if ( index == CB_ERR )
3242 {
3243 ERR("No ComboBox item selected!\n");
3244 return ERROR_FUNCTION_FAILED;
3245 }
3246
3248
3251
3252 dialog_set_property( dialog->package, prop, text );
3253
3254 free( prop );
3255 return ERROR_SUCCESS;
3256}
#define CB_GETLBTEXT
Definition: winuser.h:1955

Referenced by dialog_volumeselect_combo().

◆ dialog_volumecost_list()

static UINT dialog_volumecost_list ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3210 of file dialog.c.

3211{
3212 struct control *control;
3213 DWORD style;
3214
3219 if (!control)
3220 return ERROR_FUNCTION_FAILED;
3221
3224
3225 return ERROR_SUCCESS;
3226}
static void dialog_vcl_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3130
static void dialog_vcl_add_columns(msi_dialog *dialog, struct control *control, MSIRECORD *rec)
Definition: dialog.c:3050

◆ dialog_volumeselect_combo()

static UINT dialog_volumeselect_combo ( msi_dialog dialog,
MSIRECORD rec 
)
static

Definition at line 3281 of file dialog.c.

3282{
3283 struct control *control;
3284 LPCWSTR prop;
3285 DWORD style;
3286
3287 /* FIXME: CBS_OWNERDRAWFIXED */
3292 if (!control)
3293 return ERROR_FUNCTION_FAILED;
3294
3297 prop = MSI_RecordGetString( rec, 9 );
3299
3301
3302 return ERROR_SUCCESS;
3303}
static void dialog_vsc_add_drives(msi_dialog *dialog, struct control *control)
Definition: dialog.c:3258
static UINT dialog_volsel_handler(msi_dialog *dialog, struct control *control, WPARAM param)
Definition: dialog.c:3230
#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 3258 of file dialog.c.

3259{
3260 LPWSTR drives, ptr;
3261 DWORD size;
3262
3264 if ( !size ) return;
3265
3266 drives = malloc( (size + 1) * sizeof(WCHAR) );
3267 if ( !drives ) return;
3268
3269 GetLogicalDriveStringsW( size, drives );
3270
3271 ptr = drives;
3272 while (*ptr)
3273 {
3275 ptr += lstrlenW(ptr) + 1;
3276 }
3277
3278 free( drives );
3279}

Referenced by dialog_volumeselect_combo().

◆ event_add_local()

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

Definition at line 4369 of file dialog.c.

4370{
4372
4373 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
4374 {
4375 if (!wcscmp( argument, feature->Feature ) || !wcscmp( argument, L"ALL" ))
4376 {
4377 if (feature->ActionRequest != INSTALLSTATE_LOCAL)
4378 msi_set_property( dialog->package->db, L"Preselected", L"1", -1 );
4380 }
4381 }
4382 return ERROR_SUCCESS;
4383}
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 4401 of file dialog.c.

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

◆ event_cleanup_subscriptions()

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

Definition at line 4041 of file dialog.c.

4042{
4043 struct list *item, *next;
4044
4046 {
4047 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4048
4049 if (wcscmp( sub->dialog->name, dialog )) continue;
4050 list_remove( &sub->entry );
4051 free_subscriber( sub );
4052 }
4053}
static void free_subscriber(struct subscriber *sub)
Definition: dialog.c:4033
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 4519 of file dialog.c.

4520{
4522}
static UINT dialog_directorylist_new(msi_dialog *dialog)
Definition: dialog.c:2911

◆ event_directory_list_up()

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

Definition at line 4514 of file dialog.c.

4515{
4517}
static UINT dialog_directorylist_up(msi_dialog *dialog)
Definition: dialog.c:2852

◆ event_do_action()

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

Definition at line 4363 of file dialog.c.

4364{
4365 ACTION_PerformAction(dialog->package, argument);
4366 return ERROR_SUCCESS;
4367}
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 4250 of file dialog.c.

4251{
4253 UINT r;
4254 INT retval;
4255
4256 /* create a new dialog */
4258 if (dialog)
4259 {
4260 /* kill the current modeless dialog */
4261 if (destroy_modeless && package->dialog)
4262 {
4263 msi_dialog_destroy( package->dialog );
4264 package->dialog = NULL;
4265 }
4266
4267 /* modeless dialogs return an error message */
4269 if (r == ERROR_SUCCESS)
4270 {
4271 retval = dialog->retval;
4273 return retval;
4274 }
4275 else
4276 {
4277 package->dialog = dialog;
4278 return IDOK;
4279 }
4280 }
4281 else return 0;
4282}
static UINT dialog_event_handler(msi_dialog *, const WCHAR *, const WCHAR *)
Definition: dialog.c:4561
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:3932
msi_dialog * dialog
Definition: msipriv.h:453
#define IDOK
Definition: winuser.h:833

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

4286{
4287 if (!wcscmp( argument, L"Exit" ))
4288 dialog->retval = IDCANCEL;
4289 else if (!wcscmp( argument, L"Retry" ))
4290 dialog->retval = IDRETRY;
4291 else if (!wcscmp( argument, L"Ignore" ))
4292 dialog->retval = IDOK;
4293 else if (!wcscmp( argument, L"Return" ))
4294 dialog->retval = 0;
4295 else
4296 {
4297 ERR("Unknown argument string %s\n", debugstr_w(argument));
4298 dialog->retval = IDABORT;
4299 }
4300 event_cleanup_subscriptions( dialog->package, dialog->name );
4302 return ERROR_SUCCESS;
4303}
static void event_cleanup_subscriptions(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4041
static void dialog_end_dialog(msi_dialog *dialog)
Definition: dialog.c:3980
#define IDCANCEL
Definition: winuser.h:834
#define IDABORT
Definition: winuser.h:835
#define IDRETRY
Definition: winuser.h:836

Referenced by pending_event_end_dialog().

◆ event_new_dialog()

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

Definition at line 4314 of file dialog.c.

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

Referenced by pending_event_new_dialog().

◆ event_reinstall()

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

Definition at line 4529 of file dialog.c.

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

◆ event_reinstall_mode()

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

Definition at line 4524 of file dialog.c.

4525{
4526 return msi_set_property( dialog->package->db, L"REINSTALLMODE", argument, -1 );
4527}

◆ event_remove()

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

Definition at line 4385 of file dialog.c.

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

◆ event_reset()

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

Definition at line 4448 of file dialog.c.

4449{
4451 return ERROR_SUCCESS;
4452}
static UINT dialog_reset(msi_dialog *dialog)
Definition: dialog.c:3540

◆ event_set_install_level()

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

Definition at line 4506 of file dialog.c.

4507{
4508 int level = wcstol( argument, NULL, 10 );
4509
4510 TRACE("setting install level to %d\n", level);
4511 return MSI_SetInstallLevel( dialog->package, level );
4512}
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 4430 of file dialog.c.

4431{
4432 WCHAR *path = msi_dup_property( dialog->package->db, argument );
4433 MSIRECORD *rec = MSI_CreateRecord( 1 );
4435
4436 MSI_RecordSetStringW( rec, 1, path );
4437 msi_event_fire( dialog->package, L"SelectionPath", rec );
4438 if (path)
4439 {
4440 /* failure to set the path halts the executing of control events */
4441 r = MSI_SetTargetPathW( dialog->package, argument, path );
4442 free( path );
4443 }
4444 msiobj_release( &rec->hdr );
4445 return r;
4446}
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 4332 of file dialog.c.

4333{
4334 INT r;
4335 /* don't destroy a modeless dialogs that might be our parent */
4336 r = event_do_dialog( dialog->package, argument, dialog, FALSE );
4337 if (r != 0)
4338 {
4339 dialog->retval = r;
4341 }
4342 else
4344
4345 return ERROR_SUCCESS;
4346}
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 4357 of file dialog.c.

4358{
4359 FIXME("doing nothing\n");
4360 return ERROR_SUCCESS;
4361}

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

4535{
4536 return msi_validate_product_id( dialog->package );
4537}
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7188

◆ free_subscriber()

static void free_subscriber ( struct subscriber sub)
static

Definition at line 4033 of file dialog.c.

4034{
4035 free( sub->event );
4036 free( sub->control );
4037 free( sub->attribute );
4038 free( sub );
4039}

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

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

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

2021{
2022 WCHAR *prop, *path;
2024 if (!(prop = dialog_dup_property( dialog, control->property, indirect ))) return NULL;
2025 path = dialog_dup_property( dialog, prop, TRUE );
2026 free( prop );
2027 return path;
2028}

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

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

Referenced by 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:1384

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

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

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

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

Referenced by dialog_list_box().

◆ listview_add_item()

static UINT listview_add_item ( MSIRECORD rec,
void param 
)
static

Definition at line 3394 of file dialog.c.

3395{
3396 struct listview_param *lv_param = (struct listview_param *)param;
3398 LVITEMW item;
3399 HICON hIcon;
3400
3401 text = MSI_RecordGetString( rec, 4 );
3402 binary = MSI_RecordGetString( rec, 5 );
3403 hIcon = load_icon( lv_param->dialog->package->db, binary, 0 );
3404
3405 TRACE("Adding: text %s, binary %s, icon %p\n", debugstr_w(text), debugstr_w(binary), hIcon);
3406
3407 memset( &item, 0, sizeof(item) );
3408 item.mask = LVIF_TEXT | LVIF_IMAGE;
3409 deformat_string( lv_param->dialog->package, text, &item.pszText );
3410 item.iImage = ImageList_AddIcon( lv_param->control->hImageList, hIcon );
3411 item.iItem = item.iImage;
3412 SendMessageW( lv_param->control->hwnd, LVM_INSERTITEMW, 0, (LPARAM)&item );
3413
3414 DestroyIcon( hIcon );
3415
3416 return ERROR_SUCCESS;
3417}
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:3382
msi_dialog * dialog
Definition: dialog.c:3381
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 3419 of file dialog.c.

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

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
482 if( attributes & msidbControlAttributesFixedSize )
483 {
484 flags &= ~LR_DEFAULTSIZE;
485 if( attributes & msidbControlAttributesIconSize16 )
486 {
487 cx += 16;
488 cy += 16;
489 }
490 if( attributes & msidbControlAttributesIconSize32 )
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:2255

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
Definition: bl.h:1331
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}
static const WCHAR dc[]

Referenced by dialog_map_events().

◆ mask_control_change()

static void mask_control_change ( struct msi_maskedit_info info)
static

Definition at line 1690 of file dialog.c.

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

Referenced by MSIMaskedEdit_WndProc().

◆ mask_editable()

static BOOL mask_editable ( WCHAR  type)
static

Definition at line 1675 of file dialog.c.

1676{
1677 switch (type)
1678 {
1679 case '%':
1680 case '#':
1681 case '&':
1682 case '`':
1683 case '?':
1684 case '^':
1685 return TRUE;
1686 }
1687 return FALSE;
1688}

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

1740{
1741 HWND hWndNext;
1742 UINT len, i;
1743
1744 for( i=0; i<info->num_groups; i++ )
1745 if( info->group[i].hwnd == hWnd )
1746 break;
1747
1748 /* don't move from the last control */
1749 if( i >= (info->num_groups-1) )
1750 return;
1751
1753 if( len < info->group[i].len )
1754 return;
1755
1756 hWndNext = GetNextDlgTabItem( GetParent( hWnd ), hWnd, FALSE );
1757 SetFocus( hWndNext );
1758}
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 1876 of file dialog.c.

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

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

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

Referenced by dialog_maskedit_control().

◆ MSI_ClosePreview()

static void MSI_ClosePreview ( MSIOBJECTHDR arg)
static

Definition at line 4119 of file dialog.c.

4120{
4122 msiobj_release( &preview->package->hdr );
4123}
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 3987 of file dialog.c.

3988{
3989 DWORD r;
3990
3991 /* in threads other than the UI thread, block */
3993 {
3994 if (!handle) return;
3996 {
3997 MSG msg;
3998 while (PeekMessageW( &msg, NULL, 0, 0, PM_REMOVE ))
3999 {
4002 }
4003 }
4004 return;
4005 }
4006
4007 /* there are two choices for the UI thread */
4008 while (1)
4009 {
4011
4012 if( !handle )
4013 break;
4014
4015 /*
4016 * block here until somebody creates a new dialog or
4017 * the handle we're waiting on becomes ready
4018 */
4020 if( r == WAIT_OBJECT_0 )
4021 break;
4022 }
4023}
#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:431
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:1199
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 4055 of file dialog.c.

4056{
4057 struct font *font, *next;
4058
4060 {
4062 return;
4063 }
4064
4065 if( dialog->hwnd )
4066 {
4067 ShowWindow( dialog->hwnd, SW_HIDE );
4068 DestroyWindow( dialog->hwnd );
4069 }
4070
4071 /* unsubscribe events */
4072 event_cleanup_subscriptions( dialog->package, dialog->name );
4073
4074 /* destroy the list of controls */
4075 while( !list_empty( &dialog->controls ) )
4076 {
4077 struct control *t;
4078
4079 t = LIST_ENTRY( list_head( &dialog->controls ), struct control, entry );
4080 destroy_control( t );
4081 }
4082
4083 /* destroy the list of fonts */
4084 LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, struct font, entry )
4085 {
4086 list_remove( &font->entry );
4087 DeleteObject( font->hfont );
4088 free( font );
4089 }
4090 free( dialog->default_font );
4091
4092 free( dialog->control_default );
4093 free( dialog->control_cancel );
4094 dialog->package = NULL;
4095 free( dialog );
4096}
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 4098 of file dialog.c.

4099{
4102 UnregisterClassW( L"MsiDialogCloseClass", NULL );
4103 UnregisterClassW( L"MsiHiddenWindow", NULL );
4104 uiThreadId = 0;
4105}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ MSI_EnableUIPreview()

static MSIPREVIEW * MSI_EnableUIPreview ( MSIDATABASE db)
static

Definition at line 4125 of file dialog.c.

4126{
4128 MSIPACKAGE *package;
4129
4130 package = MSI_CreatePackage( db );
4131 if (package)
4132 {
4134 if (preview)
4135 {
4136 preview->package = package;
4137 msiobj_addref( &package->hdr );
4138 }
4139 msiobj_release( &package->hdr );
4140 }
4141 return preview;
4142}
static void MSI_ClosePreview(MSIOBJECTHDR *arg)
Definition: dialog.c:4119
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 4107 of file dialog.c.

4108{
4109 struct list *item, *next;
4110
4112 {
4113 struct subscriber *sub = LIST_ENTRY( item, struct subscriber, entry );
4114 list_remove( &sub->entry );
4115 free_subscriber( sub );
4116 }
4117}

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

4418{
4419 struct subscriber *sub;
4420
4421 TRACE("firing event %s\n", debugstr_w(event));
4422
4423 LIST_FOR_EACH_ENTRY( sub, &package->subscriptions, struct subscriber, entry )
4424 {
4425 if (wcsicmp( sub->event, event )) continue;
4426 dialog_handle_event( sub->dialog, sub->control, sub->attribute, rec );
4427 }
4428}
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 4174 of file dialog.c.

4175{
4178
4179 if (preview->dialog)
4180 msi_dialog_destroy( preview->dialog );
4181
4182 /* an empty name means we should just destroy the current preview dialog */
4183 if (szDialogName)
4184 {
4185 dialog = dialog_create( preview->package, szDialogName, NULL, preview_event_handler );
4186 if (dialog)
4188 else
4190 }
4191 preview->dialog = dialog;
4192 return r;
4193}
static UINT preview_event_handler(msi_dialog *dialog, const WCHAR *event, const WCHAR *argument)
Definition: dialog.c:4168
static void dialog_do_preview(msi_dialog *dialog)
Definition: dialog.c:4025

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: windef.h:209
HANDLE WINAPI RemovePropW(_In_ HWND, _In_ LPCWSTR)
#define WM_NCDESTROY
Definition: winuser.h:1687
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 3779 of file dialog.c.

3781{
3783
3784 TRACE("0x%04x\n", msg);
3785
3786 switch (msg)
3787 {
3788 case WM_MOVE:
3789 dialog->package->center_x = LOWORD(lParam) + dialog->size.cx / 2.0;
3790 dialog->package->center_y = HIWORD(lParam) + dialog->size.cy / 2.0;
3791 break;
3792
3793 case WM_CREATE:
3795
3796 case WM_COMMAND:
3798
3799 case WM_CLOSE:
3800 /* Simulate escape press */
3801 return dialog_oncommand(dialog, 2, NULL);
3802
3803 case WM_ACTIVATE:
3804 if( LOWORD(wParam) == WA_INACTIVE )
3805 dialog->hWndFocus = GetFocus();
3806 else
3808 return 0;
3809
3810 case WM_SETFOCUS:
3812 return 0;
3813
3814 /* bounce back to our subclassed static control */
3815 case WM_CTLCOLORSTATIC:
3817
3818 case WM_DESTROY:
3819 dialog->hwnd = NULL;
3820 return 0;
3821 case WM_NOTIFY:
3822 return dialog_onnotify( dialog, lParam );
3823 }
3824 return DefWindowProcW(hwnd, msg, wParam, lParam);
3825}
static void dialog_setfocus(msi_dialog *dialog)
Definition: dialog.c:3769
static LRESULT dialog_oncommand(msi_dialog *dialog, WPARAM param, HWND hwnd)
Definition: dialog.c:3726
static LRESULT dialog_onnotify(msi_dialog *dialog, LPARAM param)
Definition: dialog.c:3756
static LRESULT dialog_oncreate(HWND hwnd, CREATESTRUCTW *cs)
Definition: dialog.c:3673
#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:1865
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1775
#define WM_CLOSE
Definition: winuser.h:1624
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1611
#define WM_COMMAND
Definition: winuser.h:1743
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WA_INACTIVE
Definition: winuser.h:2625
#define WM_ACTIVATE
Definition: winuser.h:1615
#define WM_MOVE
Definition: winuser.h:1613
#define WM_DESTROY
Definition: winuser.h:1612

Referenced by dialog_register_class().

◆ MsiEnableUIPreview()

UINT WINAPI MsiEnableUIPreview ( MSIHANDLE  hdb,
MSIHANDLE phPreview 
)

Definition at line 4144 of file dialog.c.

4145{
4146 MSIDATABASE *db;
4149
4150 TRACE( "%lu %p\n", hdb, phPreview );
4151
4152 if (!(db = msihandle2msiinfo(hdb, MSIHANDLETYPE_DATABASE)))
4153 return ERROR_INVALID_HANDLE;
4154
4156 if (preview)
4157 {
4158 *phPreview = alloc_msihandle( &preview->hdr );
4159 msiobj_release( &preview->hdr );
4160 r = ERROR_SUCCESS;
4161 if (!*phPreview)
4163 }
4164 msiobj_release( &db->hdr );
4165 return r;
4166}
#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:4125
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 3883 of file dialog.c.

3884{
3886
3887 TRACE("%d %p\n", msg, dialog);
3888
3889 switch (msg)
3890 {
3895 return 0;
3896 }
3897 return DefWindowProcW( hwnd, msg, wParam, lParam );
3898}

Referenced by dialog_register_class().

◆ MSIListBox_WndProc()

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

Definition at line 2630 of file dialog.c.

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

Referenced by dialog_list_box().

◆ MSIMaskedEdit_WndProc()

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

Definition at line 1760 of file dialog.c.

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

Referenced by dialog_maskedit_control().

◆ MSIPathEdit_WndProc()

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

Definition at line 2091 of file dialog.c.

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

Referenced by dialog_pathedit_control().

◆ MsiPreviewBillboardA()

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

Definition at line 4235 of file dialog.c.

4236{
4237 FIXME( "%lu %s %s\n", hPreview, debugstr_a(szControlName), debugstr_a(szBillboard) );
4239}
#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 4229 of file dialog.c.

4230{
4231 FIXME( "%lu %s %s\n", hPreview, debugstr_w(szControlName), debugstr_w(szBillboard) );
4233}

◆ MsiPreviewDialogA()

UINT WINAPI MsiPreviewDialogA ( MSIHANDLE  hPreview,
LPCSTR  szDialogName 
)

Definition at line 4211 of file dialog.c.

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

◆ MsiPreviewDialogW()

UINT WINAPI MsiPreviewDialogW ( MSIHANDLE  hPreview,
LPCWSTR  szDialogName 
)

Definition at line 4195 of file dialog.c.

4196{
4198 UINT r;
4199
4200 TRACE( "%lu %s\n", hPreview, debugstr_w(szDialogName) );
4201
4203 if (!preview)
4204 return ERROR_INVALID_HANDLE;
4205
4206 r = MSI_PreviewDialogW( preview, szDialogName );
4207 msiobj_release( &preview->hdr );
4208 return r;
4209}
static UINT MSI_PreviewDialogW(MSIPREVIEW *preview, LPCWSTR szDialogName)
Definition: dialog.c:4174

Referenced by MsiPreviewDialogA().

◆ MSIRadioGroup_WndProc()

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

Definition at line 2189 of file dialog.c.

2190{
2191 WNDPROC oldproc = (WNDPROC)GetPropW( hWnd, L"MSIDATA" );
2192 LRESULT r;
2193
2194 TRACE( "hWnd %p msg %04x wParam %#Ix lParam %#Ix\n", hWnd, msg, wParam, lParam );
2195
2196 if (msg == WM_COMMAND) /* Forward notifications to dialog */
2198
2199 r = CallWindowProcW( oldproc, hWnd, msg, wParam, lParam );
2200
2201 /* make sure the radio buttons show as disabled if the parent is disabled */
2202 if (msg == WM_ENABLE)
2204
2205 return r;
2206}
static BOOL CALLBACK radioground_child_enum(HWND hWnd, LPARAM lParam)
Definition: dialog.c:2183
#define WM_ENABLE
Definition: winuser.h:1618
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:1623
#define DLGC_WANTARROWS
Definition: winuser.h:2613
#define WM_GETDLGCODE
Definition: winuser.h:1692

Referenced by dialog_scrolltext_control().

◆ MSISelectionTree_WndProc()

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

Definition at line 2382 of file dialog.c.

2383{
2385 TVHITTESTINFO tvhti;
2386 HRESULT r;
2387
2388 TRACE("%p %04x %#Ix %#Ix\n", hWnd, msg, wParam, lParam);
2389
2390 info = GetPropW(hWnd, L"MSIDATA");
2391
2392 switch( msg )
2393 {
2394 case WM_LBUTTONDOWN:
2395 tvhti.pt.x = (short)LOWORD( lParam );
2396 tvhti.pt.y = (short)HIWORD( lParam );
2397 tvhti.flags = 0;
2398 tvhti.hItem = 0;
2399 CallWindowProcW(info->oldproc, hWnd, TVM_HITTEST, 0, (LPARAM) &tvhti );
2400 if (tvhti.flags & TVHT_ONITEMSTATEICON)
2401 return seltree_menu( hWnd, tvhti.hItem );
2402 break;
2403 }
2404 r = CallWindowProcW(info->oldproc, hWnd, msg, wParam, lParam);
2405
2406 switch( msg )
2407 {
2408 case WM_NCDESTROY:
2409 free( info );
2410 RemovePropW( hWnd, L"MSIDATA" );
2411 break;
2412 }
2413 return r;
2414}
static LRESULT seltree_menu(HWND hwnd, HTREEITEM hItem)
Definition: dialog.c:2331
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:1779

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:918
#define WM_SETTEXT
Definition: winuser.h:1620

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

4306{
4307 dialog->pending_event = event_end_dialog;
4308 free( dialog->pending_argument );
4309 dialog->pending_argument = wcsdup( argument );
4310 return ERROR_SUCCESS;
4311}
static UINT event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4285

◆ pending_event_new_dialog()

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

Definition at line 4323 of file dialog.c.

4324{
4325 dialog->pending_event = event_new_dialog;
4326 free( dialog->pending_argument );
4327 dialog->pending_argument = wcsdup( argument );
4328 return ERROR_SUCCESS;
4329}
static UINT event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4314

◆ pending_event_spawn_dialog()

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

Definition at line 4348 of file dialog.c.

4349{
4350 dialog->pending_event = event_spawn_dialog;
4351 free( dialog->pending_argument );
4352 dialog->pending_argument = wcsdup( argument );
4353 return ERROR_SUCCESS;
4354}
static UINT event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4332

◆ preview_event_handler()

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

Definition at line 4168 of file dialog.c.

4169{
4170 MESSAGE("Preview dialog event '%s' (arg='%s')\n", debugstr_w(event), debugstr_w(argument));
4171 return ERROR_SUCCESS;
4172}
#define MESSAGE
Definition: options.h:86

Referenced by MSI_PreviewDialogW().

◆ process_pending_messages()

static void process_pending_messages ( HWND  hdlg)
static

Definition at line 3827 of file dialog.c.

3828{
3829 MSG msg;
3830
3831 while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
3832 {
3833 if (hdlg && IsDialogMessageW( hdlg, &msg )) continue;
3836 }
3837}
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 2183 of file dialog.c.

2184{
2186 return TRUE;
2187}

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

2417{
2418 struct msi_selection_tree_info *info = GetPropW( hwnd, L"MSIDATA" );
2420 TVINSERTSTRUCTW tvis;
2421 HTREEITEM hitem, hfirst = NULL;
2422
2424 {
2425 if ( parent && feature->Feature_Parent && wcscmp( parent, feature->Feature_Parent ))
2426 continue;
2427 else if ( parent && !feature->Feature_Parent )
2428 continue;
2429 else if ( !parent && feature->Feature_Parent )
2430 continue;
2431
2432 if ( !feature->Title )
2433 continue;
2434
2435 if ( !feature->Display )
2436 continue;
2437
2438 memset( &tvis, 0, sizeof tvis );
2439 tvis.hParent = hParent;
2440 tvis.hInsertAfter = TVI_LAST;
2441 tvis.item.mask = TVIF_TEXT | TVIF_PARAM;
2442 tvis.item.pszText = feature->Title;
2443 tvis.item.lParam = (LPARAM) feature;
2444
2445 hitem = (HTREEITEM) SendMessageW( hwnd, TVM_INSERTITEMW, 0, (LPARAM) &tvis );
2446 if (!hitem)
2447 continue;
2448
2449 if (!hfirst)
2450 hfirst = hitem;
2451
2454 feature->Feature, hitem );
2455
2456 /* the node is expanded if Display is odd */
2457 if ( feature->Display % 2 != 0 )
2459 }
2460
2461 /* select the first item */
2463 info->selected = hfirst;
2464}
static void seltree_sync_item_state(HWND hwnd, MSIFEATURE *feature, HTREEITEM hItem)
Definition: dialog.c:2265
#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 2466 of file dialog.c.

2467{
2468 const int bm_width = 32, bm_height = 16, bm_count = 3;
2469 const int bm_resource = 0x1001;
2471 int i;
2472 HBITMAP hbmp;
2473
2474 himl = ImageList_Create( bm_width, bm_height, FALSE, 4, 0 );
2475 if (!himl)
2476 {
2477 ERR("failed to create image list\n");
2478 return;
2479 }
2480
2481 for (i=0; i<bm_count; i++)
2482 {
2483 hbmp = LoadBitmapW( msi_hInstance, MAKEINTRESOURCEW(i+bm_resource) );
2484 if (!hbmp)
2485 {
2486 ERR("failed to load bitmap %d\n", i);
2487 break;
2488 }
2489
2490 /*
2491 * Add a dummy bitmap at offset zero because the treeview
2492 * can't use it as a state mask (zero means no user state).
2493 */
2494 if (!i)
2496
2498 }
2499
2501}
HBITMAP hbmp
HIMAGELIST himl
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:448
#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:2215

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

2332{
2335 MSIPACKAGE *package;
2336 union {
2337 RECT rc;
2338 POINT pt[2];
2340 } u;
2341 UINT r;
2342
2343 info = GetPropW(hwnd, L"MSIDATA");
2344 package = info->dialog->package;
2345
2347 if (!feature)
2348 {
2349 ERR("item %p feature was NULL\n", hItem);
2350 return 0;
2351 }
2352
2353 /* get the item's rectangle to put the menu just below it */
2354 u.hItem = hItem;
2356 MapWindowPoints( hwnd, NULL, u.pt, 2 );
2357
2358 r = seltree_popup_menu( hwnd, u.rc.left, u.rc.top );
2359
2360 switch (r)
2361 {
2364 /* fall-through */
2367 {
2370 if (child)
2372 }
2373 /* fall-through */
2374 case INSTALLSTATE_LOCAL:
2376 break;
2377 }
2378
2379 return 0;
2380}
static void seltree_update_feature_installstate(HWND hwnd, HTREEITEM hItem, MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state)
Definition: dialog.c:2303
#define USER_INSTALLSTATE_ALL
Definition: dialog.c:129
static UINT seltree_popup_menu(HWND hwnd, INT x, INT y)
Definition: dialog.c:2284
static void seltree_update_siblings_and_children_installstate(HWND hwnd, HTREEITEM curr, MSIPACKAGE *package, INSTALLSTATE state)
Definition: dialog.c:2311
#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 2284 of file dialog.c.

2285{
2286 HMENU hMenu;
2287 INT r;
2288
2289 /* create a menu to display */
2290 hMenu = CreatePopupMenu();
2291
2292 /* FIXME: load strings from resources */
2293 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_LOCAL, "Install feature locally");
2294 AppendMenuA( hMenu, MF_ENABLED, USER_INSTALLSTATE_ALL, "Install entire feature");
2295 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ADVERTISED, "Install on demand");
2296 AppendMenuA( hMenu, MF_ENABLED, INSTALLSTATE_ABSENT, "Don't install");
2298 x, y, 0, hwnd, NULL );
2299 DestroyMenu( hMenu );
2300 return r;
2301}
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define TPM_TOPALIGN
Definition: winuser.h:2386
#define MF_ENABLED
Definition: winuser.h:128
#define TPM_LEFTALIGN
Definition: winuser.h:2380
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:2390

Referenced by seltree_menu().

◆ seltree_sync_item_state()

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

Definition at line 2265 of file dialog.c.

2266{
2267 TVITEMW tvi;
2268 DWORD index = feature->ActionRequest;
2269
2270 TRACE("Feature %s -> %d %d %d\n", debugstr_w(feature->Title),
2271 feature->Installed, feature->Action, feature->ActionRequest);
2272
2275
2276 tvi.mask = TVIF_STATE;
2277 tvi.hItem = hItem;
2280
2281 SendMessageW( hwnd, TVM_SETITEMW, 0, (LPARAM) &tvi );
2282}
@ 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 2303 of file dialog.c.

2305{
2306 feature->ActionRequest = state;
2309}
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 2311 of file dialog.c.

2313{
2314 /* update all siblings */
2315 do
2316 {
2319
2322
2323 /* update this sibling's children */
2325 if (child)
2327 }
2328 while ((curr = (HTREEITEM)SendMessageW( hwnd, TVM_GETNEXTITEM, (WPARAM)TVGN_NEXT, (LPARAM)curr )));
2329}
#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 3030 of file dialog.c.

3031{
3032 int i;
3033
3034 for (i = 0; i < lstrlenW( str ); i++)
3035 if (!iswdigit(str[i]))
3036 return FALSE;
3037
3038 return TRUE;
3039}
#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 3108 of file dialog.c.

3109{
3111 INT each_cost;
3112 LONGLONG total_cost = 0;
3113
3114 LIST_FOR_EACH_ENTRY( feature, &dialog->package->features, MSIFEATURE, entry )
3115 {
3118 {
3119 total_cost += each_cost;
3120 }
3123 {
3124 total_cost -= each_cost;
3125 }
3126 }
3127 return total_cost;
3128}
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 3041 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:4363
static UINT event_remove(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4385
static UINT event_add_source(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4401
static UINT pending_event_new_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4323
static UINT event_spawn_wait_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4357
static UINT pending_event_end_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4305
static UINT event_validate_product_id(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4534
static UINT event_add_local(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4369
static UINT event_set_install_level(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4506
static UINT event_set_target_path(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4430
static UINT event_reset(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4448
static UINT event_reinstall(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4529
static UINT pending_event_spawn_dialog(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4348
static UINT event_directory_list_up(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4514
static UINT event_reinstall_mode(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4524
static UINT event_directory_list_new(msi_dialog *dialog, const WCHAR *argument)
Definition: dialog.c:4519

Definition at line 4539 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:3434
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:2208
static UINT dialog_hyperlink(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3350
static UINT dialog_edit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1614
static UINT dialog_progress_bar(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1993
static UINT dialog_group_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2605
static UINT dialog_list_box(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2721
static UINT dialog_maskedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1924
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:1545
static UINT dialog_selection_tree(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2559
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:3210
static UINT dialog_directory_list(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3001
static UINT dialog_pathedit_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2116
static UINT dialog_directory_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:2783
static UINT dialog_volumeselect_combo(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:3281
static UINT dialog_bitmap_control(msi_dialog *dialog, MSIRECORD *rec)
Definition: dialog.c:1293

Definition at line 3474 of file dialog.c.

Referenced by dialog_create_controls().

◆ msi_hInstance

◆ uiThreadId