Page 1 of 1

CloseWindow

Posted: Tue Nov 11, 2003 10:20 pm
by BrendanE
Hello all,

I have a DLL which is running a comms thread (POP3 Client)...
part of my DLL sends a message via a callback function in my application.

In my application when I begin an asynchronous task I open a second window using pb's OpenWindow() which is just has progress bar essentially and then the callback messages update the progressbar - so far so good.

Once the task is complete a further message is sent via the callback to signal that the process is complete - now I attempt to CloseWindow()

the window doesn't close....

I've tried calling DestroyWindow_() and I've tried using a custom WndProc for my second window... still the window doesn't close.

Any ideas please?

Posted: Tue Nov 11, 2003 11:21 pm
by BrendanE
Ok problem solved.

In my callback function IF I affect the progressbar using SetGadgetState() then ANY call to CloseWindow() for that window fails.

However - if I replace the CloseWindow() calls in the callback function with a PostMessage_( ..., WM_CLOSE, ...) it works fine. (SendMessage_() doesn't work either, must be PostMessage_())

Thread headaches I expect.