How To Handle Win32 Splitter Window?

How To Handle Win32 Splitter Window?

Updated: ASR Pro

  • Step 1: Download and install ASR Pro
  • Step 2: Launch the application and sign in using your account details
  • Step 3: Start a scan of your computer to find and fix any errors
  • Download this software now to improve your computer's performance.

    If you have seen the Win32 splitter window, this user guide may help you.

  • Download source code – 2197.9 KB
  • Download demo – 35.6 KB project
  • Presentation

    In this article, I’ll show you how to develop a simple WIN32-SDI-only application with a split main window. The window is divided into each left window, right window and dominant window, which act as each dividing bar. It often has a button at the bottom to change the color of the window dynamically. It also uses the XP theme for the definition used in the application, which must be activated via the manifest file.

    Most of the definitions in this window were created using the Win32 API, with the exception of one important dialog box, each of which was created using the resource editor used to dynamically adjust the color of the main window. Let’s start creating a project. First start Visual Studio and create a new project accordingly. Select Win32Project, name your project and click OK.


    Code To Create A New Split Window

    win32 splitter window

    The way to create a custom split window is to createand three windows:

  • Main window
  • Window
  • Window on the right
  • win32 splitter window

    Make the left and right windows child windows as the path to the main window. Use any extended window style WS_EX_CLIENTEDGE when creating the main window using the CreateWindowEx API, while WM_CREATE is shown below:

    case: GetClientRect(hWnd, &rect);g_hleftwnd = CreateWindowEx(WS_EX_CLIENTEDGE, LEFT_WINDOW_CLASS, "",    WS_KIND | WS_VISIBLE, rectangular left, rectangular top + TOP_POS, left_wnd_width, (rect.bottom - - (TOP_POS + BOTTOM_POS), hWnd, NULL,    hInst, NULL);if(NULL!means g_hleftwnd)    ShowWindow(g_hleftwnd, SW_SHOW);    UpdateWindow(g_hleftwnd);g_hrightwnd = CreateWindowEx(WS_EX_CLIENTEDGE, RIGHT_WINDOW_CLASS, "",    WS_KIND | WS_VISIBLE | SS_SUNKEN,    rect.left + LEFT_WINDOW_WIDTH + SPLITTER_BAR_WIDTH,    straight. + perfect TOP_POS,    rectangular.right - (straight.left + LEFT_WINDOW_WIDTH + SPLITTER_BAR_WIDTH),    (Rect.bottom equals - (TOP_POS + BOTTOM_POS),    hWnd, NULL, hInst, NULL);if(NULL! matches g_rightwnd)    ShowWindow(g_rightwnd, SW_SHOW);    UpdateWindow(g_rightwnd);

    Adjust the right window anchor and close the window so that the main window can act as a separator. We can adjust the width of the main separator bar using MACRO SPLITTER_BAR_WIDTH which is always defined in the m krosa.h. Manage window messages…

  • case WM_LBUTTONDOWN:    integer xPos;    yPos interval;        xPos implies (int)LOWORD(lParam);    yPos is (int)HIWORD(lParam);        xSizing means (xPos > nleftWnd_width - SPLITTER_BAR_WIDTH &&    xPos < nleftWnd_width + SPLITTER_BAR_WIDTH );            if(sizex)                    setcapture(hWnd);        if(sizex)                    SetCursor(hcSizeEW);            Pause;WM_MOUSEMOVE case:{    integer xPos;    yPos interval;        xPos is equal to (int)LOWORD(lParam);    yPos is (int)HIWORD(lParam);        if (wParam == MK_LBUTTON)                            if(sizex)                    Right focus RECT;            HDC-hc;            hdc means GetDC(hWnd);            GetClientRect(hWnd, &rect);            if(sizex)                            SetRect(&focusrect, nleftWnd_width - (WIDTH_ADJUST 5 . 2),                    rectangular+top TOP_POS, nleftWnd_width + WIDTH_ADJUST,                    bottom rectangle - BOTTOM_POS);                                                DrawFocusRect(hdc, &focusrect);                                nleftWnd_width = xPos;                                SetRect(&focusrect, nleftWnd_width - (SPLITTER_BAR_WIDTH * 2),           + TOP_POS, nleftWnd_width + SPLITTER_BAR_WIDTH,                    bottom rectangle - BOTTOM_POS);                DrawFocusRect(hdc, &focusrect);                        ReleaseDC(hWnd, hdc);

    Download this software now to improve your computer's performance.

    Toby Michaelis