News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

GetWindowThreadProceddId

Started by shankle, September 27, 2019, 01:53:51 AM

Previous topic - Next topic

shankle

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

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

shankle

Thank you Vortex.
You are a life savor.