Inno Setup Taskbar thumbnail and form style property

206 views
Skip to first unread message

cesar.za...@gmail.com

unread,
Oct 18, 2021, 10:25:07 PM10/18/21
to innosetup

I would like to know if anyone has a solution to my problem. I would like to display the thumbnail in the taskbar and at the same time include a checkbox to keep the installer window on top (over other windows) if the checkbox is checked. If I use the code from the page below to display the installer thumbnail on the taskbar the property "WizardForm.FormStyle" doesn't work.

If anyone can help me, I appreciate it.
Below is a code to better understand my question.
[Setup]
AppName=My App
AppVersion=1.0
DefaultDirName={{#VER > 0x06000000 ? "common" : ""}pf}\My App
DisableWelcomePage=no
OutputBaseFilename=My_App
OutputDir=.

[code]
const
  GW_OWNER = 4;
  GWL_HWNDPARENT = (-8);

function GetWindowLong(Wnd: HWND; nIndex: Integer): Longint; external 'GetWind...@user32.dll stdcall delayload';
function SetWindowLong(Wnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWind...@user32.dll stdcall delayload';
function GetWindow(hWnd: HWND; uCmd: UINT): HWND; external 'GetW...@user32.dll stdcall delayload';

var
  OnTopCheckBox: TNewCheckBox;
  OnTop: Boolean;
  ////OldParent: Longint;

procedure OnTopCheckBox_OnClick(Sender: TObject);
begin
  if OnTopCheckBox.Checked then
  begin
    ////SetWindowLong(WizardForm.Handle, GWL_HWNDPARENT, OldParent);
    WizardForm.FormStyle := fsStayOnTop;
  end else
  begin
    WizardForm.FormStyle := fsNormal;
    ////SetWindowLong(WizardForm.Handle, GWL_HWNDPARENT, GetWindowLong(GetWindow(WizardForm.Handle, GW_OWNER), GWL_HWNDPARENT));
  end;
end;

procedure InitializeWizard();
begin
  ////OldParent := GetWindowLong(WizardForm.Handle, GWL_HWNDPARENT);

  OnTopCheckBox := TNewCheckBox.Create(WizardForm);
  with OnTopCheckBox do begin
    Parent := WizardForm;
    Caption := 'Keep On Top';
    SetBounds(ScaleX(10), WizardForm.NextButton.Top + ScaleY(2), ScaleX(100), ScaleX(15));
    OnClick := @OnTopCheckBox_OnClick;
  end;

  { work if disable this line }
  SetWindowLong(WizardForm.Handle, GWL_HWNDPARENT, GetWindowLong(GetWindow(WizardForm.Handle, GW_OWNER), GWL_HWNDPARENT));
end;


Eivind Bakkestuen

unread,
Oct 19, 2021, 6:38:21 PM10/19/21
to inno...@googlegroups.com
I hope this is something only people inside your company will ever use, because I would really hate an installer that interfered with my normal work.

--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/3ddd3605-b8fe-4bc7-8997-59a82951640an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages