Procházet zdrojové kódy

Cleanup SW_SHOW vs SW_SHOWNORMAL.

Martijn Laan před 1 rokem
rodič
revize
2a4cce0e75

+ 1 - 1
Examples/PowerShell.iss

@@ -59,7 +59,7 @@ end;
 function ExecAndGetFirstLine(const Filename, Params, WorkingDir: String; var ResultCode: Integer): String;
 begin
   Line := '';
-  ExecAndLogOutput(Filename, Params, WorkingDir, SW_SHOW, ewWaitUntilTerminated, ResultCode, @ExecAndGetFirstLineLog);
+  ExecAndLogOutput(Filename, Params, WorkingDir, SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, @ExecAndGetFirstLineLog);
   Result := Line;
 end;
 

+ 5 - 5
ISHelp/isxfunc.xml

@@ -1610,7 +1610,7 @@ begin
     // directory is launched.
     OldState := EnableFsRedirection(False);
     try
-      Exec(ExpandConstant('{cmd}'), '', '', SW_SHOW,
+      Exec(ExpandConstant('{cmd}'), '', '', SW_SHOWNORMAL,
         ewWaitUntilTerminated, ResultCode);
     finally
       // Restore the previous redirection state.
@@ -1642,7 +1642,7 @@ end;</pre></example>
   ResultCode: Integer;
 begin
   // Launch Notepad and wait for it to terminate
-  if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOW,
+  if Exec(ExpandConstant('{win}\notepad.exe'), '', '', SW_SHOWNORMAL,
      ewWaitUntilTerminated, ResultCode) then
   begin
     // handle success if necessary; ResultCode contains the exit code
@@ -1673,7 +1673,7 @@ end;</pre></example>
   ErrorCode: Integer;
 begin
   if not ShellExec('', ExpandConstant('{app}\filename.rtf'),
-     '', '', SW_SHOW, ewNoWait, ErrorCode) then
+     '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode) then
   begin
     // handle failure if necessary
   end;
@@ -2872,7 +2872,7 @@ end;</pre></example>
         <name>ExecAndLogOutput</name>
         <prototype>function ExecAndLogOutput(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer; const OnLog: TOnLog): Boolean;</prototype>
         <description><p>Identical to <link topic="isxfunc_Exec">Exec</link> except:</p>
-<p>Console programs are always hidden and the ShowCmd parameter only affects GUI programs, so always using <tt>SW_SHOW</tt> instead of <tt>SW_HIDE</tt> is recommended.</p>
+<p>Console programs are always hidden and the ShowCmd parameter only affects GUI programs, so always using <tt>SW_SHOWNORMAL</tt> instead of <tt>SW_HIDE</tt> is recommended.</p>
 <p>If OnLog is set to <tt>nil</tt> then the output of the executed executable or batch file is logged in Setup's or Uninstall's log file and/or in the Compiler IDE's "Debug Output" view.</p>
 <p>If OnLog is not set to <tt>nil</tt> then the output is sent to the specified function, line by line.</p></description>
         <remarks><p>Parameter <tt>Wait</tt> must always be set to <tt>ewWaitUntilTerminated</tt> when calling this function.</p>
@@ -2893,7 +2893,7 @@ end;
 function ExecAndGetFirstLine(const Filename, Params, WorkingDir: String; var ResultCode: Integer): String;
 begin
   Line := '';
-  ExecAndLogOutput(Filename, Params, WorkingDir, SW_SHOW, ewWaitUntilTerminated, ResultCode, @ExecAndGetFirstLineLog);
+  ExecAndLogOutput(Filename, Params, WorkingDir, SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, @ExecAndGetFirstLineLog);
   Result := Line;
 end;</pre></example>
         <seealso><p><link topic="isxfunc_Exec">Exec</link></p></seealso>

+ 1 - 1
Projects/ISPP/IsppFuncs.pas

@@ -801,7 +801,7 @@ begin
       Data.Line := '';
       var ResultCode: Integer;
       var Success := Exec(Get(0).AsStr, ParamsS, WorkingDir, True,
-        SW_SHOW, Data.Preprocessor, True, ExecAndGetFirstLineLog, NativeInt(@Data), ResultCode);
+        SW_SHOWNORMAL, Data.Preprocessor, True, ExecAndGetFirstLineLog, NativeInt(@Data), ResultCode);
       if Success then
         MakeStr(ResPtr^, Data.Line)
       else begin

+ 5 - 5
Projects/Src/CompForm.pas

@@ -2718,7 +2718,7 @@ var
 begin
   Dir := GetWinDir;
   ShellExecute(Application.Handle, 'open', PChar(AddBackslash(Dir) + 'explorer.exe'),
-    PChar(Format('/select,"%s"', [FCompiledExe])), PChar(Dir), SW_SHOW);
+    PChar(Format('/select,"%s"', [FCompiledExe])), PChar(Dir), SW_SHOWNORMAL);
 end;
 
 procedure TCompileForm.HMenuClick(Sender: TObject);
@@ -2794,25 +2794,25 @@ end;
 procedure TCompileForm.HExamplesClick(Sender: TObject);
 begin
   ShellExecute(Application.Handle, 'open',
-    PChar(PathExtractPath(NewParamStr(0)) + 'Examples'), nil, nil, SW_SHOW);
+    PChar(PathExtractPath(NewParamStr(0)) + 'Examples'), nil, nil, SW_SHOWNORMAL);
 end;
 
 procedure TCompileForm.HFaqClick(Sender: TObject);
 begin
   ShellExecute(Application.Handle, 'open',
-    PChar(PathExtractPath(NewParamStr(0)) + 'isfaq.url'), nil, nil, SW_SHOW);
+    PChar(PathExtractPath(NewParamStr(0)) + 'isfaq.url'), nil, nil, SW_SHOWNORMAL);
 end;
 
 procedure TCompileForm.HWhatsNewClick(Sender: TObject);
 begin
   ShellExecute(Application.Handle, 'open',
-    PChar(PathExtractPath(NewParamStr(0)) + 'whatsnew.htm'), nil, nil, SW_SHOW);
+    PChar(PathExtractPath(NewParamStr(0)) + 'whatsnew.htm'), nil, nil, SW_SHOWNORMAL);
 end;
 
 procedure TCompileForm.HWebsiteClick(Sender: TObject);
 begin
   ShellExecute(Application.Handle, 'open', 'https://jrsoftware.org/isinfo.php', nil,
-    nil, SW_SHOW);
+    nil, SW_SHOWNORMAL);
 end;
 
 procedure TCompileForm.HMailingListClick(Sender: TObject);

+ 2 - 2
Projects/Src/CompFunc.pas

@@ -275,13 +275,13 @@ end;
 procedure OpenDonateSite;
 begin
   ShellExecute(Application.Handle, 'open', 'https://jrsoftware.org/isdonate.php', nil,
-    nil, SW_SHOW);
+    nil, SW_SHOWNORMAL);
 end;
 
 procedure OpenMailingListSite;
 begin
   ShellExecute(Application.Handle, 'open', 'https://jrsoftware.org/ismail.php', nil,
-    nil, SW_SHOW);
+    nil, SW_SHOWNORMAL);
 end;
 
 procedure ReadMRUList(const MRUList: TStringList; const Section, Ident: String);

+ 1 - 1
Projects/Src/Compile.pas

@@ -7385,7 +7385,7 @@ procedure TSetupCompiler.SignCommand(const AName, ACommand, AParams, AExeFilenam
     FillChar(StartupInfo, SizeOf(StartupInfo), 0);
     StartupInfo.cb := SizeOf(StartupInfo);
     StartupInfo.dwFlags := STARTF_USESHOWWINDOW;
-    StartupInfo.wShowWindow := IfThen(RunMinimized, SW_SHOWMINNOACTIVE, SW_SHOW);
+    StartupInfo.wShowWindow := IfThen(RunMinimized, SW_SHOWMINNOACTIVE, SW_SHOWNORMAL);
 
     var OutputReader := TCreateProcessOutputReader.Create(SignCommandLog, NativeInt(Self));
     try