ACCESS程序编完使用时,隐去ACCESS主窗口,象VB一样,这样也可防止其他人在主窗口改动程序,看起来又美观!!!! 1.建立如下函數 Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long Dim dwReturn As Long Const SW_HIDE = 0 Const SW_SHOWNORMAL = 1 Const SW_SHOWMINIMIZED = 2 Const SW_SHOWMAXIMIZED = 3 Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _ ByVal nCmdShow As Long) As Long Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean If Procedure = "Hide" Then dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE) End If If Procedure = "Show" Then dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED) End If If Procedure = "Minimize" Then dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED) End If If SwitchStatus = True Then If IsWindowVisible(hWndAccessApp) = 1 Then dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE) Else dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED) End If End If If StatusCheck = True Then If IsWindowVisible(hWndAccessApp) = 0 Then fAccessWindow = False End If If IsWindowVisible(hWndAccessApp) = 1 Then fAccessWindow = True End If End If End Function 2.按如下方法調用 fAccessWindow ("Hide",False, False) |
|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )
GMT+8, 2024-3-29 17:41 , Processed in 0.095003 second(s), 23 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.