Ken*_*ite 10
TTipMode在Controls.pas被定义,并被用来跟踪状态的文本输入面板的(打开或关闭),购自TabTip.exe那就是在ITextInputPanel接口.
procedure TWinControl.UpdateTIPStatus;
begin
if Assigned(FTIPIntf) then
begin
if TipMode = tipOpen then SetTextInputPanelStatus(Self, True)
else if TipMode = tipClose then SetTextInputPanelStatus(Self, False);
end;
end;
Run Code Online (Sandbox Code Playgroud)
这SetTextInputPanelStatus是从这个方法调用的过程:
procedure SetTextInputPanelStatus(Control: TWinControl; OpenTIP: Boolean);
procedure InvokeTabTip;
const
DefaultTabTipPath = 'C:\Program Files\Common Files\microsoft shared\ink\TabTip.exe';
DefaultOnScreenKeyboardPath = 'C:\Windows\System32\OSK.exe';
var
TabTipPath: string;
begin
TabTipPath := DefaultTabTipPath;
ShellExecute(0, 'open', PChar(TabTipPath), nil, nil, SW_SHOWNOACTIVATE);
end;
procedure OPenTip2;
begin
(Control.FTIPIntf as ITextInputPanel).SetInPlaceVisibility(1); // True
end;
procedure CloseTip;
begin
(Control.FTIPIntf as ITextInputPanel).SetInPlaceVisibility(0); // False
end;
begin
if Assigned(Control.FTIPIntf) then
begin
if OpenTIP then OpenTip2 // InvokeTabTip
else CloseTip;
end;
end;
Run Code Online (Sandbox Code Playgroud)
这表明如果最后一个参数(OpenTip)是True,它将打开文本输入面板,并带有程序的命令行(完成OpenTip).如果参数是False关闭那个窗口.您可以通过在指定的位置执行应用程序来查看文本输入窗口DefaultTabTipPath.
(注意,InvokeTabTip上面包含的那个常量的代码永远不会被执行;对它的调用被注释掉了.感谢@SertacAkyuz指出它.我已经编辑过包含那些信息.)