Example Code

function UnInjectModuleA(const hProcess: THandle; 
                        lpFullDLLName: PAnsiChar): BOOL; stdcall;

function UnInjectModuleW(const hProcess: THandle; 
                        lpFullDLLName: PWChar): BOOL; stdcall;

- UnInjects a library (DLL) in the specified target process
- Arg1 process handle or special system-wide flags (ALL_PROCESSES, RUNNING_PROCESSES, NEW_PROCESSES)
- Arg2 fully qualified path to the library (DLL) to be uninjected in the target process
// UnInjects a DLL in the calling process
var bResult: BOOL; begin bResult := UnInjectModuleW(GetCurrentProcess(), PWChar('C:\DLL.dll')); if (bResult) then ShowMessage('DLL uninjected successfully!') else ShowMessage('Failed to uninject DLL!'); end;