遍历进程并获取进程路径 - 回复 "编程少年" 的问题
摘要:代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Memo1: TM...
阅读全文
posted @
2008-12-22 22:48
万一
阅读(6070)
推荐(0) 编辑
根据窗口句柄获取所在程序路径 - 回复 "Haiwen" 的问题
摘要:问题来源: http://www.cnblogs.com/del/archive/2008/07/30/1255869.html#1272342 本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dia...
阅读全文
posted @
2008-07-30 17:35
万一
阅读(8748)
推荐(0) 编辑
WinAPI: GetModuleFileName、GetModuleHandle
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure FormCr...
阅读全文
posted @
2008-06-17 11:40
万一
阅读(9412)
推荐(0) 编辑
WinAPI: GetModuleHandle - 获取一个模块(exe 或 dll)的句柄
摘要:定义: GetModuleHandle( lpModuleName: PChar {模块名; 只能是映射到当前进程的模块} ): HMODULE; {返回模块句柄; 0 表示失败} 举例: //获取当前模块的句柄 var s: string; h: Cardinal; begin {先取得模块名} s := Application.ExeName;...
阅读全文
posted @
2008-04-01 13:48
万一
阅读(25163)
推荐(0) 编辑
WinAPI: OpenProcess、GetExitCodeProcess、TerminateProcess (测试强制关闭 OICQ)
摘要://声明: {返回进程的句柄} OpenProcess( dwDesiredAccess: DWORD; {访问选项} bInheritHandle: BOOL; {能否继承; True 表示能用 CreateProcess 继承句柄创建新进程} dwProcessId: DWORD {指定进程 ID} ): THandle; {成...
阅读全文
posted @
2008-03-10 12:19
万一
阅读(18413)
推荐(0) 编辑
WinAPI: GetWindowThreadProcessId - 获取指定窗口的进程 ID 或线程 ID
摘要://声明: GetWindowThreadProcessId( hWnd: HWND; {指定窗口句柄} lpdwProcessId: Pointer = nil {返回进程 ID 的指针} ): DWORD; {返回线程 ID} //举例: unit Unit1; interface uses Wi...
阅读全文
posted @
2008-03-10 11:59
万一
阅读(18097)
推荐(0) 编辑
WinAPI: GetCurrentThread、GetCurrentThreadId、GetCurrentProcess、GetCurrentProcessId
摘要:{返回当前线程的虚拟句柄} GetCurrentThread: THandle; {返回当前线程 ID} GetCurrentThreadId: DWORD; {返回当前进程的虚拟句柄} GetCurrentProcess: THandle; {返回当前进程 ID} GetCurrentProcessId: DWORD; 提示: ID 是系统唯一的标识. 所谓虚拟句柄, 就是该句柄只...
阅读全文
posted @
2008-03-10 10:43
万一
阅读(19914)
推荐(0) 编辑
WinAPI: LoadLibrary、FreeLibrary - 载入与载卸模块
摘要://声明: LoadLibrary( {将可执行模块映射到调用进程的地址空间} lpLibFileName: PChar {DLL 或 EXE 文件名; 如没指定路径会按以下顺序查找: 程序目录/当前目录/System32/Windows/PATH环境变量} ): HMODULE; {返回模块句柄} FreeLibrary( hLibModul...
阅读全文
posted @
2008-02-15 23:04
万一
阅读(5472)
推荐(0) 编辑
WinAPI: ShellExecute - 打开外部程序或文件
摘要:ShellExecute( hWnd: HWND; {指定父窗口句柄} Operation: PChar; {指定动作, 譬如: open、print} FileName: PChar; {指定要打开的文件或程序} Parameters: PChar; {给要打开的程序指定参数; 如果打开的是文件这里应该是 nil} Directory: PChar; ...
阅读全文
posted @
2008-02-13 21:59
万一
阅读(47088)
推荐(3) 编辑
WinAPI: WinExec - 运行外部程序
摘要://声明 WinExec( lpCmdLine: LPCSTR; {文件名和参数; 如没指定路径会按以下顺序查找: 程序目录/当前目录/System32/Windows/PATH环境变量} uCmdShow: UINT {启动选项} ): UINT; //返回值: 大于 31 {调用成功} 等于 0 ...
阅读全文
posted @
2008-02-13 14:14
万一
阅读(20806)
推荐(1) 编辑