|
其实这个API真的没什么好封装的。。。不过既然楼主希望封装,那就随便封装下吧。
**如需改变弹出的信息,请在const部分修改相应的字符串。详细请参考附件(如果附件无法显示代码,请新建一个模块,把下面的代码贴上,再调用MsgboxTimeOut函数)
- Private Declare Function MessageBoxTimeout Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hwnd As Long, _
- ByVal lpText As String, _
- ByVal lpCaption As String, _
- ByVal wType As Long, _
- ByVal wlange As Long, _
- ByVal dwTimeout As Long) As Long
- Const strMessage As String = "按确定后3秒将运行追加查询123"
- Const strTitle As String = "测试窗体"
- Public Function MsgboxTimeOut(ByVal lngHwnd As Long, ByVal dwTimeout As Long)
- Dim lngMsg As Long
-
- If MessageBoxTimeout(lngHwnd, strMessage, strtile, vbInformation + vbYesNo, 0, dwTimeout) = 6 Then
- DoCmd.SetWarnings False
- DoCmd.OpenQuery "123查询"
- End If
-
- End Function
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|