怎样用API使被最小化的窗口最大化并前置
答案:1 悬赏:0 手机版
解决时间 2021-02-24 20:43
- 提问者网友:沉默菋噵
- 2021-02-24 14:59
怎样用API使被最小化的窗口最大化并前置
最佳答案
- 五星知识达人网友:十鸦
- 2021-02-24 15:25
代码如下:
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
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯