From 868daf94f29ce1ffdd799a68c07bb668cd373bcd Mon Sep 17 00:00:00 2001 From: HP\李良庭 <liliangting@lanpucloud.cn:1111> Date: 星期二, 08 七月 2025 11:49:03 +0800 Subject: [PATCH] 提交分辨率自适应版本V3.1.0.1500 --- demo/TabTip1/Unit1.pas | 64 ++++++++++++++++++++++++++++++++ 1 files changed, 64 insertions(+), 0 deletions(-) diff --git a/demo/TabTip1/Unit1.pas b/demo/TabTip1/Unit1.pas new file mode 100644 index 0000000..32dbf79 --- /dev/null +++ b/demo/TabTip1/Unit1.pas @@ -0,0 +1,64 @@ +unit Unit1; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, StdCtrls, TlHelp32, // 用于进程操作 + ShellAPI, ComObj, ActiveX; + +type + TForm1 = class(TForm) + Button1: TButton; + Edit1: TEdit; + procedure Button1Click(Sender: TObject); + private + { Private declarations } + public + { Public declarations } + end; + +var + Form1: TForm1; + +implementation + +{$R *.dfm} + +procedure KillTabTipProcess; +var + ContinueLoop: BOOL; + FSnapshotHandle: THandle; + FProcessEntry32: TProcessEntry32; + hProcess: THandle; +begin + FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); + if FSnapshotHandle <> INVALID_HANDLE_VALUE then + begin + FProcessEntry32.dwSize := SizeOf(FProcessEntry32); + ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32); + + while ContinueLoop do + begin + if ('TabTip.exe' = string(FProcessEntry32.szExeFile)) then + begin + hProcess := OpenProcess(PROCESS_TERMINATE, False, FProcessEntry32.th32ProcessID); + if hProcess <> 0 then + begin + TerminateProcess(hProcess, 0); + CloseHandle(hProcess); + end; + end; + ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32); + end; + CloseHandle(FSnapshotHandle); + end; +end; + +procedure TForm1.Button1Click(Sender: TObject); +begin + //KillTabTipProcess; // 确保没有残留的TabTip进程 + ShellExecute(0, nil, 'OpenTabTip', nil, nil, SW_SHOWNORMAL); +end; + +end. -- Gitblit v1.9.3