Office中国论坛/Access中国论坛

标题: 调用画图后让其最大化显示在前端的请教 [打印本页]

作者: 灰太郎    时间: 2024-1-12 16:20
标题: 调用画图后让其最大化显示在前端的请教
用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








欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3