-
Nov 21st, 2000, 05:29 AM
#1
Thread Starter
Member
Is there API call for retrieving the state of a window(maximized,minimized) and how can I restore it to his
original size.
THANKS
-
Nov 21st, 2000, 07:14 AM
#2
Fanatic Member
Forms have a WindowState Property, I don't think you'll need to use the API for this one, heres a bit of demo code:
Code:
Private Sub Form_Resize()
If Form1.WindowState = vbMinimized Then
MsgBox "Hello"
Form1.WindowState = vbNormal
End If
End Sub
[Edited by crispin on 11-21-2000 at 07:17 AM]
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Nov 21st, 2000, 07:21 AM
#3
Thread Starter
Member
Thanks for the reply but I ask for this because I calling an activeX DLL that has a form within. I am calling this AXDLL troughout a shell I've build. Now, I want to be able to determin if the AXDLL I've called is minimized by the user or not.(this to maximize it if the user click's again on the button to call the AXDLL.
Thanks.
-
Nov 21st, 2000, 10:07 AM
#4
Ok, click on this link:
http://www.incognitasoftware.com/vbcomp.htm
and look at the NuAPIView 2.0 file. This is a custom api viewer that has updated dll links and is probably 10,000 times better than the MS one.
Download this, and the help file and lookup the "windowplacement" type declaration APIcall in the help file
-
Nov 21st, 2000, 03:31 PM
#5
Use the IsIconic and IsZoomed API functions.
Code:
Private Declare Function IsIconic Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function IsZoomed Lib "user32" (ByVal hwnd As Long) As Long
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 Sub Command1_Click()
Dim hApp As Long
hApp = FindWindowEx(0, 0, "Notepad", vbNullString)
If IsIconic(hApp) Then MsgBox "It's minimized"
If IsZoomed(hApp) Then MsgBox "It's maximized"
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
|