Changing window bounds in plug-in

Is there a way to change the bounds of a window in a plug-in?

I am opening a new window and hiding the sidebar, but I also want to reduce the width of the window.