Click here to Skip to main content
16,008,183 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making MFC go fullscreen Pin
Hadi Rezaee18-Dec-01 7:58
Hadi Rezaee18-Dec-01 7:58 
GeneralRe: Making MFC go fullscreen Pin
Rick York18-Dec-01 8:22
mveRick York18-Dec-01 8:22 
GeneralRe: Making MFC go fullscreen Pin
18-Dec-01 9:34
suss18-Dec-01 9:34 
GeneralRe: Making MFC go fullscreen Pin
Todd.Harvey18-Dec-01 8:47
Todd.Harvey18-Dec-01 8:47 
GeneralRe: Making MFC go fullscreen Pin
18-Dec-01 9:48
suss18-Dec-01 9:48 
QuestionHow to capture IE Event in WTL.... Pin
Huu Quynh18-Dec-01 3:44
Huu Quynh18-Dec-01 3:44 
GeneralExplain EnumChildWindows(...) Pin
Rickard Andersson2018-Dec-01 2:45
Rickard Andersson2018-Dec-01 2:45 
GeneralRe: Explain EnumChildWindows(...) Pin
Bill Wilson18-Dec-01 6:21
Bill Wilson18-Dec-01 6:21 
Did you try typing EnumChildWindows and hitting F1 or otherwise checking MSDN? Hmmm | :|

Here's what MSDN has to say:

Creating, Enumerating, and Sizing Child Windows
You can divide a window's client area into different functional areas by using child windows. Creating a child window is like creating a main window — you use the CreateWindowEx function. To create a window of an application-defined window class, you must register the window class and provide a window procedure before creating the child window. You must give the child window the WS_CHILD style and specify a parent window for the child window when you create it. 

The following example divides the client area of an application's main window into three functional areas by creating three child windows of equal size. Each child window is the same height as the main window's client area, but each is one-third its width. The main window creates the child windows in response to the WM_CREATE message, which the main window receives during its own window-creation process. Because each child window has the WS_BORDER style, each has a thin line border. Also, because the WS_VISIBLE style is not specified, each child window is initially hidden. Notice also that each child window is assigned a child-window identifier. 

The main window sizes and positions the child windows in response to the WM_SIZE message, which the main window receives when its size changes. In response to WM_SIZE, the main window retrieves the dimensions of its client area by using the GetWindowRect function and then passes the dimensions to the EnumChildWindows function. EnumChildWindows passes the handle to each child window, in turn, to the application-defined EnumChildProc callback function. This function sizes and positions each child window by calling the MoveWindow function; the size and position are based on the dimensions of the main window's client area and the identifier of the child window. Afterward, EnumChildProc calls the ShowWindow function to make the window visible. 

#define ID_FIRSTCHILD  100 
#define ID_SECONDCHILD 101 
#define ID_THIRDCHILD  102 
 
LONG APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 
{ 
    RECT rcClient; 
    int i; 
 
    switch(uMsg) 
    { 
        case WM_CREATE: // creating main window  
 
            // Create three invisible child windows. 
 
            for (i = 0; i < 3; i++) 
            { 
                CreateWindowEx( 
                    0, 
                    "ChildWClass", 
                    (LPCTSTR) NULL, 
                    WS_CHILD | WS_BORDER, 
                    0,0,0,0, 
                    hwnd, 
                    (HMENU) (int) (ID_FIRSTCHILD + i), 
                    hinst, 
                    NULL); 
            }
 
            return 0; 
 
        case WM_SIZE:   // main window changed size 
 
            // Get the dimensions of the main window's client 
            // area, and enumerate the child windows. Pass the 
            // dimensions to the child windows during enumeration. 
 
            GetClientRect(hwnd, &rcClient); 
            EnumChildWindows(hwnd, EnumChildProc, 
                (LPARAM) &rcClient); 
            return 0; 
        // Process other messages. 
 
    } 
    return DefWindowProc(hwnd, uMsg, wParam, lParam); 
} 
 
BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) 
{ 
    LPRECT rcParent; 
    int i, idChild; 
 
    // Retrieve the child-window identifier. Use it to set the 
    // position of the child window. 
 
    idChild = GetWindowLong(hwndChild, GWL_ID); 
 
    if (idChild == ID_FIRSTCHILD) 
        i = 0; 
    else if (idChild == ID_SECONDCHILD) 
        i = 1; 
    else 
        i = 2; 
 
    // Size and position the child window.  
 
    rcParent = (LPRECT) lParam; 
    MoveWindow(hwndChild, 
        (rcParent->right / 3) * i, 
        0, 
        rcParent->right / 3, 
        rcParent->bottom, 
        TRUE); 
 
    // Make sure the child window is visible. 
 
    ShowWindow(hwndChild, SW_SHOW); 
 
    return TRUE; 
} 


Hope this helps,
Bill
GeneralA Drawing Problem. Please HELP ! ! ! Pin
The_Server18-Dec-01 2:44
The_Server18-Dec-01 2:44 
GeneralRe: A Drawing Problem. Please HELP ! ! ! Pin
Joaquín M López Muñoz18-Dec-01 2:50
Joaquín M López Muñoz18-Dec-01 2:50 
GeneralRe: A Drawing Problem. Please HELP ! ! ! Pin
The_Server18-Dec-01 3:21
The_Server18-Dec-01 3:21 
GeneralDLL Linkage Problem Pin
James Spibey18-Dec-01 1:15
James Spibey18-Dec-01 1:15 
GeneralRe: DLL Linkage Problem Pin
Joaquín M López Muñoz18-Dec-01 2:43
Joaquín M López Muñoz18-Dec-01 2:43 
GeneralRe: DLL Linkage Problem Pin
James Spibey18-Dec-01 3:20
James Spibey18-Dec-01 3:20 
GeneralChange of BackGround Color Pin
San18-Dec-01 1:05
San18-Dec-01 1:05 
GeneralRe: Change of BackGround Color Pin
Rickard Andersson2018-Dec-01 1:53
Rickard Andersson2018-Dec-01 1:53 
GeneralCLSID from interface Pin
Ryszard Krakowiak18-Dec-01 1:01
Ryszard Krakowiak18-Dec-01 1:01 
GeneralRe: CLSID from interface Pin
Ryszard Krakowiak18-Dec-01 1:42
Ryszard Krakowiak18-Dec-01 1:42 
GeneralRe: CLSID from interface Pin
Tim Smith18-Dec-01 2:01
Tim Smith18-Dec-01 2:01 
GeneralPalm OS newcomer... Pin
Braulio Dez17-Dec-01 23:06
Braulio Dez17-Dec-01 23:06 
GeneralRe: Palm OS newcomer... Pin
Nish Nishant17-Dec-01 23:46
sitebuilderNish Nishant17-Dec-01 23:46 
GeneralRe: Palm OS newcomer... Pin
Braulio Dez18-Dec-01 0:27
Braulio Dez18-Dec-01 0:27 
GeneralRe: Palm OS newcomer... Pin
Nish Nishant18-Dec-01 0:33
sitebuilderNish Nishant18-Dec-01 0:33 
GeneralRe: Palm OS newcomer... Pin
Braulio Dez18-Dec-01 0:40
Braulio Dez18-Dec-01 0:40 
GeneralRe: Palm OS newcomer... Pin
Braulio Dez18-Dec-01 2:49
Braulio Dez18-Dec-01 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.