web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to detect maximize event in AX4 form

(0) ShareShare
ReportReport
Posted on by

Hi to everybody. 

I need to catch the event that is launched when I click in maximize (or minimize) button in any AX4.0 form. I have to write code after that (the event).

Is it possible?

Thanks a lot in advance.

Daniel.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,082 Most Valuable Professional on at

    I have an idea, but it would be quite low-level Win API development and you wouldn't be able to upgrade it to the latest version of AX, so it's questionable whether such an investment would make sense.

    What business problem are you trying to address by this solution?

  • Community Member Profile Picture
    on at

    Hi Martin! Thanks so much for answer.

    Ok. No problem about AX upgrade. I have to find a solution of this kind of "temporal" issue; however, I need the solution.

    My target is "easy" > I need to save width and height size of one important form for company when I click maximize button of this mentioned form. I know I have resize method in any form, but it's not enought for me. I have to detect the exact instant when I've maximized the form.

    Thanks again!

    Daniel.

  • Martin Dráb Profile Picture
    239,082 Most Valuable Professional on at

    Aren't the dimensions already stored somewhere? If you "in-maximize" a window, doesn't it return to the previous dimensions?

  • Community Member Profile Picture
    on at

    Yes.

    I can store the dimensions in any "resize" event. My company wants the next thing: when I "in-maximize" the form (thanks, I'm looking for the expression for this action in English) after form in maximized status, they want that form get the minimum size (for example), 300x200.

    More clear >

    1) When I maximize that form, I want to store a "flag" that indicates the form is maximized.

    2) After that, if I in-maximize the form (not minimize, be careful), we need to re-size the form to, for example, 300x200 pixels. Company requierents.

    Because that, I need to "catch" the event when I in-maximize the form in order to write X++ code to re-size the form.

    Thank you for your patient!

    Daniel.

  • Martin Dráb Profile Picture
    239,082 Most Valuable Professional on at

    Well, I intended to write "un-maximize"; "in-" was a typo. :-) The official term is "restored", I believe.

    My understanding is that your logic applies if users maximize a window which is smaller than 300x200, right? Because otherwise the restored size will exceed the minimum and therefore you won't do anything. I wonder why they start with such a small form if they don't want it. Aren't you merely dealing with consequences of a problem that happen before (causing a form to become smaller than 300x200)?

    It might be sufficient to change the restored dimensions through SetWindowPlacement (this is a Win API function, not AX function); you don't have to do resizing by yourself.

  • Martin Dráb Profile Picture
    239,082 Most Valuable Professional on at

    Regarding the event detection, my understanding is that you could use SetWindowsHookEx to get notifications and you would look for WM_GETMINMAXINFO message. But I've never tried it, therefore I'm not sure if it works in AX. And I have no AX 4.0 environment, therefore I can't try it.

    As I mentioned, this is hacking at a low level of abstraction; the effort needed and risks involved may exceed benefits.

  • Community Member Profile Picture
    on at

    :) "un" > thanks! ; "restored" > Fantastic!

    300x200 > You're right in your doubts. This behaviour is so far respect AX style rules...

    SetWindowPlacemente > I'll take a look, thanks!

  • Community Member Profile Picture
    on at

    Umm... interesting.... I'll try this "tools". Thank you a lot a lot for your time. When I get any type of result, I will inform :)

    Daniel.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans