Jump to content
Fórum Script Brasil
  • 0

Api Para Enviar Strings


Unnamed

Question

3 answers to this question

Recommended Posts

  • 0

Sim, você tem usar junto com a FindWindow (para achar uma janela) e a FindWindowEx (para achar uma textbox, por exemplo). E tem uma constante sim, a WM_SETTEXT para o caso da textbox. Segue a declaração das três:

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Public Const WM_SETTEXT = &HC
Você pode criar um form só com uma textbox e usar o exemplo abaixo em outro programa para se comunicar com o primeiro (que só tem a textbox):
hWindow = FindWindow(vbNullString, "TÍTULODOPROGRAMA")
hTextBox = FindWindowEx(hWindow, ByVal 0&, vbNullString, vbNullString)
SendMessage hTextBox, WM_SETTEXT, ByVal 0&, vbNullString
SendMessage hTextBox, WM_SETTEXT, ByVal 0&, msg

Ok?

PS: Na DLL que eu falei, isso está implementado exatamente desse jeito.

Abraços,

Graymalkin

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...