//声明:
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.
//效果图:
WinAPI: GetFocus - 获取当前拥有焦点的窗口的句柄

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-01-27
  • 2021-11-24
  • 2022-12-23
  • 2021-11-06
  • 2021-10-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-02-13
相关资源
相似解决方案