See attached. Takes a window handle (returned by WinGetHandle) of the process into which the dll will be injected and a string path to the dll that will be injected.
Example:
$ret = _InjectDll(WinGetHandle("Calculator"), "c:\testdll.dll")
$err = @error
If $err < 0 Then
MsgBox(16, $ret, $err)
Else
MsgBox(64, $ret, "YUP!")
EndIf_InjectDll.au3