如果禁用标题栏,则使Inno Setup WizardForm可移动 [英] Make Inno Setup WizardForm moveable if titlebar is disabled

查看:1247
本文介绍了如果禁用标题栏,则使Inno Setup WizardForm可移动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过将 BorderStyle 设置为 bsNone 来禁用标题栏。

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

现在我不能再移动窗口了。我已经环顾四周,为Delphi找到了一个解决方案:

http: /www.chami.com/tips/delphi/010397D.html

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

可以在Inno Setup中完成吗?

Can this be accomplished in Inno Setup?

我已经在MSDN上查找了 WM_NCHITTEST 的东西,但我无法确定是否和如何使这项工作。

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

编辑:使用高级编译器高级编译器我想出了这一点,但它不起作用。它编译,但是当我点击窗口内部时,我无法拖动它。

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;


推荐答案

没有办法处理消息或更改控件的 WndProc 。在 这篇文章 中实施无证拖动动作有一点机会, a>,但不幸的是InnoSetup没有发布用于脚本的鼠标向下的事件,所以你没有一些外部的libary,没有运气。

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.

使用您提到的库和代码;您缺少 ReleaseCapture 函数调用。使用这个脚本代码(不要忘了,向导窗体的唯一的部分是左下角):

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;

这篇关于如果禁用标题栏,则使Inno Setup WizardForm可移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆