Log Window

closed account (G26pX9L8)
Hallo

I have this piece of code and now I want to make a log system. It is intended that there is always a line when something happened, but how do I do that without the rest of the lines disappear devote?

This is de code now:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
case WM_CREATE:
            CreateWindow(
                "EDIT",
                "",
                WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                hwnd,
                (HMENU)1001,
                g_hInst,
                NULL
            );
            SendDlgItemMessage(hwnd, 1001, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
        break;
How about saving all the lines within a container and draw the container to the window...

(I´m not sure, but I think there could be some flicker going on, when doing this - there is an solution to this in the MSDN for MFC-programs, but I don´t remember the link [it´s been a while])
closed account (G26pX9L8)
I rather send every line alone to the window, but how to do?
How to send a line to an edit box, or how to avoid the flicker stuff?...
closed account (G26pX9L8)
Send a single line to the edit box could i do with the function SetWindowText(); but if I send a new line, the old disappeard. Thats not what I want. How to continue?
Step 1: Grab old text
Step 2: Append New Text
Step 3: Draw whole log to the window.

Alternativley

Dump all text to what we like to call a "log file", then read it back to your Edit box.
closed account (G26pX9L8)
Really what the intention is that after each step is shown on screen what happened that should be posted in the edit box.
Yep... But as usual, programming isn´t just telling the computer what to do exactly...

You sometimes need to evolve the solution, and that is - in this case - the three-step-solution, geek01 suggested... (Or try another one)...



EDIT: for an Log-Window I suggest to make the Edit-Box read-only, so one is able to copy the text easily, but restrict writing access to it... (EM_SETREADONLY)...
Last edited on
closed account (G26pX9L8)
all right, well I think it is solved for now, tnx all
Topic archived. No new replies allowed.