Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 20-10-2021, 15:57
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,079
Thanks: 1,842
Thanked 2,315 Times in 790 Posts
Cesar82 is on a distinguished road
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.
Part of the code was obtained from: inno-setup-window-preview-in-taskbar

If anyone can help me, I appreciate it.
Below is a code to better understand my question.
Code:
[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 '[email protected] stdcall delayload';
function SetWindowLong(Wnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external '[email protected] stdcall delayload';
function GetWindow(hWnd: HWND; uCmd: UINT): HWND; external '[email protected] stdcall delayload';

var
  OnTopCheckBox: TNewCheckBox;
  ////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;
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 17:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com