-
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 ??
-
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
-
What is the CLng(1) in this?
SendMessage(tHandle, EM_REPLACESEL, CLng(1), text_to_send)
-
It specifies whether the change can be undone. Non zero allows for undo, 0 prevents it.