James Hawkins : msi: Set the text limit of the edit control if the limit is given.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 7 09:10:28 CDT 2007


Module: wine
Branch: master
Commit: 933fd8b8797b340558e06b5d19e51d94b068c5ab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=933fd8b8797b340558e06b5d19e51d94b068c5ab

Author: James Hawkins <truiken at gmail.com>
Date:   Sun May  6 20:30:28 2007 -0500

msi: Set the text limit of the edit control if the limit is given.

---

 dlls/msi/dialog.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 72da99f..3a256d8 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -1142,15 +1142,34 @@ static UINT msi_dialog_combo_control( msi_dialog *dialog, MSIRECORD *rec )
 static UINT msi_dialog_edit_control( msi_dialog *dialog, MSIRECORD *rec )
 {
     msi_control *control;
-    LPCWSTR prop;
-    LPWSTR val;
+    LPCWSTR prop, text;
+    LPWSTR val, begin, end;
+    WCHAR num[10];
+    DWORD limit;
 
     control = msi_dialog_add_control( dialog, rec, szEdit,
                                       WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL );
     control->handler = msi_dialog_edit_handler;
+
+    text = MSI_RecordGetString( rec, 10 );
+    if ( text )
+    {
+        begin = strchrW( text, '{' );
+        end = strchrW( text, '}' );
+
+        if ( begin && end && end > begin )
+        {
+            lstrcpynW( num, begin + 1, end - begin );
+            limit = atolW( num );
+
+            SendMessageW( control->hwnd, EM_SETLIMITTEXT, limit, 0 );
+        }
+    }
+
     prop = MSI_RecordGetString( rec, 9 );
     if( prop )
         control->property = strdupW( prop );
+
     val = msi_dup_property( dialog->package, control->property );
     SetWindowTextW( control->hwnd, val );
     msi_free( val );




More information about the wine-cvs mailing list