نمایش نتایج 1 تا 5 از 5

نام تاپیک: Send Message To Active Windows in Yahoo Chat

  1. #1

    Send Message To Active Windows in Yahoo Chat

    سلام خسته نباشید
    چطوری میشه Windows Activeرا در چت پیدا کرد و یک پیغام برای اون فرستاد ؟
    من می خواهم یک برنامه بنویسم که Emoticons ها رو در دسترس کاربر بزاره و با کلیک کردن بر روی اونها کد اون ایکون رو برای پنجره فعال yahoo بفرسته
    لطفا منو راهنمایی کنید
    :oops:

  2. #2

    'In your form
    Option Explicit

    Private Sub Form_Load()
    '
    Dim hwnds() As Long
    Dim h As Long
    Dim i As Byte

    Call FindWindowLike(hwnds(), 0, "*Instant Message*", "*", Null)

    For i = 0 To UBound(hwnds)
    If hwnds(i) <> 0 Then
    h = FindWindowEx(hwnds(i), 0, "RICHEDIT", "")
    Call SendMessage(h, WM_SETTEXT, 0, ByVal "test")
    Exit For
    End If
    Next
    '
    End Sub





    'In a module
    Option Explicit

    Private Const GWL_ID = (-12)
    Global ProgHandle As Long

    Private Const GW_HWNDNEXT = 2
    Private Const GW_CHILD = 5
    Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
    Public Const WM_SETTEXT = &HC

    Declare Function SetFocusAPI Lib "user32" Alias "SetForegroundWindow" _
    (ByVal hwnd As Long) As Long

    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, _
    ByVal wCmd As Long) As Long

    Private Declare Function GetWindowLW Lib "user32" Alias "GetWindowLongA" _
    (ByVal hwnd As Long, ByVal nIndex As Long) As Long

    Private Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long

    Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" _
    (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

    Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
    (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

    Declare Function GetDesktopWindow Lib "user32" () As Long

    Declare Function GetExitCodeProcess Lib "kernel32" _
    (ByVal hProcess As Long, lpExitCode As Long) As Long

    Declare Function OpenProcess Lib "kernel32" _
    (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _
    ByVal dwProcessId As Long) As Long

    Declare Function CloseHandle Lib "kernel32" _
    (ByVal hObject As Long) As Long

    Declare Function SysSetFocus Lib "user32" Alias "SetFocus" _
    (ByVal hwnd As Long) As Long
    Public Const WM_COMMAND As Long = &H111

    Function FindWindowLike(hWndArray() As Long, ByVal hWndStart As Long, WindowText As String, Classname As String, ID) As Long
    Dim hwnd As Long
    Dim r As Long
    ' Hold the level of recursion:
    Static level As Long
    ' Hold the number of matching windows:
    Static iFound As Long
    Dim sWindowText As String
    Dim sClassname As String
    Dim sID
    ' Initialize if necessary:
    If level = 0 Then
    iFound = 0
    ReDim hWndArray(0 To 0)
    If hWndStart = 0 Then hWndStart = GetDesktopWindow()
    End If
    ' Increase recursion counter:
    level = level + 1
    ' Get first child window:
    hwnd = GetWindow(hWndStart, GW_CHILD)
    Do Until hwnd = 0
    DoEvents ' Not necessary
    ' Search children by recursion:
    r = FindWindowLike(hWndArray(), hwnd, WindowText, Classname, ID)
    ' Get the window text and class name:
    sWindowText = Space(255)
    r = GetWindowText(hwnd, sWindowText, 255)
    sWindowText = Left(sWindowText, r)
    sClassname = Space(255)
    r = GetClassName(hwnd, sClassname, 255)
    sClassname = Left(sClassname, r)
    ' If window is a child get the ID:
    If GetParent(hwnd) <> 0 Then
    r = GetWindowLW(hwnd, GWL_ID)
    sID = CLng("&H" & Hex(r))
    Else
    sID = Null
    End If
    ' Check that window matches the search parameters:
    If sWindowText Like WindowText And sClassname Like Classname Then
    If IsNull(ID) Then
    ' If find a match, increment counter and
    ' add handle to array:
    iFound = iFound + 1
    ReDim Preserve hWndArray(0 To iFound)
    hWndArray(iFound) = hwnd
    ElseIf Not IsNull(sID) Then
    If CLng(sID) = CLng(ID) Then
    ' If find a match increment counter and
    ' add handle to array:
    iFound = iFound + 1
    ReDim Preserve hWndArray(0 To iFound)
    hWndArray(iFound) = hwnd
    End If
    End If
    End If
    ' Get next child window:
    hwnd = GetWindow(hwnd, GW_HWNDNEXT)
    Loop
    ' Decrement recursion counter:
    level = level - 1
    ' Return the number of windows found:
    FindWindowLike = iFound
    End Function




  3. #3

    این بهتر نیست ؟

    سلام
    مرسی خیلی ممنون از راهنماییت
    اما من این کد رو نوشتم ببینید راحتتر و بهتر نیست ؟
    اگه وقت کردین کاملش کنید
    مشکلش اینه که اگه طرف قبلا چیزی تایپ کرده باشه تو چت اونو پاک میکنه ؟!
    بازهم از کمکت متشکرم Azish جان

  4. #4
    من یه Yahoo Booter نوشتم توپ توپه ..... حالشو ببری !!!

  5. #5
    کاربر دائمی
    تاریخ عضویت
    مرداد 1382
    محل زندگی
    استان فارس
    پست
    1,054
    می تونی سورسش رو به من بدی؟

تاپیک های مشابه

  1. کار با Webcam و تابع Send message
    نوشته شده توسط مهیار کرمی در بخش برنامه نویسی در 6 VB
    پاسخ: 0
    آخرین پست: شنبه 23 تیر 1386, 19:30 عصر
  2. مشکل با Send consol message
    نوشته شده توسط mehdi58 در بخش شبکه و Networking‌
    پاسخ: 4
    آخرین پست: یک شنبه 18 تیر 1385, 13:28 عصر
  3. send Windows Message
    نوشته شده توسط ESG_Esfahan در بخش C#‎‎
    پاسخ: 6
    آخرین پست: شنبه 16 اردیبهشت 1385, 23:12 عصر
  4. tapi and send message
    نوشته شده توسط janatan در بخش VB.NET
    پاسخ: 1
    آخرین پست: دوشنبه 20 تیر 1384, 00:18 صبح

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •