Author Topic: GetWindowThreadProceddId  (Read 2734 times)

shankle

  • Member
  • ****
  • Posts: 868
GetWindowThreadProceddId
« on: September 27, 2019, 01:53:51 AM »
The 2nd parameter & the first letter of the parameter are giving
an error in GoAsm. Is it a "1", "l" or "i"?????????
Goasm I think is changing the letter.

Vortex

  • Member
  • *****
  • Posts: 2767
Re: GetWindowThreadProceddId
« Reply #1 on: September 27, 2019, 03:38:02 AM »
Hi shankle,

Here is a GetWindowThreadProcessId example for you. The application FindProcess queries the table of processes to find the executable DlgBox.exe :

Code: [Select]
EnumWndProc PROC hWnd:DWORD,lParam:DWORD

LOCAL pid:DWORD
   
    invoke  GetWindowThreadProcessId,hWnd,ADDR pid

    mov     edx,lParam
    mov     eax,DWORD PTR [edx]
    cmp     eax,pid
    je      @f
    mov     eax,1
    ret
@@:
    push    hWnd
    pop     DWORD PTR [edx]
    xor     eax,eax
    ret

EnumWndProc ENDP

shankle

  • Member
  • ****
  • Posts: 868
Re: GetWindowThreadProceddId
« Reply #2 on: September 27, 2019, 09:45:57 PM »
Thank you Vortex.
You are a life savor.