HOWTO: Call LoadModule() API Function from Visual BasicLast reviewed: September 29, 1997Article ID: Q83350 |
The information in this article applies to:
SUMMARYThis article demonstrates how to call the Windows LoadModule() API function from a Visual Basic program. The LoadModule() API function loads and executes a Windows program or creates a new instance of an existing Windows program. The code example below shows an example of calling WINVER.EXE with the LoadModule() function call, but you can change it to any executable file. NOTE: The Shell function provided in Visual Basic provides a functionality similar to and simpler than the technique explained in this article. NOTE: Only 16-bit implementations of VBA support the sample code in this article.
MORE INFORMATIONThe LoadModule() API function call has only two parameters, but the second parameter is a pointer to a structure with an embedded structure in it. The two parameters are as follows:
lpModuleName Points to a null terminated string that contains the filename of the application to be run.lpParameterBlock Points to a data structure consisting of four fields that define a parameter block. The data structure consists of the following fields: wEnvSeg: Specifies the segment address of the environment under which the module is to run; 0 indicates that the Windows environment is to be copied. lpCmdLine: Points to a NULL terminated character string that contains a correctly formed command line. This string must not exceed 120 bytes in length. lpCmdShow: Points to a data structure containing two WORD length values. The first value must be set to 2, and the second value in this example will be set to 5. dwReserved: Reserved and must be NULL. Steps to Reproduce Behavior
Keywords : kbprg kbfasttip Version : WINDOWS:2.0 3.0 Platform : WINDOWS Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |