ACC2000: How to Determine If a Specific Windows Program Is Running (210605)
The information in this article applies to:
This article was previously published under Q210605 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).
SUMMARY
Through the use of a Windows application programming interface (API) function, Microsoft Access can determine if another program is already running. There may be times when you want only one instance of an application to run in Microsoft Windows. For example, if you add a command button to a form that starts the Windows Calculator (Calc.exe) program, you can start many instances of Calculator. This is an inefficient use of memory and system resources.
The API function used to determine whether a specific program is running is
called FindWindow(). FindWindow() returns the handle of the window whose class is given by the lpClassName parameter and whose window name (or caption) is given by the lpCaption parameter. If the returned value is zero, the application is not running.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. REFERENCES
For more information, see the Microsoft Win32 Software Development Kit.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbhowto kbProgramming KB210605 |
---|
|