• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

Question about CSplitterWnd !

Hi,

How can I know the coordinates rectangle of the splitter bar and not the splitter window ?

What I want to do, is to change the cursor if the mouse is over this bar.

When I use mysplit->GetClientRect or mysplit->GetWindowRect, it returns me the coordinates of the splitter window.

Thanks in advance.
0
mike_marquet
Asked:
mike_marquet
  • 2
1 Solution
 
migelCommented:
Hi!
derive your own class from CSplitterWnd
and override this method:
virtual void SetSplitCursor(int ht);
where ht is hit test codes:
MS doesn`t publish this in the header (why???) only in sources so here it is:

// HitTest return values (values and spacing between values is important)
enum HitTestValue
{
     noHit                   = 0,
     vSplitterBox            = 1,
     hSplitterBox            = 2,
     bothSplitterBox         = 3,        // just for keyboard
     vSplitterBar1           = 101,
     vSplitterBar15          = 115,
     hSplitterBar1           = 201,
     hSplitterBar15          = 215,
     splitterIntersection1   = 301,
     splitterIntersection225 = 525
};

so catch vSplitterBox and hSplitter box and set cursour you need
0
 
ShaunWildeCommented:
what you need to do to change the cursor is handle OnSetCursor

see http://www.codetools.com/splitter/usefulsplitter.asp for an example
0
 
ShaunWildeCommented:
what you need to do to change the cursor is handle OnSetCursor

see http://www.codetools.com/splitter/usefulsplitter.asp for an example
0
 
mike_marquetAuthor Commented:
Good undocumented function but when I use lockable splitters, the code is ever 0.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now