3

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 anymore. I have looked around and found a solution for Delphi:
http://www.chami.com/tips/delphi/010397D.html

Can this be accomplished in Inno Setup?

I have already looked up the WM_NCHITTEST thing on MSDN but I cannot figure out if and how I can make this work.

Edit: After looking around and compiling it using the advanced compiler advanced compiler I came up with this, but it doesn't work. It compiles but when I click inside the window, I cannot drag it.

procedure Dragg(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  SendMessage(WizardForm.Handle, $F112, $F012, 0);
end;

procedure InitializeWizard();
begin
  WizardForm.OnMouseDown := @Dragg;
end;
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
user1662035
  • 363
  • 4
  • 13

2 Answers2

4

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;
Community
  • 1
  • 1
TLama
  • 75,147
  • 17
  • 214
  • 392
  • 1
    It's not completely impossible, but it will require the help of an external DLL to subclass the main Inno window. And that way lies madness, and/or Sparta. – Miral Dec 10 '12 at 07:27
  • @Miral, yup, that's why I ended up this post by *without some external libary* :-) – TLama Dec 10 '12 at 07:34
  • Oh yes, I forgot to mention that I am using the advenced compiler available on restools.hanzify.org which is capable of handling mouse down events as well as a lot of other features which the standard compiler lacks. It contains a txt-file which shows all Support Classes. You can get it here: http://restools.hanzify.org/article.asp?id=89 – user1662035 Dec 10 '12 at 13:18
  • So did you finally give up on this? Is there no way to move the Form? – user1662035 Dec 10 '12 at 22:02
  • After last test I did, yes, I'm giving up since it's not possible to do this at this time, because the most important class for your wizard form drag move, the `TNewNotebookPage` doesn't have from that library published `OnMouseDown` event. So you won't be able to drag, simply said, by the gray area of each page. And you can't disable their parent for click through since they contain active components. At this time it's possible to handle most of the static controls (labels, images, progress bars, etc.), but the the pages on whose they are placed not. – TLama Dec 10 '12 at 22:17
  • I mean not possible with that library using `OnMouseDown` with that undocumented drag move. – TLama Dec 10 '12 at 22:20
  • I am still a bit confused, because the TControl and TForm classes both have added Drag events... You said those are for moving components but I hope there is more to this! – user1662035 Dec 10 '12 at 22:35
  • Unfortunately not. I just enabled the titlebar again. If I will ever come up with another working solution for this I will let you know right here! – user1662035 Nov 21 '13 at 19:34
0

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.

Slappy
  • 5,250
  • 1
  • 23
  • 29