Thanks Zaf and SonGouki(Dan)!
I appreciate your help.
Dan, you sure did the job.
BTW... What does "SetWindowPlacement" do?
Here is the code for those who needs to maximize a foreign application when it is minimized. Give the credit to SonGouki.
Code:Option Explicit 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 Const SW_HIDE As Long = 0 Private Const SW_SHOWNORMAL As Long = 1 Private Const SW_SHOWMINIMIZED As Long = 2 Private Const SW_SHOWMAXIMIZED As Long = 3 Private Const SW_SHOWNOACTIVATE As Long = 4 Private Const SW_SHOW As Long = 5 Private Const SW_MINIMIZE As Long = 6 Private Const SW_SHOWMINNOACTIVE As Long = 7 Private Const SW_SHOWNA As Long = 8 Private Const SW_RESTORE As Long = 9 Private Const SW_SHOWDEFAULT As Long = 10 Sub Main() Dim lng_A As Long lng_A = FindWindow("NotePad", vbNullString) Call ShowWindow(lng_A, SW_SHOWMAXIMIZED) End Sub




Reply With Quote