Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
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.
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?
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.
Aren't the dimensions already stored somewhere? If you "in-maximize" a window, doesn't it return to the previous dimensions?
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!
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.
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.
:) "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!
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 :)
Business Applications communities