gpt4 book ai didi

delphi - 如何更改 Delphi 中帮助弹出窗口的位置?

转载 作者:行者123 更新时间:2023-12-03 15:33:21 25 4
gpt4 key购买 nike

我有下面的代码,现在显示了可用的标准窗口帮助弹出窗口。有谁知道是否有办法定位此窗口出现的位置?例如,让它出现在用户点击的位置?

function HelpPopupWindow(Command: Word; Data: Integer; var CallHelp: Boolean): Boolean;
var
dwIDs: array[0..3] of DWord;
begin
dwIDs[0] := Handle;
dwIDs[1] := Data;
dwIDs[2] := 0;
dwIDs[3] := 0;

HtmlHelp(Handle, PChar('HELP FILE LOCATION HERE::/cshelp.txt'), HH_TP_HELP_CONTEXTMENU, DWORD(@dwIDs[0]));

CallHelp := False;
end;

干杯

保罗

最佳答案

您应该使用HH_DISPLAY_TEXT_POPUP显示弹出帮助。这通过HH_POPUP为您提供了更大的灵 active 。您通过的结构。使用 pt 字段指定位置:

Specifies (in pixels) where the top center of the pop-up window should be located.

Helpware网站提供了一些示例 Delphi 代码:

{Show HH Popup using a string (StringID) from text file in a CHM
StringID: eg. 99; CHMTextFile: eg. _runDir + 'help.chm::/cshelp.txt'}
function HH_ShowPopupHelp3(aParent: TForm; StringID: Integer;
CHMTextFile: String; XYPos: TPoint): HWND;
var hhpopup: HH.THHPopup;
begin
with hhpopup do
begin
cbStruct := sizeof(hhpopup); //sizeof this structure
hinst := 0; //no used
idString := StringID; //topic number in a text file.
pszText := nil; //no used
pt := XYPos; //top center of popup
clrForeground := COLORREF(-1); //use -1 for default - RGB value
clrBackground := COLORREF(-1); //use -1 for default - RGB value
rcMargins := Rect(-1,-1,-1,-1);//amount of space between edges
pszFont := '';
end;
Result := HtmlHelp(aParent.Handle, PChar(CHMTextFile),
HH_DISPLAY_TEXT_POPUP, DWORD(@hhpopup));
end;

事实上,我认为根据代码判断您已经找到了此页面,但只需要进一步阅读该页面即可。

关于delphi - 如何更改 Delphi 中帮助弹出窗口的位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9226854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com