If it always returns 3 or 1, then thats got to be what Windows is reporting it as.
I got this in my debug window when testing:
code:
Script has been stopped
Script is starting
Script is now loaded and ready
> .showCmd : 1
> .showCmd : Opened
Script has been stopped
Script is starting
Script is now loaded and ready
> .showCmd : 3
> .showCmd : Maximized
Script has been stopped
Script is starting
Script is now loaded and ready
> .showCmd : 2
> .showCmd : Minimized
The function works fine (except the var in the above codes you have posted is called WindowPlacment not WindowPlac
ement)
EDIT: This also mean the if statement I suggested would work (except for if it encountered an error and returned 0)