Find ProcessID from hWnd...?-VBForums
Results 1 to 7 of 7

Thread: Find ProcessID from hWnd...?

  1. #1

  2. #2
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    GetWindowThreadProcessId() ?

  3. #3

  4. #4
    Banned plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You might want to be careful, it has a high badger index...

  5. #5

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092
    VB Code:
    1. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, _
    2.                                                                 lpdwProcessId As Long) _
    3.                                                                 As Long
    4.  
    5. Private Sub Command1_Click()
    6. Dim lProcessID As Long
    7.  
    8.     Call GetWindowThreadProcessId(hwnd, lProcessID)
    9.     MsgBox lProcessID
    10.    
    11. End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7

    Thread Starter
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,633
    I was doing:
    VB Code:
    1. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, _
    2.                                                                 lpdwProcessId As Long) _
    3.                                                                 As Long
    4.  
    5. Private Sub Command1_Click()
    6. Dim lProcessID As Long
    7.  
    8.     lProcessID = GetWindowThreadProcessId(hwnd, ByVal 0&)
    9.     MsgBox lProcessID
    10.  
    11. End Sub
    Whhhhhhooooops

    Cheers....

    Plenderj...I now have a fully functional Client ----via API---> Client Connection -----via TCP/IP-----> Server Application



    Woka

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.