Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

grabtext

Posted on 1998-12-20
6
Medium Priority
?
143 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

670 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