diff --git a/Examples/WinMessages.NSH b/Examples/WinMessages.NSH index f51a4824..39dc47cc 100644 --- a/Examples/WinMessages.NSH +++ b/Examples/WinMessages.NSH @@ -181,6 +181,6 @@ !define SW_RESTORE 9 !define SW_SHOWDEFAULT 10 !define SW_FORCEMINIMIZE 11 -!define SW_MAX 11 +!define SW_MAX 11 !endif \ No newline at end of file diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 54a20ba5..ec7448f2 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -763,7 +763,11 @@ static int NSISCALL ExecuteEntry(entry *entry_) ); return 0; case EW_SETWINDOWLONG: - SetWindowLong((HWND)process_string_fromparm_toint(0),parm1,process_string_fromparm_toint(2)); + SetWindowLong( + (HWND)process_string_fromparm_toint(0), + process_string_fromparm_toint(1), + process_string_fromparm_toint(2) + ); return 0; case EW_SETBRANDINGIMAGE: { diff --git a/Source/script.cpp b/Source/script.cpp index d5d4ef9d..e610b27f 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2516,10 +2516,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char case TOK_SETSTATICBKCOLOR: ent.which=EW_SETWINDOWLONG; ent.offsets[0]=add_string(line.gettoken_str(1)); - ent.offsets[1]=GWL_USERDATA; + ent.offsets[1]=add_string("-21"/*GWL_USERDATA*/); ent.offsets[2]=add_string(line.gettoken_str(2)); SCRIPT_MSG("SetStaticBkColor: handle=%s color=%s\n",line.gettoken_str(1),line.gettoken_str(2)); return add_entry(&ent); + case TOK_SETWINDOWLONG: + ent.which=EW_SETWINDOWLONG; + ent.offsets[0]=add_string(line.gettoken_str(1)); + ent.offsets[1]=add_string(line.gettoken_str(2)); + ent.offsets[2]=add_string(line.gettoken_str(3)); + SCRIPT_MSG("SetWindowLong: handle=%s index=%s new long=%s\n",line.gettoken_str(1),line.gettoken_str(2),line.gettoken_str(3)); + return add_entry(&ent); case TOK_CREATEFONT: ent.which=EW_CREATEFONT; ent.offsets[0]=line.gettoken_enum(1,usrvars); @@ -2579,6 +2586,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char #else//NSIS_CONFIG_ENHANCEDUI_SUPPORT case TOK_GETDLGITEM: case TOK_SETSTATICBKCOLOR: + case TOK_SETWINDOWLONG: case TOK_SHOWWINDOW: case TOK_CREATEFONT: ERROR_MSG("Error: %s specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n", line.gettoken_str(0)); @@ -2590,6 +2598,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char case TOK_FINDWINDOW: case TOK_GETDLGITEM: case TOK_SETSTATICBKCOLOR: + case TOK_SETWINDOWLONG: case TOK_SHOWWINDOW: case TOK_CREATEFONT: ERROR_MSG("Error: %s specified, NSIS_SUPPORT_HWNDS not defined.\n", line.gettoken_str(0)); diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 62dc2bb3..4c33955f 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -145,6 +145,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_SETREBOOTFLAG,"SetRebootFlag",1,0,"true|false"}, {TOK_SETSHELLVARCONTEXT,"SetShellVarContext",1,0,"all|current"}, {TOK_SETSTATICBKCOLOR,"SetStaticBkColor",2,0,"hwnd color"}, +{TOK_SETWINDOWLONG,"SetWindowLong",3,0,"hwnd index new_long"}, {TOK_SHOWDETAILS,"ShowInstDetails",1,0,"(hide|show|nevershow)"}, {TOK_SHOWDETAILSUNINST,"ShowUninstDetails",1,0,"(hide|show|nevershow)"}, {TOK_SHOWWINDOW,"ShowWindow",2,0,"hwnd show_state"}, diff --git a/Source/tokens.h b/Source/tokens.h index dbb3c6ac..12aa49e3 100644 --- a/Source/tokens.h +++ b/Source/tokens.h @@ -172,6 +172,7 @@ enum TOK_ISWINDOW, TOK_GETDLGITEM, TOK_SETSTATICBKCOLOR, + TOK_SETWINDOWLONG, TOK_FINDFIRST, TOK_FINDNEXT, TOK_FINDCLOSE,