Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Running another application from within an app

Posted on 1998-11-19
3
Medium Priority
?
146 Views
Last Modified: 2010-04-04
I have a large application which requires a custom written print engine to be running in the background. Occasionally I have found users closing down this print engine, thus stopping any more printing being done.

Can anyone suggest a way of first checking if the print engine is running or not. One restriction I have is that I cannot access the source code of the print engine so the answer must come from modifications to my program.

Thank you for any assistance
0
Comment
Question by:psykes
[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
3 Comments
 
LVL 1

Expert Comment

by:sassas081597
ID: 1347302
Has your print engine any main window? In this case you can check whether the Window with specified name exists?
0
 

Author Comment

by:psykes
ID: 1347303
The print engine has a main window and will always be called by the same string, therefore I could try the method you described, except how do I check whether the specified name exists
0
 
LVL 1

Accepted Solution

by:
sassas081597 earned 300 total points
ID: 1347304
Use the function FindWindow (or FindWindowA, or FindWindowW) as shown bellow.
In this Example you write any text in EditBox and when you click a button the programm looks for a Window with the Caption exactly as in Editbox. If you get 0 - Such window does not exist else - it exists.

procedure TForm1.Button1Click(Sender: TObject);
var
    c: array[0..50] of Char;
    d: PChar;
begin
     StrPCopy(c,Edit1.Text);
     d:=nil;
     a:=;
     if (FindWindowA(d,c)<>0) then
          Caption:='Window Found'
     else
         Caption:='Window Not Found';
end;
So try this code and then write your own.
If you'd like, you can use FindWindowEx() instead of FindWindow() (look in windows.pas for its parameters).
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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