سفارش تبلیغ
صبا ویژن
.
آنکه در پاسخ دادن شتاب کند، پاسخ را درنیابد . [امام علی علیه السلام]
امروز: شنبه 103 اردیبهشت 1



Online backup storage and collaboration

پنج گیگ فضای رایگان+ یک گیگ لیچ رایگان

تابعی برای تبدیل Pid به hwnd

Private Const GW_HWNDNEXT = 2

Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

" Return the window handle for an instance handle.
Public Function PidTohWnd(ByVal target_pid As Long) As Long
Dim test_hwnd As Long
Dim test_pid As Long
Dim test_thread_id As Long

    " Get the first window handle.
    test_hwnd = FindWindow(ByVal 0&, ByVal 0&)

    " Loop until we find the target or we run out
    " of windows.
    Do While test_hwnd <> 0
        " See if this window has a parent. If not,
        " it is a top-level window.
        If GetParent(test_hwnd) = 0 Then
            " This is a top-level window. See if
            " it has the target instance handle.
            test_thread_id = GetWindowThreadProcessId(test_hwnd, test_pid)

            If test_pid = target_pid Then
                " This is the target.
                PidTohWnd = test_hwnd
                Exit Do
            End If
        End If

        " Examine the next window.
        test_hwnd = GetWindow(test_hwnd, GW_HWNDNEXT)
    Loop
End Function

دانلود



  • کلمات کلیدی : VB6، ProcessID to hWnd
  • نوشته شده توسط مهدی در یکشنبه 88/12/9 و ساعت 10:8 عصر | نظرات دیگران()
    لیست کل یادداشت های این وبلاگ
    Nod32 SN Finder v1.6
    تهیه نسخه بکاپ از دیتابیس نود 32 و بازگردانی
    وارد نمودن حروف فارسی بدون تغییر Keylayout
    VB Anticrack v1.5 Full
    نمایش کامل متن آیتم لیست باکس
    محدود نمودن ماوس
    باز کردن Regedit در مسیر دلخواه
    تغییر استایل کامند به فلات
    تغییرات در رجیستری توسط
    نحوه استفاده از Gif control
    NOD32 SN Finder v1.5
    [عناوین آرشیوشده]

    بالا

    طراح قالب: رضا امین زاده** پارسی بلاگ پیشرفته ترین سیستم مدیریت وبلاگ

    بالا