|
用Access调用画图打开一个图片让其最大化显示在前端不了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 SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long
'Sub test()
Dim hwnd As Long, thwnd As Long
Shell ("C:\Windows\system32\mspaint.exe D:\091611\桌面\报销清单+发票\报销清单+发票\1.jpg")
hwnd = FindWindow("MSPaintApp", "1.jpg - 画图") '得到句柄
ShowWindow hwnd, sw_show'
SendKeys "{ENTER}", True
SetForegroundWindow (hwnd)
End Sub
|
|