Private Declare Function CreateWindowEx Lib "user32" Alias "Createwindowexa" (ByVal DwE as Long, ByVal LpC as String, Byva L LpW as String, ByVal DwS as Long, ByVal x as Long, ByVal y as Long, ByVal NW as Long, ByVal NH as Long, ByVal HW as Long , ByVal HM as Long, ByVal HI as Long, LpP as any) as long
Private Const ws_child = &h40000000
Private Const ws_visible = &h10000000
Private Const Pbm_setpos = &h402
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd as Long, ByVal wmsg as Long, ByVal WP A s long, LP as any) as Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwms as Long)
Private Const Wm_settext = &HC
Dim Hwndpro as Long
Private Declare Sub initcommoncontrols Lib "ComCtl32" ()
Private Declare Function FindWindow Lib "user32" Alias "Findwindowa" (ByVal lpclassname as String, ByVal Lpwindowname as S Tring) as Long
Private Sub Userform_click ()
Dim hwnd&
hwnd = FindWindow ("Thunderdframe", me.caption) ' Get window handle
Dim I as Integer
Hwndpro = CreateWindowEx (0, "Msctls_progress32", "" "," ws_visible "Or" Ws_child "," Ten "," Max "), hwnd, 0&, Application.hi Nstance, 0&)
For i = 0 to 100
Sleep 20:doevents
SendMessage Hwndpro, Pbm_setpos, I, 0
SendMessage hwnd, Wm_settext, 0, ByVal CStr (i & "%")
Next
End Sub
Private Sub userform_initialize ()
InitCommonControls
End Sub