|
-
Feb 16th, 2002, 06:24 AM
#1
Thread Starter
Member
Minimized Application
Hi there,
With App.PrevInstance you come to know whether Instance of your application is running or not. But is there any way if your application's one instance is running and currently it is minimized and some one clicks on to same application exe icon then this minimize application should come to its normal state (unminimized).
In short is there any way to bring your minimized application to its normal state programmitically.
Thanx
-
Feb 16th, 2002, 09:19 AM
#2
VB Code:
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Private Function IsWindowMinimized(ByVal hwnd As Long) As Boolean
IsWindowMinimized = Not (IsIconic(hwnd) = 0&)
End Function
'To Find Out If The Window Is Minimized
Dim IsIt As Boolean
IsIt = IsWindowMinimized(Me.hwnd)
If IsIt = True Then 'application is minimized
Me.WindowState = vbNormal
End If
-
Feb 24th, 2002, 12:45 AM
#3
Thread Starter
Member
minimized app
Option Explicit
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Dim IsIt As Boolean
Private Function IsWindowMinimized(ByVal hwnd As Long) As Boolean
IsWindowMinimized = Not (IsIconic(hwnd) = 0&)
End Function
Private Sub Form_Load()
'To Find Out If The Window Is Minimized
If App.PrevInstance = True Then
MsgBox "Found another Instance"
IsIt = IsWindowMinimized(Me.hwnd)
If IsIt = True Then 'application is minimized
Me.WindowState = vbNormal
End If
End If
End Sub
Hi Hack,
Thanks for your assistance, but the above code when converted to an .exe and when I stated the 2nd instance of the application it gave me the message "Found another Instance" and the minimized application was as it is in the task bar and the new instance of the application was created. So 2 instance of the application was running on the same PC. Looking for further assistance.
Originally posted by Hack
VB Code:
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Private Function IsWindowMinimized(ByVal hwnd As Long) As Boolean
IsWindowMinimized = Not (IsIconic(hwnd) = 0&)
End Function
'To Find Out If The Window Is Minimized
Dim IsIt As Boolean
IsIt = IsWindowMinimized(Me.hwnd)
If IsIt = True Then 'application is minimized
Me.WindowState = vbNormal
End If
-
Feb 24th, 2002, 03:06 PM
#4
Frenzied Member
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
|