Posted: Fri Sep 28, 2007 8:06 am Post subject: [masm] AnimateWindow problems?
So I'm playing around with winapi in masm, and I was just toying around with AnimateWindow.
<< invoke AnimateWindow,hWnd, 100,AW_CENTER >>
The problem I'm getting currently is that it can animate a window in - though it doesn't display the bitmaps I've loaded until the animation is fully complete.
So I figured I would use RedrawWindow immediately before calling it.
From what I understand this should for the WM_PAINT call which updates the bitmaps... And using NULL NULL should form my entire form to be redrawn. However this isn't working... Anyone have any experience dealing with this? I'm sure it's a problem atleast one other person has come up against.
Try doing it in a thread seperate from the thread WndProc is in. Its like sticking an infinate loop in the WndProc, the WM_PAINT messages don't process until the loop is complete.
Try doing it in a thread seperate from the thread WndProc is in. Its like sticking an infinate loop in the WndProc, the WM_PAINT messages don't process until the loop is complete.
Weird, I'll try that but I could have sword that using WM_UPDATENOW forced WM_PAINT to occur.
Try doing it in a thread seperate from the thread WndProc is in. Its like sticking an infinate loop in the WndProc, the WM_PAINT messages don't process until the loop is complete.
Weird, I'll try that but I could have sword that using WM_UPDATENOW forced WM_PAINT to occur.
Thanks
You have to remember that it has to do with the fact that while the function is processing that the window can't deal with any other messages until that one is finished.
Code:
...
case LOL:
RedrawWindow(junk); <- This will update the window.
AnimateWindow(junk); <- Now this is where the problem is.
break;
case WM_PAINT: <- Cannot be called while LOL is still trying to use AW!
...
break;
...
Is basically the same as doing:
Code:
...
case LOL:
RedrawWindow(junk);
for(x=0; x<11; x++) <- Now this is where the problem is.
Sleep(10);
break;
case WM_PAINT: <- Cannot be called while LOL is still in its 100ms for loop!
...
break;
...
So basically when you use AW in the WndProc you are effectively blocking all other messages that are sent to the window, because it is busy already processing another message.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum