Delphi WinAPI: GetFocus - 获取当前拥有焦点的窗口的句柄
2023-01-01 16:24:26 作者:admin
本文整理自网络,侵删。
WinAPI: GetFocus - 获取当前拥有焦点的窗口的句柄//声明:GetFocus: HWND; {无参数; 返回当前拥有焦点窗口的句柄}
//举例:unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls;
type TForm1 = class(TForm) Button1: TButton; Memo1: TMemo; Edit1: TEdit; Timer1: TTimer; procedure Timer1Timer(Sender: TObject); end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);var h: HWND;begin h := GetFocus; Text := IntToStr(h);end;
end.
相关阅读 >>
Delphi剪切板-监视剪贴板
Delphi 数据类型列表
Delphi四舍五入问题解决
Delphi 请求时间,为当前时间,数值为1970-01-01以来的毫秒数
Delphi 从url地址中获得文件名
Delphi 获取带分隔符字符串中的字段值
Delphi 关于xe10下indy发送字符串编码的问题
Delphi bytestofile
Delphi 动态生成进度条窗体
Delphi 使用钩子函数
更多相关阅读请进入《Delphi》频道 >>
猜你喜欢
联络方式:
400-123-789
邮箱:xiachao@163.com
Q Q:12345678
微信公众号
微信二维码