diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh index a2f17a0b..2f52fb5e 100644 --- a/Contrib/Modern UI/System.nsh +++ b/Contrib/Modern UI/System.nsh @@ -335,6 +335,14 @@ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1039 SetStaticBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}" + GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1028 + SetStaticBkColor ${MUI_TEMP1} -1 + GetWindowText ${MUI_TEMP2} ${MUI_TEMP1} + #ShowWindow ${MUI_TEMP1} ${SW_HIDE} + GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1256 + SetStaticBkColor ${MUI_TEMP1} -1 + SendMessage ${MUI_TEMP1} ${WM_SETTEXT} ${NSIS_MAX_STRLEN} "STR:${MUI_TEMP2}" + Pop ${MUI_TEMP2} Pop ${MUI_TEMP1} diff --git a/Contrib/UIs/modern.exe b/Contrib/UIs/modern.exe index 77171652..d14387e1 100644 Binary files a/Contrib/UIs/modern.exe and b/Contrib/UIs/modern.exe differ diff --git a/Contrib/UIs/modern2.exe b/Contrib/UIs/modern2.exe index 7c5c650e..be3d52cc 100644 Binary files a/Contrib/UIs/modern2.exe and b/Contrib/UIs/modern2.exe differ diff --git a/Contrib/UIs/modern3.exe b/Contrib/UIs/modern3.exe index f5df94ce..eef814cc 100644 Binary files a/Contrib/UIs/modern3.exe and b/Contrib/UIs/modern3.exe differ diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 798b2ad7..3f296855 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -127,6 +127,11 @@ static BOOL NSISCALL SetDlgItemTextFromLang_(HWND dlg, int id, int lid) { #define HandleStaticBkColor() _HandleStaticBkColor(uMsg, wParam, lParam) static BOOL NSISCALL _HandleStaticBkColor(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (uMsg == WM_CTLCOLORSTATIC) { + BOOL brush = (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA); + if (brush == -1) { + SetBkColor((HDC)wParam, GetSysColor(COLOR_BTNFACE)); + return (BOOL)GetStockObject(NULL_BRUSH); + } SetBkMode((HDC)wParam, TRANSPARENT); return (BOOL)GetWindowLong((HWND)lParam, GWL_USERDATA); } diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 9aa97897..18012297 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -762,12 +762,19 @@ static int NSISCALL ExecuteEntry(entry *entry_) ) ); return 0; + case EW_GETWINTEXT: + my_GetWindowText( + (HWND)process_string_fromparm_toint(1), + var0, + NSIS_MAX_STRLEN + ); + return 0; case EW_SETSTATICBKCOLOR: DeleteObject( (HGDIOBJ)SetWindowLong( (HWND)process_string_fromparm_toint(0), GWL_USERDATA, - (LONG)CreateSolidBrush(parm1) + parm1==-1?parm1:(LONG)CreateSolidBrush(parm1) ) ); return 0; diff --git a/Source/exehead/fileform.h b/Source/exehead/fileform.h index 29aaee38..40f9abe9 100644 --- a/Source/exehead/fileform.h +++ b/Source/exehead/fileform.h @@ -93,8 +93,9 @@ enum #endif #ifdef NSIS_CONFIG_ENHANCEDUI_SUPPORT - EW_GETDLGITEM, // GetDlgItem: 3 [outputvar, dialog, item_id] - EW_SETSTATICBKCOLOR, // SerStaticBkColor: 3 [hwnd, color] + EW_GETDLGITEM, // GetDlgItem: 3: [outputvar, dialog, item_id] + EW_GETWINTEXT, // GetWindowText: 2: [outputvar, hwnd] + EW_SETSTATICBKCOLOR, // SerStaticBkColor: 3: [hwnd, color] EW_SETBRANDINGIMAGE, // SetBrandingImage: 1: [Bitmap file] EW_CREATEFONT, // CreateFont: 5: [handle output, face name, height, weight, flags] EW_SHOWWINDOW, // ShowWindow: 2: [hwnd, show state] diff --git a/Source/script.cpp b/Source/script.cpp index 32fd0c3d..826e52a1 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2651,6 +2651,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char ent.offsets[2]=add_string(line.gettoken_str(3)); SCRIPT_MSG("GetDlgItem: output=%s dialog=%s item=%s\n",line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3)); return add_entry(&ent); + case TOK_GETWINTEXT: + ent.which=EW_GETWINTEXT; + ent.offsets[0]=line.gettoken_enum(1,usrvars); + if (ent.offsets[0]<0) PRINTHELP(); + ent.offsets[1]=add_string(line.gettoken_str(2)); + SCRIPT_MSG("GetWindowText: output=%s hwnd=%s\n",line.gettoken_str(1),line.gettoken_str(2)); + return add_entry(&ent); case TOK_SETSTATICBKCOLOR: ent.which=EW_SETSTATICBKCOLOR; ent.offsets[0]=add_string(line.gettoken_str(1)); diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 630210ee..e0b48b47 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -76,6 +76,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_GETDLGITEM,"GetDlgItem",3,0,"$(user_var: handle output) dialog item_id"}, {TOK_GETFULLPATHNAME,"GetFullPathName",2,1,"[/SHORT] $(user_var: result) path_or_file"}, {TOK_GETTEMPFILENAME,"GetTempFileName",1,0,"$(user_var: name output)"}, +{TOK_GETWINTEXT,"GetWindowText",2,0,"$(user_var: handle output) hwnd"}, {TOK_HIDEWINDOW,"HideWindow",0,0,""}, {TOK_ICON,"Icon",1,0,"local_icon.ico"}, {TOK_IFERRORS,"IfErrors",1,1,"label_to_goto_if_errors [label_to_goto_if_no_errors]"}, diff --git a/Source/tokens.h b/Source/tokens.h index e6f53582..f99620bd 100644 --- a/Source/tokens.h +++ b/Source/tokens.h @@ -172,6 +172,7 @@ enum TOK_SENDMESSAGE, TOK_ISWINDOW, TOK_GETDLGITEM, + TOK_GETWINTEXT, TOK_SETSTATICBKCOLOR, TOK_SETWINDOWLONG, TOK_FINDFIRST,