Need help, Someting wrong but I do not know where is the problen.
hwnd := FindWindow(Nil, Pchar(EditFormName.Text));
If (hwnd = 0) Then
ShowMessage('Window not found!')
Else
Begin
GetWindowThreadProcessId(hwnd, pid);
hwnd :=OpenProcess(PROCESS_ALL_ACCESS, False, pid);
If GetModuleFileNameExA(hwnd, 0, PIDName, SizeOf(PIDName)) > 0
Then
Begin
Edit1.Text:=PIDName;
if EnumProcessModules(hwnd, @hModule, SizeOf(hModule),
Size) Then
Begin
If
GetModuleInformation(hwnd,hModule,lpmodinfo,Sizeof(lpmodinfo)) Then
Begin
.........................;
End
Else
Begin
ShowError;---->($7A) The data area
passed to a system call is too small
........................;
End;
End;
End
Else
ShowError;
End;
CloseHandle(hwnd);
($7A) The data area passed to a system call is too small
Regards
Tan