The information in this article applies to:
SUMMARYSometimes your WordBasic macro may need to determine how many instances of an application are currently running in memory. MORE INFORMATIONWord 6.0In Word 6.0, API calls may be avoided by displaying the active applications alphabetically in a listbox similar to the Task List. This sample macro may be enhanced to return the actual number of a specific window if that is desired.
Word 2.xIn Word for Windows 2.x, you can call GetModuleUsage in the Windows Kernel dynamic-link library (DLL) to determine how many instances of an application are running in memory.The following macro example demonstrates the use of the Windows GetModuleUsage function to determine how many instances of Word for Windows are running. "MSWORD" is the module name for Word for Windows, but any other application module name can be substituted below. (For example, the module name for Microsoft Excel is "EXCEL.")
The module name for an application is usually the name of
the executable file.
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE
IS AT YOUR OWN RISK. Microsoft provides this macro code "as
is" without warranty of any kind, either express or implied,
including but not limited to the implied warranties of
merchantability and/or fitness for a particular purpose.
REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, pages 30-44 Additional query words: GetModuleHandle GetModuleUsage winword winword2 2.0 running declare dll
Keywords : |
Last Reviewed: September 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |