Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

grabtext

how can i build in Delphi an app that get every runing aplication em send it to a editbox?
0
lalala
Asked:
lalala
  • 2
  • 2
  • 2
1 Solution
 
rpetruniCommented:
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
 
rpetruniCommented:
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
 
viktornetCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rwilson032697Commented:
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
 
rwilson032697Commented:
lalala: Have you used an answer posted here? If so which one?

Cheers,

Raymond.
0
 
viktornetCommented:
Raymond, you going through all your proposed answers/comments? ;-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now