The above code is for changing the size of an already-open window.
If what you want is to open the window in your requested size in the first place, you can either edit the win-size line in your Config.prc file, or you can embed this into your program as described in this thread.