Solved

grabtext

Posted on 1998-12-20
6
137 Views
Last Modified: 2010-04-04
how can i build in Delphi an app that get every runing aplication em send it to a editbox?
0
Comment
Question by:lalala
  • 2
  • 2
  • 2
6 Comments
 
LVL 1

Expert Comment

by:rpetruni
ID: 1352233
Pls be more specific, i don't untherstand what you wannt...
 do you wannt to count how many times your app is beein started?
0
 
LVL 1

Expert Comment

by:rpetruni
ID: 1352234
Pls be more specific, i don't untherstand what you wannt...
 do you wannt to count how many times your app is beein started?
0
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1352235
Try this one... This sends the name of the app to a ListBox and not to an Edit Box...

function GetWinProc(Handle : HWND;  lParam : LPARAM) : Boolean; stdcall;
var
  Name : array [0..MAX_PATH] of char;
begin
  if IsWindowVisible(Handle) then begin
    GetClassName(Handle, Name, sizeof(Name));
    if(strpas(StrUpper(Name)) = 'TAPPLICATION') then begin
      GetWindowText(Handle, name, sizeof(name));
      if strpas(name) <> '' then
        Form1.ListBox1.Items.Add(strpas(Name));
    end;
  end;
  Result := true;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  EnumWindows(@GetWinProc, 0);
end;

Hope this helps. If you need moe help with this, let me know and I'll help you till you're satisfied...

-Viktor
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1352236
Viktor, This will only get Delphi applications!

The code below will put all names of all running processes (applications) into a treeview...

Cheers,

Raymond.

implementation

uses
  tlHelp32;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  hSnapshot : THandle;
  pe : TPROCESSENTRY32;
begin
  hSnapshot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  if hSnapshot = THandle(-1) then
    Exit;

  pe.dwSize := sizeof(pe);
  if Process32First(hSnapshot, pe) then
    repeat
      TreeView1.Items.AddChild(TreeView1.items[0], pe.szExeFile);
    until not Process32Next(hSnapshot, pe);

  CloseHandle(hSnapshot);
end;

end.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1352237
lalala: Have you used an answer posted here? If so which one?

Cheers,

Raymond.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352238
Raymond, you going through all your proposed answers/comments? ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now