ShowWindow added
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1719 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f36028367a
commit
0276abd2b1
6 changed files with 82 additions and 51 deletions
|
@ -167,4 +167,20 @@
|
|||
!define WM_IME_KEYDOWN 0x290
|
||||
!define WM_IME_KEYUP 0x291
|
||||
|
||||
!define SW_HIDE 0
|
||||
!define SW_SHOWNORMAL 1
|
||||
!define SW_NORMAL 1
|
||||
!define SW_SHOWMINIMIZED 2
|
||||
!define SW_SHOWMAXIMIZED 3
|
||||
!define SW_MAXIMIZE 3
|
||||
!define SW_SHOWNOACTIVATE 4
|
||||
!define SW_SHOW 5
|
||||
!define SW_MINIMIZE 6
|
||||
!define SW_SHOWMINNOACTIVE 7
|
||||
!define SW_SHOWNA 8
|
||||
!define SW_RESTORE 9
|
||||
!define SW_SHOWDEFAULT 10
|
||||
!define SW_FORCEMINIMIZE 11
|
||||
!define SW_MAX 11
|
||||
|
||||
!endif
|
|
@ -800,6 +800,9 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
|||
myitoa(var0,(int)CreateFontIndirect(&f));
|
||||
}
|
||||
return 0;
|
||||
case EW_SHOWWINDOW:
|
||||
ShowWindow((HWND)process_string_fromparm_toint(0),process_string_fromparm_toint(1));
|
||||
return 0;
|
||||
#endif//NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
#endif//NSIS_SUPPORT_HWNDS
|
||||
#ifdef NSIS_SUPPORT_SHELLEXECUTE
|
||||
|
|
|
@ -97,6 +97,7 @@ enum
|
|||
EW_SETWINDOWLONG, // SetWindowLong (used by StaticBkColor): 3 [hwnd, which(numeric), value]
|
||||
EW_SETBRANDINGIMAGE, // SetBrandingImage: 1: [Bitmap file]
|
||||
EW_CREATEFONT, // CreateFont: 5: [handle output, face name, height, weight, flags]
|
||||
EW_SHOWWINDOW, // ShowWindow: 2: [hwnd, show state]
|
||||
#endif
|
||||
|
||||
#ifdef NSIS_SUPPORT_SHELLEXECUTE
|
||||
|
|
|
@ -2520,9 +2520,67 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
|||
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_CREATEFONT:
|
||||
ent.which=EW_CREATEFONT;
|
||||
ent.offsets[0]=line.gettoken_enum(1,usrvars);
|
||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||
SCRIPT_MSG("CreateFont: output=%s \"%s\"",line.gettoken_str(1),line.gettoken_str(2));
|
||||
{
|
||||
int height=0;
|
||||
int weight=0;
|
||||
int flags=0;
|
||||
for (int i = 3; i < line.getnumtokens(); i++) {
|
||||
char *tok=line.gettoken_str(i);
|
||||
if (tok[0]=='/') {
|
||||
if (!lstrcmpi(tok,"/ITALIC")) {
|
||||
SCRIPT_MSG(" /ITALIC");
|
||||
flags|=1;
|
||||
}
|
||||
else if (!lstrcmpi(tok,"/UNDERLINE")) {
|
||||
SCRIPT_MSG(" /UNDERLINE");
|
||||
flags|=2;
|
||||
}
|
||||
else if (!lstrcmpi(tok,"/STRIKE")) {
|
||||
SCRIPT_MSG(" /STRIKE");
|
||||
flags|=4;
|
||||
}
|
||||
else {
|
||||
SCRIPT_MSG("\n");
|
||||
PRINTHELP();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!height) {
|
||||
SCRIPT_MSG(" height=%s",tok);
|
||||
height=add_string(tok);
|
||||
}
|
||||
else if (!weight) {
|
||||
SCRIPT_MSG(" weight=%s",tok);
|
||||
weight=add_string(tok);
|
||||
}
|
||||
else {
|
||||
SCRIPT_MSG("\n");
|
||||
PRINTHELP();
|
||||
}
|
||||
}
|
||||
}
|
||||
ent.offsets[2]=height;
|
||||
ent.offsets[3]=weight;
|
||||
ent.offsets[4]=flags;
|
||||
}
|
||||
SCRIPT_MSG("\n");
|
||||
return add_entry(&ent);
|
||||
case TOK_SHOWWINDOW:
|
||||
ent.which=EW_SHOWWINDOW;
|
||||
ent.offsets[0]=add_string(line.gettoken_str(1));
|
||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||
SCRIPT_MSG("ShowWindow: handle=%s show state=%s\n",line.gettoken_str(1),line.gettoken_str(2));
|
||||
return add_entry(&ent);
|
||||
#else//NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
case TOK_GETDLGITEM:
|
||||
case TOK_SETSTATICBKCOLOR:
|
||||
case TOK_SHOWWINDOW:
|
||||
case TOK_CREATEFONT:
|
||||
ERROR_MSG("Error: %s specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n", line.gettoken_str(0));
|
||||
return PS_ERROR;
|
||||
#endif//NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
|
@ -2532,6 +2590,8 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
|||
case TOK_FINDWINDOW:
|
||||
case TOK_GETDLGITEM:
|
||||
case TOK_SETSTATICBKCOLOR:
|
||||
case TOK_SHOWWINDOW:
|
||||
case TOK_CREATEFONT:
|
||||
ERROR_MSG("Error: %s specified, NSIS_SUPPORT_HWNDS not defined.\n", line.gettoken_str(0));
|
||||
return PS_ERROR;
|
||||
#endif//!NSIS_SUPPORT_HWNDS
|
||||
|
@ -3646,58 +3706,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line, FILE *fp, const char
|
|||
SCRIPT_MSG("\n");
|
||||
}
|
||||
return add_entry(&ent);
|
||||
case TOK_CREATEFONT:
|
||||
ent.which=EW_CREATEFONT;
|
||||
ent.offsets[0]=line.gettoken_enum(1,usrvars);
|
||||
ent.offsets[1]=add_string(line.gettoken_str(2));
|
||||
SCRIPT_MSG("CreateFont: output=%s \"%s\"",line.gettoken_str(1),line.gettoken_str(2));
|
||||
{
|
||||
int height=0;
|
||||
int weight=0;
|
||||
int flags=0;
|
||||
for (int i = 3; i < line.getnumtokens(); i++) {
|
||||
char *tok=line.gettoken_str(i);
|
||||
if (tok[0]=='/') {
|
||||
if (!lstrcmpi(tok,"/ITALIC")) {
|
||||
SCRIPT_MSG(" /ITALIC");
|
||||
flags|=1;
|
||||
}
|
||||
else if (!lstrcmpi(tok,"/UNDERLINE")) {
|
||||
SCRIPT_MSG(" /UNDERLINE");
|
||||
flags|=2;
|
||||
}
|
||||
else if (!lstrcmpi(tok,"/STRIKE")) {
|
||||
SCRIPT_MSG(" /STRIKE");
|
||||
flags|=4;
|
||||
}
|
||||
else {
|
||||
SCRIPT_MSG("\n");
|
||||
PRINTHELP();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!height) {
|
||||
SCRIPT_MSG(" height=%s",tok);
|
||||
height=add_string(tok);
|
||||
}
|
||||
else if (!weight) {
|
||||
SCRIPT_MSG(" weight=%s",tok);
|
||||
weight=add_string(tok);
|
||||
}
|
||||
else {
|
||||
SCRIPT_MSG("\n");
|
||||
PRINTHELP();
|
||||
}
|
||||
}
|
||||
}
|
||||
ent.offsets[2]=height;
|
||||
ent.offsets[3]=weight;
|
||||
ent.offsets[4]=flags;
|
||||
}
|
||||
SCRIPT_MSG("\n");
|
||||
return add_entry(&ent);
|
||||
#else//NSIS_CONFIG_ENHANCEDUI_SUPPORT
|
||||
case TOK_CREATEFONT:
|
||||
case TOK_SETBRANDINGIMAGE:
|
||||
ERROR_MSG("Error: %s specified, NSIS_CONFIG_ENHANCEDUI_SUPPORT not defined.\n",line.gettoken_str(0));
|
||||
return PS_ERROR;
|
||||
|
|
|
@ -147,6 +147,7 @@ static tokenType tokenlist[TOK__LAST] =
|
|||
{TOK_SETSTATICBKCOLOR,"SetStaticBkColor",2,0,"hwnd color"},
|
||||
{TOK_SHOWDETAILS,"ShowInstDetails",1,0,"(hide|show|nevershow)"},
|
||||
{TOK_SHOWDETAILSUNINST,"ShowUninstDetails",1,0,"(hide|show|nevershow)"},
|
||||
{TOK_SHOWWINDOW,"ShowWindow",2,0,"hwnd show_state"},
|
||||
{TOK_SILENTINST,"SilentInstall",1,0,"(normal|silent|silentlog)"},
|
||||
{TOK_SILENTUNINST,"SilentUnInstall",1,0,"(normal|silent)"},
|
||||
{TOK_SLEEP,"Sleep",1,0,"sleep_time_in_ms"},
|
||||
|
|
|
@ -198,6 +198,7 @@ enum
|
|||
TOK_PLUGINDIR,
|
||||
TOK_INITPLUGINDIR,
|
||||
TOK_CREATEFONT,
|
||||
TOK_SHOWWINDOW,
|
||||
|
||||
TOK__LAST,
|
||||
TOK__PLUGINCOMMAND
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue