GetModuleBaseName()与GetModuleFileNameEx()函数用法

MSDN上面原文:
GetModuleBaseName()
The GetModuleBaseName function retrieves the base name of the specified module. //GetModuleBaseName函数检索指定模块的基本名称(以’\0’终止)

DWORD GetModuleBaseName(
HANDLE hProcess, // handle to process
HMODULE hModule, // handle to module
LPTSTR lpBaseName, // base name buffer
DWORD nSize // maximum characters to retrieve
);
Parameters//参数
hProcess
[in] Handle to the process that contains the module.
hModule
[in] Handle to the module.
lpBaseName
[out] Pointer to the buffer that receives the base name of the module. If the base name is longer than maximum number of characters specified by the nSize parameter, the base name is truncated.
nSize
[in] Specifies the maximum number of characters to copy to the lpBaseName buffer.

Return Value//返回值
If the function succeeds, the return value specifies the length of the string copied to the buffer.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

GetModuleFileNameEx()
The GetModuleFileNameEx function retrieves the fully qualified path for the specified module.

DWORD GetModuleFileNameEx(
HANDLE hProcess, // handle to process
HMODULE hModule, // handle to module
LPTSTR lpFilename, // path buffer
DWORD nSize // maximum characters to retrieve
);
Parameters
hProcess
[in] Handle to the process that contains the module.
hModule
[in] Handle to the module.
lpFilename
[out] Pointer to the buffer that receives the fully qualified path to the module. If the file name is longer than maximum number of characters specified by the nSize parameter, the file name is truncated.
nSize
[in] Specifies the maximum number of characters to copy to the lpFilename buffer.
Return Value
If the function succeeds, the return value specifies the length of the string copied to the buffer.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值