Why don't you have your code unsplit the window before it runs, and thenresplit it after your code is finished?