to come into touch with all the brilliant components I tried to inject a simple DLL into Notepad. Here is small code:
Code: Select all
InjectLibrary(FindWindow('notepad',nil),'MsgBox.dll');
Hope you can help me
Greetings,
Crocotronic
Code: Select all
InjectLibrary(FindWindow('notepad',nil),'MsgBox.dll');
Code: Select all
var
Wnd: HWND;
dwPID: DWORD;
hProcess: THandle;
begin
Wnd := FindWindowW('notepad', nil);
GetWindowThreadProcessId(Wnd, dwPID);
hProcess := OpenProcess(MAXIMUM_ALLOWED, False, dwPID);
if hProcess <> 0 then
begin
InjectLibrary(hProcess, 'Inject.dll');
CloseHandle(hProcess);
end;
end;