Are you using InfoPath 2003 or 2007? I set the InfoPath application caption bar in IP 2003 with this:
thisApplication.ActiveWindow.Caption = "What I want the caption to be";
So, I'd guess that you'd be able to get with it something like this:
thisApplication.ActiveWindow.Caption.ToString();
Is the caption at the top of the window what you mean by the 'state bar'?