Results 1 to 7 of 7
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Does IsZoomed Work? (VBA in Office 97)

    In WinXP Pro... I am trying to use the IsZoomed API to determine if the current window (form or report) is maximized or restored. However, when I call it in the click event of a button on a test form it always returns False no matter which view I have the form displayed in. I'm using "Me.Hwnd" as the arg for the call.

    Any ideas why it isn't working for me? When is it supposed to return True, when the window is maximized or when it is restored?

    Thanks,
    Bill

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Does IsZoomed Work? (VBA in Office 97)

    IsZoomed is supposed to return 1, not True = -1 if the window is maximized. So if you test for
    IsZoomed(hWnd) = True
    it will never happen.

    There might be differences between versions of Windows. I remember having some code using IsZoomed that works on NT4 but not on Win95.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Does IsZoomed Work? (VBA in Office 97)

    Thanks HansV, checking for 1 does solve my problem. I ran into IsZoomed in someone else's code in a message and I missed the fact that they were checking for 1 instead of True or False. I don't have any documentation on that API function, or any others, and I didn't stop to think that True & False values in Access probably aren

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Does IsZoomed Work? (VBA in Office 97)

    Bill,

    Try All API Net, a good resource for the Windows API, and with some good downloads, such as API Guide and API Viewer.

    Andrew C

  5. #5
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Does IsZoomed Work? (VBA in Office 97)

    Andrew,

    That looks like a very useful site. I've added it to my favorites list.

    Thanks,
    Bill

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Does IsZoomed Work? (VBA in Office 97)

    Download the API-Guide and install it on your machine. I use it all the time, having given up on the Windows API Viewer long ago. The nicest part is having examples to copy and modify.
    Charlotte

  7. #7
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Does IsZoomed Work? (VBA in Office 97)

    Charlotte,

    I've just done that. Thanks for suggesting it.

    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •