Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Aug : How to use GetModuleInformation

www.cryer.info
Managed Newsgroup Archive

How to use GetModuleInformation

Subject:How to use GetModuleInformation
Posted by:"Tan" (kunw..@pd.jaring.my)
Date:Thu, 4 Aug 2005 19:33:38 +0800

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

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive