Peekmessage In dialog ???

Started by gromit, May 17, 2010, 10:03:04 PM

Previous topic - Next topic

gromit

Hi Folks

Could anyone Point me in the right direction

I want to use Peekmessage

However to use Peekmessage it needs a message loop

/* The user interface is a modal dialog box */
    return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);

As the above code shows In my dialog based app, i have no visible msg loop.

is it possible to do it any other way than to write a non dialog based app
:-\ :-\ :-\

DMac

Here is something that I use to keep a dialog refreshed.  Borrowed it from BCX.

VOID DoEvents(VOID)
{
MSG Msg;
while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}

Use it like so:if (GetSaveFileName(&ofn))
{
DoEvents(); // refresh screen

char buf[RichEdit_GetTextLength(txtScript)];

// Do stuff
No one cares how much you know,
until they know how much you care.

gromit

Cheers for that DMac Bit Pushed for time at present
So wont be able to test until late tonight
Looks more promising than anything i have found so far.

Let U know how i get on Later.

Big Thanks Gromit
:) :) :)