I have been looking at the code from Microsoft for looking for applications to see if they are running.
If you change the lpClassName to "OMain" that works for Access. The caption is a bit of a problem since in Access the caption is not only the program (application) title but also the form caption. It can work but there is no way to know which form might be in use.
I would like to check if another (specific) Access app is running and if not launch it.
Checking for the .ldb will not work if the file was closed improperly.
Another option might simply be to check if it exist (on the harddrive) and launch it regardless.
Any ideas???
Thank you,
If you change the lpClassName to "OMain" that works for Access. The caption is a bit of a problem since in Access the caption is not only the program (application) title but also the form caption. It can work but there is no way to know which form might be in use.
I would like to check if another (specific) Access app is running and if not launch it.
Checking for the .ldb will not work if the file was closed improperly.
Another option might simply be to check if it exist (on the harddrive) and launch it regardless.
Any ideas???
Thank you,
Code:
Function CalculatorUp ()
Const lpClassName = "SciCalc"
Const lpCaption = "Calculator"
'This demonstrates three different ways to call FindWindow:
'1. The ClassName only.
'2. The Caption only.
'3. Both the ClassName and the Caption
MsgBox "Calculator Handle = " & FindWindow(lpClassName, _
VBNullString)
MsgBox "Calculator Handle = " & FindWindow(VBNullString, _
lpCaption)
MsgBox "Calculator Handle = " & FindWindow(lpClassName, _
lpCaption)
'This function could return the handle of a window.
CalculatorUp = FindWindow(lpClassName, 0&)
End Function