From 2adb778918e2b058d4322eca19eba1570efccfb0 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 16 Jul 2003 22:36:18 +0000 Subject: [PATCH] Added EnableWindow git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2727 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/exec.c | 5 ++++- Source/script.cpp | 9 +++++++++ Source/tokens.cpp | 1 + Source/tokens.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 604cfcec..122541c5 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -796,7 +796,10 @@ static int NSISCALL ExecuteEntry(entry *entry_) break; case EW_SHOWWINDOW: if (parm2) log_printf("HideWindow"); - ShowWindow((HWND)process_string_fromparm_toint(0),process_string_fromparm_toint(1)); + if (!parm3) + ShowWindow((HWND)process_string_fromparm_toint(0),process_string_fromparm_toint(1)); + else + EnableWindow((HWND)process_string_fromparm_toint(0),process_string_fromparm_toint(1)); break; #endif//NSIS_CONFIG_ENHANCEDUI_SUPPORT #endif//NSIS_SUPPORT_HWNDS diff --git a/Source/script.cpp b/Source/script.cpp index 02a302bf..0b5549a3 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3287,6 +3287,13 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) } SCRIPT_MSG("\n"); return add_entry(&ent); + case TOK_ENABLEWINDOW: + ent.which=EW_SHOWWINDOW; + ent.offsets[0]=add_string(line.gettoken_str(1)); + ent.offsets[1]=add_string(line.gettoken_str(2)); + ent.offsets[3]=1; + SCRIPT_MSG("EnableWindow: handle=%s enable=%s\n",line.gettoken_str(1),line.gettoken_str(2)); + return add_entry(&ent); case TOK_SHOWWINDOW: ent.which=EW_SHOWWINDOW; ent.offsets[0]=add_string(line.gettoken_str(1)); @@ -3321,6 +3328,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) case TOK_BRINGTOFRONT: case TOK_CREATEFONT: case TOK_HIDEWINDOW: + case TOK_ENABLEWINDOW: ERROR_MSG("Error: %s specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n", line.gettoken_str(0)); return PS_ERROR; #endif//NSIS_CONFIG_ENHANCEDUI_SUPPORT @@ -3331,6 +3339,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) case TOK_GETDLGITEM: case TOK_SETBKCOLOR: case TOK_SHOWWINDOW: + case TOK_ENABLEWINDOW: case TOK_CREATEFONT: case TOK_HIDEWINDOW: case TOK_BRINGTOFRONT: diff --git a/Source/tokens.cpp b/Source/tokens.cpp index fcc86851..17ccde3e 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -50,6 +50,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_DIRSHOW,"DirShow",1,0,"(show|hide)"}, {TOK_ROOTDIRINST,"AllowRootDirInstall",1,0,"(true|false)"}, {TOK_CHECKBITMAP,"CheckBitmap",1,0,"local_bitmap.bmp"}, +{TOK_ENABLEWINDOW,"EnableWindow",2,0,"hwnd (1|0)"}, {TOK_ENUMREGKEY,"EnumRegKey",4,0,"$(user_var: output) rootkey subkey index\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD)"}, {TOK_ENUMREGVAL,"EnumRegValue",4,0,"$(user_var: output) rootkey subkey index\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD)"}, {TOK_EXCH,"Exch",0,1,"[$(user_var)] | [stack_item_index]"}, diff --git a/Source/tokens.h b/Source/tokens.h index 4aedad13..cccdb326 100644 --- a/Source/tokens.h +++ b/Source/tokens.h @@ -212,6 +212,7 @@ enum TOK_INITPLUGINSDIR, TOK_CREATEFONT, TOK_SHOWWINDOW, + TOK_ENABLEWINDOW, // Added by ramon 23 May 2003 TOK_ALLOWSKIPFILES, // Added by ramon 3 jun 2003