Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA"
(ByVal dwE As Long, ByVal lpC As String, ByVal 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 As 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 String) As
Long
Private Sub UserForm_Click()
Dim hwnd&
hwnd =
FindWindow("ThunderDFrame", Me.Caption) ‘获取窗口句柄
Dim i As
Integer
hwndPro = CreateWindowEx(0, "msctls_progress32",
"", WS_VISIBLE Or WS_CHILD, 10, 10, 200, 20, hwnd, 0&,
Application.Hinstance, 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
相关文章
- 04-13Salesforce LWC学习(三十五) 使用 REST API实现不写Apex的批量创建/更新数据
- 04-13IDEA+SpringBoot整合Swagger2创建API文档
- 04-13android – 使用telegram bot api创建简单的聊天
- 04-13[WinAPI] API 11 [创建目录]
- 04-13使用Composition API在Vue3中创建防抖搜索输入框
- 04-13快速创建Flask Restful API项目
- 04-13通过azkaban的API链接azkaban服务器,并创建工作流
- 04-131.18.2.8与DataStream和DataSet API结合,Scala隐式转换,通过DataSet或DataStream创建视图,将DataStream或DataSet转换成表 等
- 04-13[osgearth]通过API创建一个earth模型
- 04-13SAP API management portal - 如何创建API provider