When I'm working, I want to be able to maximize or restore a window. But I only want to use one shortcut key to do it. I am currently using the below code to perform the function of maximizing. However, if the window is already maximized, this won't 'restore' the window.
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys "% x"
I guess I'm thinking of code like this:
if window state=Maximized
then Restore
else Maximize
This logic will 'maximize' the window if it isn't and 'restore' it if it is.
Thanks.
PS: Extra points if you skip the whole SendKeys thing and go straight to native commands.