Solved

grabtext

Posted on 1998-12-20
6
136 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

11 Experts available now in Live!

Get 1:1 Help Now