|
-
Sep 15th, 2000, 11:29 AM
#1
Does anyone know how to maximise an application that has been minimised to the taskbar.
The program is started using:
Shell("<program", bvnormalfocus)
so I have the PID so i can give the application focus, but it doesn't maximise.
-
Sep 15th, 2000, 02:04 PM
#2
Do you know the program?
Code:
Declare Function ShowWindow Lib "User32" (ByVal Hwnd _
As Long, ByVal nCmdShow As Long) As Long
Public Const SW_MAXIMIZE = 3
maxi = ShowWindow(Hwnd, SW_MAXIMIZE)
Use the FindWindow api function to find the window's hwnd.
Code:
Private Declare Function FindWindow Lib "user32.dll" _
Alias "FindWindowA" (ByVal lpClassName As Any, ByVal _
lpWindowName As Any) As Long
h = FindWindow(vbNullString, "Window's caption")
If h <> 0 Then
maxi = ShowWindow(h, SW_MAXIMIZE)
Else
MsgBox "Window was not found!", 16
End If
-
Sep 15th, 2000, 02:50 PM
#3
Use the OpenIcon() function.
Code:
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 OpenIcon Lib "user32" (ByVal hwnd As Long) As Long
Private Sub Command1_Click()
Dim hApp As Long
'Get the hWnd of the window
hApp = FindWindowEx(0, 0, "SciCalc", "Calculator")
'Restore the window
If hApp <> 0 Then OpenIcon hApp
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|