Giriş yap
En iyi yollayıcılar
Hello EMO | ||||
EMO | ||||
eMoStyLe | ||||
BesimBICER | ||||
GameKinG | ||||
Crysis | ||||
~>!.DεvιLρяιεsт.!<~ | ||||
MeTaL | ||||
TrueCrime | ||||
djhayal3t |
Istatistikler
Toplam 203 kayıtlı kullanıcımız varSon kaydolan kullanıcımız: crayzboy76
Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Arama
Sosyal yer imi
Sosyal bookmarking sitesinde Emo, Emo nedir, Emo resimleri, Emo Kıyafetleri, Emo Sözleri, Emo Oyunları, EmoTurkey, Emo Nickler, Emo Avatarları, Punk, Punk Resimleri, Punk Avatarları, Rock, Rock Resimleri, Rock Avatarları, Msn Nickleri, Msn Avatarları, Müzik adresi saklayın ve paylaşın
Sosyal bookmarking sitesinde EMO Style ForumPro - Hos Geldiniz adresi saklayın ve paylaşın
Kimler hatta?
Toplam 3 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 3 Misafir Yok
Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
Reklam
Getting Window Title From Process Name?
1 sayfadaki 1 sayfası
Getting Window Title From Process Name?
[quote='The Godfather.' pid='14303059' dateline='1312482574']
Hey all,
Im kind of new to Delphi, but i am pretty awesome with VB(6, .NET, C#)
I am trying to get the title of a window, i know i need the handle, but how do i get the PID?
Once i have the PID, i think i can use this to get that windows title?
[PHP]type
PProcessID = ^TProcessID;
TProcessID = record
PID : DWORD;
Title : String[255];
end;
function GetWindowNameFromPID(PID: DWORD): String;
var
ProcessID : PProcessID;
begin
GetMem(ProcessID,SizeOf(TProcessID));
ProcessID^.PID := PID;
If Not EnumWindows(@EnumProcess,Integer(Pointer(ProcessID))) Then
begin
If MessageDlg('Could not get hook to the process handles.' + #13#10 + 'Try Again?',mtConfirmation,[mbYes,mbNo],0) = mrYes Then
begin
GetWindowNameFromPID(PID);
end;
end;
end;
function EnumProcess(Handle: HWND; lParam: Integer): BOOL; stdcall;
var
PID : Cardinal;
ProcessID : TProcessID;
Title : String;
begin
If Handle = NULL Then
begin
Result := False;
end
Else
begin
ProcessID := PProcessID(Pointer(lParam))^;
GetWindowThreadProcessID(Handle,PID);
If ProcessID.PID = lParam Then
begin
SetLength(Title,255);
SetLength(Title,GetWindowText(Handle,PChar(Title),Length(Title)));
If Title = '' Then
begin
Title := 'Empty';
end;
ProcessID.Title := Title;
end;
Result := True;
end;
end;[/PHP]
I would really appreciate any help or advice given to me.
Thank you for reading my thread.
Regards.
[/quote]
Hey all,
Im kind of new to Delphi, but i am pretty awesome with VB(6, .NET, C#)
I am trying to get the title of a window, i know i need the handle, but how do i get the PID?
Once i have the PID, i think i can use this to get that windows title?
[PHP]type
PProcessID = ^TProcessID;
TProcessID = record
PID : DWORD;
Title : String[255];
end;
function GetWindowNameFromPID(PID: DWORD): String;
var
ProcessID : PProcessID;
begin
GetMem(ProcessID,SizeOf(TProcessID));
ProcessID^.PID := PID;
If Not EnumWindows(@EnumProcess,Integer(Pointer(ProcessID))) Then
begin
If MessageDlg('Could not get hook to the process handles.' + #13#10 + 'Try Again?',mtConfirmation,[mbYes,mbNo],0) = mrYes Then
begin
GetWindowNameFromPID(PID);
end;
end;
end;
function EnumProcess(Handle: HWND; lParam: Integer): BOOL; stdcall;
var
PID : Cardinal;
ProcessID : TProcessID;
Title : String;
begin
If Handle = NULL Then
begin
Result := False;
end
Else
begin
ProcessID := PProcessID(Pointer(lParam))^;
GetWindowThreadProcessID(Handle,PID);
If ProcessID.PID = lParam Then
begin
SetLength(Title,255);
SetLength(Title,GetWindowText(Handle,PChar(Title),Length(Title)));
If Title = '' Then
begin
Title := 'Empty';
end;
ProcessID.Title := Title;
end;
Result := True;
end;
end;[/PHP]
I would really appreciate any help or advice given to me.
Thank you for reading my thread.
Regards.
[/quote]
Geri: Getting Window Title From Process Name?
[quote='The Godfather.' pid='14304858' dateline='1312486201']
Not exactly, i need to get a windows title from the process name, somehow.
Example : GetWindowtitle('notepad.exe')
Output : Untitled - Notepad
Example : GetWindowtitle('firefox.exe')
Output : Getting Window title From Process Name? - Page 1 - Mozilla Firefox
Make sense?
When i try this, the messagebox is just blank:
[PHP]unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
PProcessID = ^TProcessID;
TProcessID = record
PID : DWORD;
Title : String[255];
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
function EnumProcess(Handle: HWND; lParam: Integer): BOOL; stdcall;
var
PID : Cardinal;
ProcessID : TProcessID;
Title : String;
begin
If Handle = NULL Then
begin
Result := False;
end
Else
begin
ProcessID := PProcessID(Pointer(lParam))^;
GetWindowThreadProcessID(Handle,PID);
If ProcessID.PID = lParam Then
begin
SetLength(Title,255);
SetLength(Title,GetWindowText(Handle,PChar(Title),Length(Title)));
If Title = '' Then
begin
Title := 'Empty';
end;
ProcessID.Title := Title;
end;
Result := True;
end;
end;
function GetWindowNameFromPID(PID: DWORD): String;
var
ProcessID : PProcessID;
begin
GetMem(ProcessID,SizeOf(TProcessID));
ProcessID^.PID := PID;
If Not EnumWindows(@EnumProcess,Integer(Pointer(ProcessID))) Then
begin
If MessageDlg('Could not get hook to the process handles.' + #13#10 + 'Try Again?',mtConfirmation,[mbYes,mbNo],0) = mrYes Then
begin
GetWindowNameFromPID(PID);
end;
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
showmessage(GetWindowNameFromPID(2392));
end;
end.
[/PHP]
[/quote]
Not exactly, i need to get a windows title from the process name, somehow.
Example : GetWindowtitle('notepad.exe')
Output : Untitled - Notepad
Example : GetWindowtitle('firefox.exe')
Output : Getting Window title From Process Name? - Page 1 - Mozilla Firefox
Make sense?
When i try this, the messagebox is just blank:
[PHP]unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
PProcessID = ^TProcessID;
TProcessID = record
PID : DWORD;
Title : String[255];
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
function EnumProcess(Handle: HWND; lParam: Integer): BOOL; stdcall;
var
PID : Cardinal;
ProcessID : TProcessID;
Title : String;
begin
If Handle = NULL Then
begin
Result := False;
end
Else
begin
ProcessID := PProcessID(Pointer(lParam))^;
GetWindowThreadProcessID(Handle,PID);
If ProcessID.PID = lParam Then
begin
SetLength(Title,255);
SetLength(Title,GetWindowText(Handle,PChar(Title),Length(Title)));
If Title = '' Then
begin
Title := 'Empty';
end;
ProcessID.Title := Title;
end;
Result := True;
end;
end;
function GetWindowNameFromPID(PID: DWORD): String;
var
ProcessID : PProcessID;
begin
GetMem(ProcessID,SizeOf(TProcessID));
ProcessID^.PID := PID;
If Not EnumWindows(@EnumProcess,Integer(Pointer(ProcessID))) Then
begin
If MessageDlg('Could not get hook to the process handles.' + #13#10 + 'Try Again?',mtConfirmation,[mbYes,mbNo],0) = mrYes Then
begin
GetWindowNameFromPID(PID);
end;
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
showmessage(GetWindowNameFromPID(2392));
end;
end.
[/PHP]
[/quote]
Similar topics
» How to get the window title from window(form) name
» C# Process List İçerisinden Belirli Bir Exenin pID ve Title Almak
» Process Forking - Running Process From Memory
» How to get process id
» Waiting for Process
» C# Process List İçerisinden Belirli Bir Exenin pID ve Title Almak
» Process Forking - Running Process From Memory
» How to get process id
» Waiting for Process
1 sayfadaki 1 sayfası
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz
Cuma Ağus. 29, 2014 8:33 am tarafından Hello EMO
» goldenchase.net maden yaparak para kazanma
Cuma Ağus. 29, 2014 8:18 am tarafından Hello EMO
» etichal hacker görsel egitim seti
Çarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO
» KO TBL Source C#
Ptsi Ara. 09, 2013 6:36 am tarafından Hello EMO
» x86 Registers
C.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO
» [Tutorial] Pegando Address, Pointers de WYD
Çarş. Tem. 10, 2013 7:25 am tarafından Hello EMO
» [Tutorial] Pegando Address, Pointers de CS Metodo²
Çarş. Tem. 10, 2013 7:23 am tarafından Hello EMO
» [Tutorial] Aprendendo basico deASM OLLYDBG
Çarş. Tem. 10, 2013 7:22 am tarafından Hello EMO
» Basic C# DLL injector
Ptsi Tem. 08, 2013 7:48 am tarafından Hello EMO