久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

獲取D7...D2010任何版本的編譯后的程序

 aaie_ 2012-04-16
//可以獲取D7...D2010任何版本的編譯后的程序,其他版本有待考證,
//本過程在D7...D2010編譯使用沒發(fā)現(xiàn)異常
//For Win32 , XP , Vista , Win7
Function GetDelphiWinControlProp_Name(HProcess , TID , H : THandle; var Name : String) : Boolean; overload;
var
  D , Module , PID : DWORD;
  Msg : DWORD;
  MsgName : String;
  Addr : Pointer;
begin
  Result := False;
  Module := 0;
  if (not EnumProcessModules(HProcess , @Module , 4 , D)) or (Module=0) then exit;
  MsgName := Format('ControlOfs%.8X%.8X', [Module, TID]);
  MSG := RegisterWindowMessage(Pointer(MsgName));
  Addr := Pointer(SendMessage(H, Msg, 0, 0));
  if Addr=NIL then exit;
  PID := 8;//PID := GetDelphiOneVersionComponentPropPos;
  if Integer(PID)<=4 then exit;
  if not ReadProcessMemory(HProcess ,
                           Ptr(DWORD(Addr) + PID),
                           @TID ,
                           4,
                           D) then exit;
  if not ReadProcessMemory(HProcess ,
                           Ptr(TID - 4),
                           @PID ,
                           4,
                           D) then exit;
  //假設(shè)控件的名稱最大長(zhǎng)度200,這個(gè)值 值得商榷
  if (Integer(PID)<=0) or (Integer(PID)>200) then exit;
  MSG := 0;
  if not ReadProcessMemory(HProcess ,
                           Ptr(TID),
                           @Msg ,
                           2,
                           D) then exit;
  if MSG and $FF00 =0 then PID := PID * 2;
  GetMem(Addr , PID+2);
  ZeroMemory(Addr , PID+2);
  if not ReadProcessMemory(HProcess ,
                           Ptr(TID),
                           Addr ,
                           PID,
                           D) then begin FreeMem(Addr); exit; end;
  if MSG and $FF00 = 0 then
    Name := PWideChar(Addr)
  else
    Name := PAnsiChar(Addr);
  Result := True;
end;

//可以獲取D7...D2010任何版本的編譯后的程序,其他版本有待考證,
//本過程實(shí)用于D7...D2010版本
//For Win32 , XP , Vista , Win7
Function GetDelphiWinControlProp_Name(H : THandle; var Name : String) : Boolean;overload;
var
  PID , TID : DWORD;
  HProcess : THandle;
begin
  Result := False;
  TID := GetWindowThreadProcessID(H, PID);
  if (TID=0) or (PID=0) then exit;
  HProcess := OpenProcess(PROCESS_VM_READ    or PROCESS_QUERY_INFORMATION , False , PID);
  if HProcess<>0 then begin
    Result := GetDelphiWinControlProp_Name(HProcess , TID , H , Name);
    CloseHandle(HProcess);
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  S : String;
  H : THandle;
begin
  H := Windows.FindWindow(NIL , 'xxxxxx');
  if H<>0 then begin
    GetDelphiWinControlProp_Name(Handle , S);
    Caption := Caption + '  ' + S;
  end;
end;

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多