Link to home
Start Free TrialLog in
Avatar of roosiedb
roosiedb

asked on

Using Windows calculator

Hi there,

To use the calculator from Windows, I use the following line:

ShellExecute(0,nil,pchar('C:\WINDOWS\CALC.EXE'),nil,nil,sw_shownormal);

This is working fine...

Now I have the following question: Before I execute this calculator I want to check if there is already an instance active. And if there is already a calculator active then I would like to set the focus on that one. In other words: not opening a new instance anymore. If minimized then (of course) I would like to maximize before setting the focus on the calculator.

Please provide me with a complete example.

Thank you very much!

RoosieDB
ASKER CERTIFIED SOLUTION
Avatar of Cesario Lababidi
Cesario Lababidi
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of inthe
inthe

or use classname instead of caption as this should be same for all languages:

HCalc := FindWindow( SciCalc,nil);

inthe, did you recieved any mail Notifications form ExEx last 3 days?
hi Cesario,
was just wondering same thing myself.
well i guess Crazyone answered us :)
Avatar of roosiedb

ASKER

Hi Cesario,

Your solution is working fine, however, I would like to implement your example in my application without changing it everytime when my users are using different languages.

So, if you can send me a solution to solve that issue I would be very happy. But it's not required, because this is already working for me.

Your colleague wrote something like HCalc := FindWindow(SciCalc,nil), but this is not working (error message).

Thank you anyway.
RoosieDB
Hi RossieDB,

I will try to find a solution today....

Best Regrads

Cesario
Hi Cesario,

I would be very grateful...
:-)

In other words: Danke sehr !!

RoosieDB