ACC: How to Activate an Application with Class Name (1.x/2.0)Last reviewed: June 8, 1997Article ID: Q104710 |
The information in this article applies to:
SUMMARYAdvanced: Requires expert coding, interoperability, and multiuser skills. The function AppActivate() activates an application using the title bar text of the application. You must use the exact title bar text or the function will fail. For example, the title bar text of Microsoft Access is "Microsoft Access" unless an object (a form or report, for example) is maximized. If an object is maximized, the title bar text is "Microsoft Access - <Object Name>." Because knowing the exact title bar text ahead of time can be challenging, the following function demonstrates how to activate an application using the application's Class Name and Microsoft Windows API calls. This article assumes that you are familiar with Access Basic and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information on Access Basic, please refer to the "Introduction to Programming" manual in Microsoft Access version 1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access Basic," in version 2.0.
MORE INFORMATIONWhen an application is started from Program Manager, it registers the class name of the form. The window class provides information about the name, attributes, and resources required by your form. The Microsoft Access window has the class name "OMain." You can determine the class name of an application by using SPY.EXE supplied with the Microsoft Windows Software Development Kit (SDK)version 3.1 or SPYXX.EXE supplied with Microsoft Visual C++ version 2.0. To use the application's Class Name to activate the application, create a new module with the following Declaration section and function: NOTE: In the following sample code, an underscore (_) is used as a line- continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic. NOTE: You may have these Microsoft Windows API functions defined in an existing Microsoft Access library or module; therefore, your declarations may be duplicates causing a duplicate procedure name error message. There are two resolutions to this error:
x=AppActivateClass("opusapp")Below are some class names of common applications that are included in Windows:
Class Name Application ---------------------------------------- OMain ACCESS.EXE SciCalc CALC.EXE CalWndMain CALENDAR.EXE Cardfile CARDFILE.EXE Clipboard CLIPBOARD.EXE Clock CLOCK.EXE CtlPanelClass CONTROL.EXE XLMain EXCEL.EXE Session MS-DOS.EXE Notepad NOTEPAD.EXE pbParent PBRUSH.EXE Pif PIFEDIT.EXE PrintManager PRINTMAN.EXE Progman PROGMAN.EXE (Windows Program Manager) Recorder RECORDER.EXE Reversi REVERSI.EXE #32770 SETUP.EXE Solitaire SOL.EXE Terminal TERMINAL.EXE WFS_Frame WINFILE.EXE MW_WINHELP WINHELP.EXE #32770 WINVER.EXE OpusApp WINWORD.EXE MSWRITE_MENU WRITE.EXEBelow are some class names of applications that are new with Windows 95:
Class Name Application ---------------------------------------------------- CabinetWClass My Computer Window Internet Explorer_Frame IEXPLORE.EXE MSPaintApp MSPAINT.EXE SageWindowClass System Agent Com Window Shell_Traywnd Windows 95 Task Bar WordPadClass WORDPAD.EXE DialerClass DIALER.EXE SJE_CDPlayerClass CDPLAYER.EXE MyDlgClass CHARMAP.EXE MSDefragWClass1 DEFRAG.EXE GFVMainWndClass FAXVIEW.EXE FreeWClass FREECELL.EXE Mplayer MPLAYER.EXE AfxFrameorView HEARTS.EXE NW_Class NETWATCH.EXE AppClass PACKAGER.EXE System Policy Editor POLEDIT.EXE PWLEdit PWLEDIT.EXE RegEdit_RegEdit REGEDIT.EXE ScanDskWDlgClass SCANDSK.EXE SoundRec SNDREC32.EXE Volume Control SNDVOL32.EXE System Monitor SYSMON.EXE MSTaskSwWClass TASKMAN.EXE TelnetWClass TELNET.EXE WinIPCfgClass WINIPCFG.EXE WordPadClass WORDPAD.EXE Session_Window HYPERTRM.EXE |
Additional query words: caption
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |