欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
進(jìn)程、窗口句柄、文件屬性、程序運行狀態(tài)
 

uses TLHelp32,PsAPI;

(1)顯示進(jìn)程列表:
procedure TForm1.Button2Click(Sender: TObject);
var lppe: TProcessEntry32;
    found : boolean;
    Hand : THandle;
    P:DWORD;
    s:string;
begin
  ListBox1.Items.Clear ;
  Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
  found := Process32First(Hand,lppe);
  while found do
  begin
    s := StrPas(lppe.szExeFile);
    if lppe.th32ProcessID>0 then
      p := lppe.th32ProcessID
    else
      p := 0;
    ListBox1.Items.AddObject(s,pointer(p));//列出所有進(jìn)程。
    found := Process32Next(Hand,lppe);
  end;
end;

(2)殺死某進(jìn)程:
procedure TForm1.Button3Click(Sender: TObject);
var lppe: TProcessEntry32;
    found : boolean;
    Hand : THandle;
    P:DWORD;
    sExeFile,sSelect:string;
    killed:boolean;
begin
  p :=DWORD(ListBox1.Items.Objects[ListBox1.itemindex]);
  if P<>0 then
  begin
    killed := TerminateProcess(OpenProcess(PROCESS_TERMINATE,False,P),$FFFFFFFF);
    if not killed then
       messagebox(self.handle,pchar(sExeFile+‘無(wú)法殺死!‘),‘提示‘,MB_OK or MB_ICONWARNING)
    else
      ListBox1.Items.Delete(ListBox1.ItemIndex);
  end;
end;

(3)取得某進(jìn)程EXE路徑:
procedure TForm1.Button8Click(Sender: TObject);  //uses  PSAPI;
var
  h:THandle;  fileName:string; iLen:integer; hMod:HMODULE;cbNeeded,p:DWORD;
begin
  p :=DWORD(ListBox1.Items.Objects[ListBox1.itemindex]);
  h  :=  OpenProcess(PROCESS_ALL_ACCESS,  false,  p);      //p  為 進(jìn)程ID
  if  h  >  0  then
  begin
    if  EnumProcessModules(  h,  @hMod,  sizeof(hMod),  cbNeeded)  then
    begin
       SetLength(fileName,  MAX_PATH);
       iLen  :=  GetModuleFileNameEx(h,  hMod,  PCHAR(fileName),  MAX_PATH);
       if  iLen  <>  0  then
       begin
         SetLength(fileName,  StrLen(PCHAR(fileName)));
         ShowMessage(fileName);
       end;
    end;
    CloseHandle(h);
  end;
end;

(4)取得窗口列表
begin
   ListBox1.Items.Clear ;
   EnumWindows(@EnumWindowsProc, 0);
end;

(5)殺死窗口進(jìn)程
procedure TForm1.Button6Click(Sender: TObject);
var
  H:THandle;
  P:DWORD;
  s:string;
  killed:boolean;
begin
  s := ListBox1.Items[ListBox1.ItemIndex];
  H:=FindWindow(nil,pchar(s));
  if H<>0 then
  begin
    GetWindowThreadProcessId(H,@P);
    if P<>0 then
      killed:=TerminateProcess(OpenProcess(PROCESS_TERMINATE,False,P),$FFFFFFFF);
    if not killed then
       messagebox(self.handle,pchar(s+‘無(wú)法殺死!‘),‘提示‘,MB_OK or MB_ICONWARNING)
    else
      ListBox1.Items.Delete(ListBox1.ItemIndex);
  end;
end;

(6)取得窗口進(jìn)程路徑:
procedure TForm1.Button9Click(Sender: TObject);
var
  H:THandle;  P,cbNeeded: DWORD;  s,fileName:string;
  iLen:integer;   hMod:HMODULE;
begin
  s := ListBox1.Items[ListBox1.ItemIndex];
  H:=FindWindow(nil,pchar(s));

  if H<>0 then
  begin
    GetWindowThreadProcessId(H,@P);
    if P<>0 then
    begin
       h  :=  OpenProcess(PROCESS_ALL_ACCESS,  false,  p);      //p  為 進(jìn)程ID
       if  h  >  0  then
       begin
         if  EnumProcessModules(  h,  @hMod,  sizeof(hMod),  cbNeeded)  then
         begin
           SetLength(fileName,  MAX_PATH);
           iLen  :=  GetModuleFileNameEx(h,  hMod,  PCHAR(fileName),  MAX_PATH);
           if  iLen  <>  0  then
           begin
                   SetLength(fileName,  StrLen(PCHAR(fileName)));
                   ShowMessage(fileName);
           end;
         end;
         CloseHandle(h);
       end;
    end;
  end;
end;

(7)文件屬性:
procedure TForm1.Button1Click(Sender: TObject);
var
  SR: TSearchRec;
  V1, V2, V3, V4: integer  ;
const
  dtFmt:string = ‘YYYY-MM-DD HH:NN:SS‘;
begin
  // ============== 方法一 ==================== //
  if FindFirst(sFileName, faAnyFile, SR) = 0 then
  begin
    Edit1.Text := intToStr(SR.Attr);   //文件屬性
    Edit2.Text := intToStr(SR.Size);   //文件大小
    Edit3.Text := FormatDateTime(dtFmt,CovFileDate(SR.FindData.ftCreationTime));   //創(chuàng )建時(shí)間
    Edit4.Text := FormatDateTime(dtFmt,CovFileDate(SR.FindData.ftLastWriteTime));  //最后修改時(shí)間
    Edit5.Text := FormatDateTime(dtFmt,CovFileDate(SR.FindData.ftLastAccessTime)); //最后訪(fǎng)問(wèn)時(shí)間

    if SR.Attr and faHidden <> 0 then
      FileSetAttr(sFileName, SR.Attr-faHidden);

    FindClose(SR);
  end;

  if GetFileVersion(sFileName,V1, V2, V3, V4) then
     Edit7.Text := intToStr(v1)+‘.‘+intToStr(v2)+‘.‘+intToStr(v3)+‘.‘+intToStr(v4);

  // ============== 方法二 ==================== //
  {
  var
  Attrs: Word;
  f: file of Byte;   // 文件大小 必須要 定義為" file of byte" ,這樣才能取出 bytes
  size: Longint;

  //文件屬性
  Attrs := FileGetAttr(sFileName);

  Edit1.Text := intToStr(Attrs);

  //文件大小
  AssignFile(f, OpenDialog1.FileName);
  Reset(f);
  try
    AssignFile(f, sFileName);
    Reset(f);
    size := FileSize(f);
    Edit2.Text := intToStr(size);
  finally
    CloseFile(f);
  end;
  }
end;

(8)判斷程序是否在運行:
procedure TForm1.Button5Click(Sender: TObject);
var PrevInstHandle:Thandle;
  AppTitle:pchar;
begin
 AppTitle := pchar(‘test‘);
 PrevInstHandle := FindWindow(nil, AppTitle);
    if PrevInstHandle <> 0 then begin
      if IsIconic(PrevInstHandle) then
        ShowWindow(PrevInstHandle, SW_RESTORE)
      else
        BringWindowToTop(PrevInstHandle);
      SetForegroundWindow(PrevInstHandle);
    end;
end;

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
取得進(jìn)程和dll
查找某目錄下的所有文件
Lazarus 0.9.31 編譯 BASS 音頻庫 的例子,不能播放中文名的 MP3 的解決。
Delphi網(wǎng)絡(luò )函數
Delphi常用的函數庫
delphi 獲取webbrowser的cookies給Idhttp用
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久