怎样用API使被最小化的窗口最大化并前置
1个回答
展开全部
代码如下:
Private Declare Function FindWindow Lib "user32 " Alias "FindWindowA"
(ByVal lpClassName As Any, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub MDIForm_Load()
Me.Caption = "test"
If App.PrevInstance = True Then
hwndCalc = FindWindow(0&, "测试")
ShowWindow hwndCalc, 9
hwndCalc = SetForegroundWindow(hwndCalc)
End
Else
Me.Caption = "测试"
'Form1.Show
'Form1.Top = 50
'Form1.Left = 50
End If
End Sub
Private Declare Function FindWindow Lib "user32 " Alias "FindWindowA"
(ByVal lpClassName As Any, ByVal lpWindowName As String) As Long
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Sub MDIForm_Load()
Me.Caption = "test"
If App.PrevInstance = True Then
hwndCalc = FindWindow(0&, "测试")
ShowWindow hwndCalc, 9
hwndCalc = SetForegroundWindow(hwndCalc)
End
Else
Me.Caption = "测试"
'Form1.Show
'Form1.Top = 50
'Form1.Left = 50
End If
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
上海华然企业咨询
2024-10-21 广告
2024-10-21 广告
上海华然企业咨询有限公司专注于AI与数据合规咨询服务。我们的核心团队来自头部互联网企业、红圈律所和专业安全服务机构。凭借深刻的AI产品理解、上百个AI产品的合规咨询和算法备案经验,为客户提供专业的算法备案、AI安全评估、数据出境等合规服务,...
点击进入详情页
本回答由上海华然企业咨询提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |