msi 4: Add initial implementation of the DirectoryCombo control
James Hawkins
truiken at gmail.com
Thu Aug 24 21:28:28 CDT 2006
Hi,
The following two patches are more fixes for bug 4403.
http://bugs.winehq.org/show_bug.cgi?id=4403
Changelog:
* Add initial implementation of the DirectoryCombo control.
dlls/msi/dialog.c | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
--
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 5a1f550..995b5ba 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -36,6 +36,8 @@ #include "ocidl.h"
#include "olectl.h"
#include "richedit.h"
#include "commctrl.h"
+#include "winreg.h"
+#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
@@ -1948,14 +1950,39 @@ static UINT msi_dialog_list_box( msi_dia
static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
{
msi_control *control;
+ LPWSTR val, indirect = NULL;
+ WCHAR path[MAX_PATH];
+ LPCWSTR prop;
DWORD style;
- style = CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS |
- WS_CHILD | WS_GROUP | WS_TABSTOP | WS_VSCROLL;
+ /* FIXME: use CBS_OWNERDRAWFIXED and add owner draw code */
+ style = CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD |
+ WS_GROUP | WS_TABSTOP | WS_VSCROLL;
control = msi_dialog_add_control( dialog, rec, WC_COMBOBOXW, style );
+ control->attributes = MSI_RecordGetInteger( rec, 8 );
if (!control)
return ERROR_FUNCTION_FAILED;
+ prop = MSI_RecordGetString( rec, 9 );
+ if ( prop )
+ control->property = strdupW( prop );
+
+ if ( control->attributes & msidbControlAttributesIndirect )
+ {
+ indirect = msi_dup_property( dialog->package, control->property );
+ prop = indirect;
+ }
+
+ val = msi_dup_property( dialog->package, prop );
+ lstrcpynW( path, val, MAX_PATH );
+
+ PathStripPathW( path );
+ PathRemoveBackslashW( path );
+
+ /* FIXME: Add whole directory structure to combo box */
+ SendMessageW( control->hwnd, CB_ADDSTRING, 0, (LPARAM)path );
+ SendMessageW( control->hwnd, CB_SETCURSEL, 0, 0 );
+
return ERROR_SUCCESS;
}
--
1.4.2
More information about the wine-patches
mailing list