去掉TWebBrowser的滚动条_Delphi

  • 内容
  • 评论
  • 相关

参见以下代码:

var
Form1 : TForm;
HookID : THandle;
DisableRButton : boolean;

implementation

function MouseProc(nCode: integer; wParam,

http://www.gaodaima.com/?p=65861去掉TwebBrowser的滚动条_Delphi

lParam: longint): longint; stdcall;
function GetClassNameEnh(Handle: Hwnd): string;
var
ClassName: PChar;
Buffer: integer;
begin
Buffer := 40;
getmem(ClassName, Buffer);
windows.GetClassName(Handle, ClassName, Buffer);
Result := ClassName;
Freemem(ClassName);
end;

var
P: TPoint;
begin
if (nCode < 0) then
Result := CallNextHookEx(HookID, nCode, wParam, lParam)
else if DisableRButton and ((wParam = WM_RBUTTONDOWN) or (wParam =
WM_RBUTTONUP)) then
begin
GetCursorPos(P);
if Pos('Internet Explorer_', GetClassNameEnh(WindowFromPoint(P))) <> 0
then
Result := HC_SKIP
else
Result := CallNextHookEx(HookID, nCode, wParam, lParam);
end
else
Result := CallNextHookEx(HookID, nCode, wParam, lParam);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
DisableRButton := True;
HookID := SetWindowsHookEx(WH_MOUSE, MouseProc, 0,
GetCurrentThreadId());
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
if HookID <> 0 then
UnHookWindowsHookEx(HookID);
end;

欢迎大家阅读《去掉TWebBrowser的滚动条_Delphi》,跪求各位点评,若觉得好的话请收藏本文,by 搞代码

原创文章,转载请注明: 转载自搞代码

本文链接地址: 去掉TWebBrowser的滚动条_Delphi

微信支付二维码

微信 赏一包辣条吧~

支付宝支付二维码

支付宝 赏一听可乐吧~

评论

0条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注