Detect a program (OpenInsight)
At 07 MAY 2001 12:46:01PM Rick Todd wrote:
Is there a way to detect a running program or application such as Word Perfect?
Thanks
Rick
At 07 MAY 2001 02:00PM WinWin/Revelation Technical Support wrote:
Rick-
There is a windows function called FINDWINDOW. Look at Support.Microsoft.Com for exact syntax usage, but basically it's like this:
In Win95, Win98, or WinNT we will use a windows API function named FindWindow.
FindWindow has already been prototyped in OpenInsight for us, we just need to know how to call it.
Function Findwindow(ClassName, 0)
ClassName must be a null terminated string,
Some popular ClassNames:
Calculator "SciCalc"
Notepad "Notepad"
Paintbrush (Win3x) "pbParent"
Paint (Win95) "MSPaintApp"
Write (Win3x) "MSWRITE_MENU"
WordPad (Win95) "WordPadClass"
Word 2/6/7 "OpusApp"
Excel 4/5/7 "XLMAIN"
PowerPoint 4 "PPApplicationClass"
PowerPoint 7 "PP7FrameClass"
Example:
Subroutine FindWindowTest(Parent)
$Insert Logical
Declare Function FindWindow
FileLocation=c:\class1.xls'
IsExcel=FALSE$
IsExcel=FindWindow( "XLMAIN" : \00\, 0 )
IF IsExcel=0 THEN
Call Launch_Excel(FileLocation)end Else
x=msg(Parent, 'Excel is Already running. Please shut it down and try again')return 0End
(Taken from the Advanced Programming in OI Manual)
At 08 MAY 2001 03:36AM Barry Stevens wrote:
What version of the manual is that.
At 08 MAY 2001 04:26AM Tim Marler @ Prosolve Software wrote:
Barry,
It's also in the Using DDE in OpenInsight workbook, Page 21 of 23.
Tim
At 08 MAY 2001 05:01AM Oystein Reigem wrote:
Don't know, but the use of FindWindow was also docced in v2i1 of Sprezzatura's SENL.
- Oystein -
At 08 MAY 2001 05:05AM Oystein Reigem wrote:
Rick,
If there is any chance there is more than one instance of that program running, and you need to detect all of them I have a function that does exactly that. It uses FindWindow and a couple of other Windows functions.
- Oystein -
At 10 MAY 2001 10:40PM Rick Todd wrote:
Is there a way to find the ClassName for a program? It be found in the registry? If not where?
Thanks
Rick