|
-
Sep 26th, 2000, 05:50 PM
#1
Thread Starter
_______
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 26th, 2000, 06:10 PM
#2
Put the following in a Form with a Timer
Code:
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If Me.WindowState = 2 Then 'It's Maximized
If Me.WindowState = 1 Then 'It's Minimized
If Me.WindowState = 0 Then 'It's Normal
End Sub
-
Sep 26th, 2000, 07:50 PM
#3
New Member
Wrong Idea
That would work great if was in the same form or project. My program is changing the resolution of the monitor, then running an exe through shell. I need to keep track of the window the exe is running in so if the user minimize the exe window the resolution would change back to the orginal settings.
-
Sep 26th, 2000, 11:18 PM
#4
Hyperactive Member
-
Sep 26th, 2000, 11:30 PM
#5
Hyperactive Member
try this code.........
paste this code into a form named form1. It will tell u if the form is maximised or not. To find out if any other window is maximised or not, replace Form1.hwnd with the handle of that window.
Hope this helps.
Code:
Const WS_MAXIMIZE = &H1000000
Const GWL_STYLE = -16
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Sub Command1_Click()
Dim Retval As Long
Dim res
Retval = GetWindowLong(Form1.hwnd, GWL_STYLE)
If (Retval And WS_MAXIMIZE) = WS_MAXIMIZE Then
Debug.Print "Form1 is maximized."
Else
Debug.Print "Form1 is not maximized."
End If
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
|