I've got a Log function that I use throughout a program for various purposes, at the moment it's logging to a text file fine and everything gets written to the buffer I'm using fine. The problem I'm having is that during my main dialog WM_INITDIALOG my log function is called twice and adds the to the buffer as expected. I have a separate dialog window that I can show with an edit control that shows the contents of the buffer and this partially works which is where I'm stuck. I can't get the edit control to refresh when the dialog window is open, to view the updated buffer I have to close the dialog window and reopen. The only way I can think of getting round this problem is by creating a thread that will update the edit control when it's open every 100ms which isn't ideal as it varies when things get logged to several times a second to one every few minutes. Searching google hasn't particularly helped as just about everything is MFC/VB and not pure Win32 api as I'm coding and I don't want to convert over the rest of the program. Any suggestions?