More options for DoCommand - Maximize and Restore

Posted by Cino on Tue 04 Jul 2006 10:27 AM — 3 posts, 18,898 views.

Australia #0
Do such options already exist that have the same effect?

I am primarily interested in being able to have a macro that toggles between the maximized state and regular state of a world window, and hence, the rest of the MDI children.

Something like alt+m which would send
/if maximized then
   DoCommand("Restore")
else
   DoCommand("Maximize")
end

Though I do not know how to check for the maximized state, since I open maximized, it is not hard to track in a variable.

I understand this is somewhat achievable using the MDI keyboard shortcuts, like alt+- and then r to restore, and alt+- and then x to maximize, but they seem a bit cumbersome. Perhaps instead, is it possible to just put these into a macro?
USA #1
Hmm.. Well, technically you could, in languages that support it, which Lua and Python could with the right setups, use the user32.dll API function "GetWindowPlacement". You can also use "SetWindowPlacement" to define max/min states. Likely some things like wxPython and wxLua support these already as part of their window management setups, but those do not come installed with the standard script systems, they have to be added. Python may already include some limited features in this set, but Lua doesn't, as near as I can tell.

It may be easier to support it internally in Mushclient than rely on addon libraries that a) are not available for all languages and b) don't come pre-installed as part of any of them.
Australia Forum Administrator #2
These two DoCommand options are now available in version 3.75.