From eec7c3a672dc22e897b368f82f9fdf7a28076648 Mon Sep 17 00:00:00 2001 From: Wilenty <61757638+Wilenty@users.noreply.github.com> Date: Sat, 10 Feb 2024 23:10:54 +0100 Subject: [PATCH] Delete PreviewOnTaskBarAW.isi --- PreviewOnTaskBarAW.isi | 79 ------------------------------------------ 1 file changed, 79 deletions(-) delete mode 100644 PreviewOnTaskBarAW.isi diff --git a/PreviewOnTaskBarAW.isi b/PreviewOnTaskBarAW.isi deleted file mode 100644 index e7ed38e..0000000 --- a/PreviewOnTaskBarAW.isi +++ /dev/null @@ -1,79 +0,0 @@ -// This is where the original script comes from: https://groups.google.com/g/innosetup/c/cjf1cGiAwK4 - -; -> Modification, Correction and Explanation made by Wilenty <- - -// Easy way to add this Script to your Installer is to use the IssJoiner, -// which you can get from there: https://archive.codeplex.com/?p=issjoiner -// or you can get local copy of it from my GitHub. -// The order of scripts is important! -// IssJoiner Command-Line: "Joiner.exe" "PreviewOnTaskBarAW.isi" "YourScript.iss" -// After IssJoiner, open the result file named: "joined.iss" in the Inno Compiler. -// If the Inno Compiler will show an error about double entries - comment on it and try to compile again until it will find them all. - -; This Sample Script was tested from Inno Setup 5.0.x (ANSI/Unicode) to 6.2.0 (Unicode) versions on Windows 7 & 11. -; And I don't saw any side-effects by using this Script, as they wrote on StackOverflow: https://stackoverflow.com/questions/64060208/inno-setup-window-preview-in-taskbar -; But it must be made on certain rules... Please check the descriptions in the [code] -> InitializeWizard() & DeinitializeSetup(), -; if you want to add it manually to your existing Script. - -[code] -#Define AW=Defined Unicode ? "W" : "A" -const - GW_OWNER = 4; - GWL_HWNDPARENT = (-8); - -function GetWindowLong(Wnd: HWND; nIndex: Integer): LongInt; - external 'GetWindowLong{#AW}@user32.dll stdcall'; -function SetWindowLong(Wnd: HWND; nIndex: Integer; dwNewLong: LongInt): LongInt; - external 'SetWindowLong{#AW}@user32.dll stdcall'; -function GetWindow(Wnd: HWND; uCmd: UINT): HWND; - external 'GetWindow@user32.dll stdcall'; - -var - WizardFormParent: Longint; - MainFormParent: Longint; - -procedure InitializeWizard(); - begin -// These changes must be Reverted back as the first one in the DeinitializeSetup() procedure. -// Otherwise the Installer will show an error at DeinitializeSetup(). - If Not WizardSilent then - With WizardForm do - Begin -#If Defined Unicode -// This method works in the Inno Unicode with the BackGround Window ([Setup] -> WindowVisible=yes) and without it, -// but, for the Inno ANSI please look at the method after the #Else. -// -// WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, GetWindowLong(GetWindow(Handle, GW_OWNER), GWL_HWNDPARENT)); -// or - WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, GetWindowLong(MainForm.Handle, GWL_HWNDPARENT)); -// or (if you have access to the Application Class) -// WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, Application.Handle); - - If MainForm.Visible then - begin - MainFormParent := SetWindowLong(MainForm.Handle, GWL_HWNDPARENT, Handle); - FormStyle := fsStayOnTop; - end; -#Else -// Unfortunately the Unicode method does not work in the Inno ANSI with the BackGround Window, -// so, in the Inno ANSI it will be only used if the BackGround Window was not used (MainForm is not Visible). - If not MainForm.Visible then -// WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, GetWindowLong(GetWindow(Handle, GW_OWNER), GWL_HWNDPARENT)); -// or - WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, GetWindowLong(MainForm.Handle, GWL_HWNDPARENT)); -// or (if you have access to the Application Class) -// WizardFormParent := SetWindowLong(Handle, GWL_HWNDPARENT, Application.Handle); -#EndIf - end; -end; - -Procedure DeinitializeSetup(); - begin -// This must be executed in this procedure as the first one, otherwise the Installer will show an error. - If MainFormParent <> 0 then - If Assigned(MainForm) then - SetWindowLong(MainForm.Handle, GWL_HWNDPARENT, MainFormParent); - If WizardFormParent <> 0 then - If Assigned(WizardForm) then - SetWindowLong(WizardForm.Handle, GWL_HWNDPARENT, WizardFormParent); -end;