获取进程启动命令行 - GetCommandLine
函数简介
获取进程启动命令行。
接口名称
GetCommandLine
DLL调用
long GetCommandLine(long instance, long hwnd);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| hwnd | 长整数型 | 窗口句柄 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 获取指定窗口对应进程的启动命令行
long hwnd = 0x000A0B2C;
long ptr = GetCommandLine(instance, hwnd);
char* cmdLine = GetStringFromPtr(instance, ptr);
FreeStringPtr(instance, ptr);
Python
# 待补充
返回值
长整数型:返回字符串的指针地址,失败返回0。
注意事项
- 返回的字符串指针需调用 FreeStringPtr 释放内存
