📄 ushowhtml.pas
字号:
unit UShowHTML;
interface
uses
ComObj,ActiveX,Windows,Sysutils,Classes,Forms;
procedure LibShowHTMLDialog(ParentHandle: HWND; Moniker: IMoniker;
DialogArguments: PVariant; Options: PWideChar; ReturnValue: PVariant);
type
TShowHTMLDialogLibFunc = function (hwndParent: HWND; Moniker: IMoniker;
pvarArgIn: PVariant; pchOptions: PWideChar; pvarArgOut: PVariant):
HResult; stdcall;
TCreateURLMonikerLibFunc = function (MkCtx: IMoniker; szURL: LPCWSTR; out mk: IMoniker):
HResult; stdcall;
implementation
procedure LibShowHTMLDialog(ParentHandle: HWND; Moniker: IMoniker;
DialogArguments: PVariant; Options: PWideChar; ReturnValue: PVariant);
const
LibName = 'MSHTML.DLL';
FuncName = 'ShowHTMLDialog';
var
LibInstance: THandle;
LibFunc: TShowHTMLDialogLibFunc;
Res: HResult;
begin
LibInstance := LoadLibrary(LibName);
if LibInstance = 0 then RaiseLastWin32Error;
try
LibFunc := TShowHTMLDialogLibFunc(GetProcAddress(LibInstance, FuncName));
if not Assigned(LibFunc) then
raise Exception.Create('MSHTML.DLL does not export ShowHTMLDialog');
Res := LibFunc(ParentHandle, Moniker, DialogArguments, Options, ReturnValue);
OleCheck(Res);
finally
FreeLibrary(LibInstance);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -