The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: shankle on September 27, 2019, 01:53:51 AM

Title: GetWindowThreadProceddId
Post by: shankle 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.
Title: Re: GetWindowThreadProceddId
Post by: Vortex 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 :

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
Title: Re: GetWindowThreadProceddId
Post by: shankle on September 27, 2019, 09:45:57 PM
Thank you Vortex.
You are a life savor.