Since you didn't show the contents of your Scrolling(hDlg) function, I can only guess that you are using SetWindowText in it to first put in the "o", then the "lo", and so on.
If so, immediately after the call to SetWindowText, add a call to the edit control's UpdateWindow() function. This will bypass the normal windows message pump and cause it to update immediately.
Hope that helps.
Be sure to rate those who help!
-------------------------------------------------------------
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
I wonder why you were handling the IDOK command for your purposes. You better would have a static text control and output your ticker message using a timer (i. e. handling the WM_TIMER message). That way your dialog wouldn't freeze while outputting the message. You could hold the last state of your ticker in static variables of your handler function.
Code:
...
switch (message)
{
case WM_INITDIALOG :
SetTimer(hDlg, 99, 500, MyTimerProc);
return TRUE;
...
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
static int lastticker = 0;
if (idEvent == 99)
{
HWND hwndTicker = GetDlgItem(hwnd, IDC_STC_TICKER);
switch (lastticker)
{
case 0: SetWindowText(hwndTicker, "o"); break;
case 1: SetWindowText(hwndTicker, "lo"); break;
case 2: SetWindowText(hwndTicker, "llo"); break;
case 3: SetWindowText(hwndTicker, "ello"); break;
case 4: SetWindowText(hwndTicker, "Hello"); break;
}
lastticker = (lastticker+1)%5;
}
}
Bookmarks