Detect if window is split

Many times it is necessary to know whether a view is currently split or not. This method will return TRUE if the view is split and FALSE if it is not. NOTE: It does NOT detect multiple views, so don't use it to determine whether UpdateAllViews should be called!
int CMySplitterView::IsSplit(void)
{
	CSplitterWnd * parent;
	parent = (CSplitterWnd*)GetParent();
	int rows;
	rows = parent->GetRowCount();
	if(rows>1)
	{
		return(TRUE);
	}
	int cols;
	cols = parent->GetColumnCount();
	if(cols>1)
	{
		return(TRUE);
	}
	return(FALSE);
}



Comments

  • A little problem

    Posted by Legacy on 11/24/2002 12:00am

    Originally posted by: LuoJg

    I used this function in SDI. I didn't split it.
    but I got" rows = 0, cols = 1598738480." I don't know what's wrong?

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • It's hardly surprising that half of small businesses fail within the first 1-5 years. It's not easy to launch a new product, single-handedly manage everything from IT to accounting, fend off the competition, and grow a customer base – all at the same time – even with a great concept. Offering awesome customer service can make the difference between a startup that flies and a startup that dies. Read this white paper to learn nine ways customer support can help you beat the competition and grow your …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds