如何在Delphi中精确调整帮助弹出窗口的显示位置?

2026-04-10 17:272阅读0评论SEO资源
  • 内容介绍
  • 相关推荐

本文共计400个文字,预计阅读时间需要2分钟。

如何在Delphi中精确调整帮助弹出窗口的显示位置?

我有一段底下的代码,现在显示标准的Windows帮助弹出窗口。有人知道这个窗口出现的定位方法吗?例如,要使其显示在用户点击的位置?+function HelpPopupWindow(Command: Word; Data: Integer)

我有下面的代码现在显示标准的 Windows帮助弹出窗口可用.有谁知道这个窗口出现的地方是否有定位方法?例如,要使其显示在用户点击的位置?

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;

干杯

保罗

如何在Delphi中精确调整帮助弹出窗口的显示位置?

您应该使用 HH_DISPLAY_TEXT_POPUP来显示弹出帮助.通过您传递的 HH_POPUP结构,这为您提供了更大的灵活性.使用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;

事实上,我认为你已经发现这个页面是根据你的代码来判断的,但只需要在页面下方进一步阅读.

本文共计400个文字,预计阅读时间需要2分钟。

如何在Delphi中精确调整帮助弹出窗口的显示位置?

我有一段底下的代码,现在显示标准的Windows帮助弹出窗口。有人知道这个窗口出现的定位方法吗?例如,要使其显示在用户点击的位置?+function HelpPopupWindow(Command: Word; Data: Integer)

我有下面的代码现在显示标准的 Windows帮助弹出窗口可用.有谁知道这个窗口出现的地方是否有定位方法?例如,要使其显示在用户点击的位置?

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;

干杯

保罗

如何在Delphi中精确调整帮助弹出窗口的显示位置?

您应该使用 HH_DISPLAY_TEXT_POPUP来显示弹出帮助.通过您传递的 HH_POPUP结构,这为您提供了更大的灵活性.使用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;

事实上,我认为你已经发现这个页面是根据你的代码来判断的,但只需要在页面下方进一步阅读.