最大化、
点击最小化按钮前
运行模式下的iFIX(
点击最小化按钮后
运行模式下的iFIX(iFIXLE)画面最小化功能的实现效果02
答案是可以的。只要在画面中添加如下代码,即可实现。
【注】以下代码在Windows XP、Windows 7(32位/64位)测试通过
'Windows API函数引用声明
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
'常量声明
Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
'最小化画面函数
Public Sub MinimizePicture()
Dim hTaskbar, hStartbutton As Long
Dim sClass As String
hTaskbar = FindWindow("Shell_traywnd", "")
hStartbutton = FindWindowEx(hTaskbar, 0, "Button", vbNullString
Call SetWindowPos(hTaskbar, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_SHOWWINDOW)
ShowWindow hStartbutton, 5
CreateObject("Shell.Application").ToggleDesktop
End Sub
'最小化按钮Click事件
Private Sub bmpMinimize_Click()
MinimizePicture
End Sub