Results 1 to 4 of 4

Thread: SendMessage

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Liverpool, UK
    Posts
    64
    I've got some code that will use the SendMessage function to change the text within a text box on another application, i.e.

    SendMessage(tHandle, EM_REPLACESEL, CLng(1), text_to_send)

    Does anyone know if its possible to update a progress bar using a similar method ??

  2. #2
    Fanatic Member crispin's Avatar
    Join Date
    Aug 2000
    Location
    2 clicks west of a Quirkafleeg...Cornwall, England
    Posts
    754
    paste this code into a form with a progress bar on it, and set the scrolling to smooth, then repeatedly click the command button


    Private Const PBM_SETPOS = &H402
    Private Const PBM_DELTAPOS = &H403
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long



    Private Sub Command1_Click()
    Debug.Print SendMessage(ProgressBar1.hwnd, PBM_DELTAPOS, 50, 0)
    End Sub


    HTH
    Crispin
    VB6 ENT SP5
    VB.NET
    W2K ADV SVR SP3
    WWW.BLOCKSOFT.CO.UK

    [Microsoft Basic: 1976-2001, RIP]

  3. #3
    Addicted Member brookema's Avatar
    Join Date
    Jul 2002
    Location
    Washington DC
    Posts
    161
    What is the CLng(1) in this?

    SendMessage(tHandle, EM_REPLACESEL, CLng(1), text_to_send)

  4. #4
    Fanatic Member Kaverin's Avatar
    Join Date
    Oct 2000
    Posts
    930
    It specifies whether the change can be undone. Non zero allows for undo, 0 prevents it.
    I'm baaaack...
    VB5 Professional Edition, VC++ 6
    Using a 1 gHz Thunderbird, 256 mb RAM, 40 gb HD system with Win98se

    I feel special because I finally figured out how to loop midis: Post link
    I'm a fanatic too

Posting Permissions

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



Click Here to Expand Forum to Full Width