Make Inno Setup WizardForm moveable if titlebar is disabled

后端 未结 2 702
旧巷少年郎
旧巷少年郎 2020-12-17 06:29

I want to make an installer with a custom look and disabled the titlebar by setting the BorderStyle to bsNone.

Now I cannot move the window

相关标签:
2条回答
  • 2020-12-17 06:50

    No. There's no way to handle messages or alter the WndProc for controls. There was a little chance to implement the undocumented drag move like in this post, but unfortunately InnoSetup doesn't have mouse down events published for scripting, so you're out of luck without some external libary.


    Using the library and code you've mentioned; you are missing the ReleaseCapture function call. Use this script code instead (and don't forget, that the only bare part of the wizard form is on bottom left):

    [Code]
    function ReleaseCapture: BOOL;
      external 'ReleaseCapture@user32 stdcall';
    
    const
      SC_DRAGMOVE = $F012;
      WM_SYSCOMMAND = $0112;
    
    procedure OnMouseDown(Sender: TObject; Button: TMouseButton; 
      Shift: TShiftState; X, Y: Integer);
    begin
      ReleaseCapture;
      WizardForm.Perform(WM_SYSCOMMAND, SC_DRAGMOVE, 0);
    end;
    
    procedure InitializeWizard;
    begin
      WizardForm.OnMouseDown := @OnMouseDown;
    end;
    
    0 讨论(0)
  • 2020-12-17 07:09

    I am updating this question with latest knowledge for future reference.

    This feature (dragging borderless installer window) is now working in Inno Setup, however it is part of Graphical Installer which is Inno Setup extension.

    Check the website http://www.graphical-installer.com for details.

    Note: Graphical Installer is commercial extension for Inno Setup and NSIS which offer new features and enables creating skinned installers. I am developer of this extension.

    0 讨论(0)
提交回复
热议问题