Separation bar in Windows is a widely used control, which is used by most Explorer-style applications. However, there is very little relevant information about its complete implementation, So I implemented it myself, hoping to help SDK enthusiasts.
In fact, the separator is also a very common window, it also has its own window class, its own window process-just like all the predefined controls. That is to say, to create a separator, you also need to register the window class and create a window.
The following is the registration window class code
Void RegisterSplitter (void)
{
WNDCLASS wc;
Wc. cbClsExtra = 0;
Wc. cbWndExtra = 0;
Wc. hbrBackground = (HBRUSH) COLOR_BTNSHADOW;
Wc. hCursor = LoadCursor (NULL, IDC_SIZEWE );
Wc. hIcon = NULL;
Wc. hInstance = hInst;
Wc. lpfnWndProc = (WNDPROC) ProcSplitter; // This is a window process. For the CWnd class of MFC, what is the process?
Wc. lpszClassName = "MySplitter haha ";
Wc. lpszMenuName = NULL;
Wc. style = 0;
RegisterClass (& wc );
}
20051028