网站首页  词典首页

请输入您要查询的函数:

 

术语 loadmodule
释义 LoadModule
语法:
C++
DWORD WINAPI LoadModule(
__in LPCSTR lpModuleName,
__in LPVOID lpParameterBlock
);
LoadModule伪功能
加载并执行一个应用程序或创建一个现有应用程序的新实例。
注意:此功能仅提供了兼容性与16位的Windows版本。应用程序应该使用CreateProcess函数。
参数
lpModuleName [in]
应用程序的文件名运行。当指定的路径,一定要使用反斜杠(\\),而不是正斜杠(/)。如果lpModuleName参数不包含目录的路径,在此以可执行文件的系统搜索:
该目录由该应用程序加载。
当前目录。
该系统目录。使用GetSystemDirectory函数获得这个目录的路径。
16位系统目录。没有函数获得这个目录的路径,但它是搜索。该目录的名称是系统。
Windows目录。使用GetWindowsDirectory函数获得这个目录的路径。
即是在PATH环境变量中列出的目录。
lpParameterBlock [in]
对一个应用程序的指针定义LOADPARMS32结构,定义了新的应用程序的参数块。所有未使用的成员设置为NULL,除了lpCmdLine,它必须指向一个空结束的字符串,如果不使用。有关更多信息,请参见备注。
返回值
如果函数成功,返回值大于31。
如果函数失败,返回值是一个错误值,这可能是下列值之一。
返回代码/ valueDescription
0The系统内存不足或资源。
ERROR_BAD_FORMAT
11LThe。exe文件是无效的。
ERROR_FILE_NOT_FOUND
2LThe指定的文件未找到。
ERROR_PATH_NOT_FOUND
3LThe指定的路径未找到。
备注
该LOADPARMS32结构具有以下形式:
typedef结构tagLOADPARMS32(
LPSTR lpEnvAddress; / /地址的环境字符串
LPSTR lpCmdLine,/ /地址的命令行
LPSTR lpCmdShow; / /如何显示的新计划
双字节值dwReserved; / /必须为零
)LOADPARMS32; MemberMeaning
lpEnvAddressPointer到一个空数组的结尾的字符串,供应新进程的环境字符串。该阵列有一个NULL作为它的最后一个条目的值。阿为NULL这个参数的值将导致新的进程开始与调用进程相同的环境。
lpCmdLinePointer的帕斯卡尔风格的字符串,其中包含一个正确的命令行组成。字符串的第一个字节包含的字节字符串中的数目。字符串的其余部分包含命令行参数,不包括子进程的名称。如果没有命令行参数,这个参数必须指向一个零长度字符串,它不能为NULL。
lpCmdShowPointer一个结构包含两个字值。第一个值必须设置为2。第二个值指定的应用程序窗口将显示,用于供应的STARTUPINFO结构wShowWindow成员CreateProcess函数。见一个可接受的值列表中的ShowWindow函数nCmdShow参数的描述。
dwReservedThis参数保留,它必须为零。
应用程序应该使用CreateProcess函数代替LoadModule伪。在LoadModule函数调用,组成作为参数CreateProcess的如下。
使用CreateProcess的parameterArgument
lpszApplicationNamelpModuleName
lpszCommandLinelpParameterBlock.lpCmdLine
lpProcessAttributesNULL
lpThreadAttributesNULL
bInheritHandlesFALSE
dwCreationFlags0
lpEnvironmentlpParameterBlock.lpEnvAddress
lpCurrentDirectoryNULL
lpStartupInfoThe结构初始化为零。的CB成员设置为结构的大小。该wShowWindow成员设置的lpParameterBlock.lpCmdShow第二个单词的价值。
lpProcessInformation.hProcessThe处理立即关闭。
lpProcessInformation.hThreadThe立即关闭句柄。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateProcess的
动态链接库函数
GetSystemDirectory
GetWindowsDirectory
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==LoadModule Function
Loads and executes an application or creates a new instance of an existing application.
Note This function is provided only for compatibility with 16-bit versions of Windows. Applications should use the CreateProcess function.
Syntax
C++
DWORD WINAPI LoadModule(
__in LPCSTR lpModuleName,
__in LPVOID lpParameterBlock
);
Parameters
lpModuleName [in]
The file name of the application to be run. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). If the lpModuleName parameter does not contain a directory path, the system searches for the executable file in this order:
The directory from which the application loaded.
The current directory.
The system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
lpParameterBlock [in]
A pointer to an application-defined LOADPARMS32 structure that defines the new application's parameter block. Set all unused members to NULL, except for lpCmdLine, which must point to a null-terminated string if it is not used. For more information, see Remarks.
Return Value
If the function succeeds, the return value is greater than 31.
If the function fails, the return value is an error value, which may be one of the following values.
Return code/valueDescription
0The system is out of memory or resources.
ERROR_BAD_FORMAT
11LThe .exe file is invalid.
ERROR_FILE_NOT_FOUND
2LThe specified file was not found.
ERROR_PATH_NOT_FOUND
3LThe specified path was not found.

Remarks
The LOADPARMS32 structure has the following form:
typedef struct tagLOADPARMS32 {
LPSTR lpEnvAddress; // address of environment strings
LPSTR lpCmdLine; // address of command line
LPSTR lpCmdShow; // how to show new program
DWORD dwReserved; // must be zero
} LOADPARMS32;MemberMeaning
lpEnvAddressPointer to an array of null-terminated strings that supply the environment strings for the new process. The array has a value of NULL as its last entry. A value of NULL for this parameter causes the new process to start with the same environment as the calling process.
lpCmdLinePointer to a Pascal-style string that contains a correctly formed command line. The first byte of the string contains the number of bytes in the string. The remainder of the string contains the command line arguments, excluding the name of the child process. If there are no command line arguments, this parameter must point to a zero length string; it cannot be NULL.
lpCmdShowPointer to a structure containing two WORD values. The first value must always be set to two. The second value specifies how the application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO structure to the CreateProcess function. See the description of the nCmdShow parameter of the ShowWindow function for a list of acceptable values.
dwReservedThis parameter is reserved; it must be zero.

Applications should use the CreateProcess function instead of LoadModule. The LoadModule function calls CreateProcess by forming the parameters as follows.
CreateProcess parameterArgument used
lpszApplicationNamelpModuleName
lpszCommandLinelpParameterBlock.lpCmdLine
lpProcessAttributesNULL
lpThreadAttributesNULL
bInheritHandlesFALSE
dwCreationFlags0
lpEnvironmentlpParameterBlock.lpEnvAddress
lpCurrentDirectoryNULL
lpStartupInfoThe structure is initialized to zero. The cb member is set to the size of the structure. The wShowWindow member is set to the value of the second word of lpParameterBlock.lpCmdShow.
lpProcessInformation.hProcessThe handle is immediately closed.
lpProcessInformation.hThreadThe handle is immediately closed.

Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateProcess
Dynamic-Link Library Functions
GetSystemDirectory
GetWindowsDirectory
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms684183(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:21:16