Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[masm] AnimateWindow problems?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
zart
Master Cheater
Reputation: 0

Joined: 20 Aug 2007
Posts: 351
Location: russia

PostPosted: Fri Sep 28, 2007 8:06 am    Post subject: [masm] AnimateWindow problems? Reply with quote

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.

<< invoke RedrawWindow,hWnd,NULL,NULL,RDW_UPDATENOW >>

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.

Thanks in advance...

_________________
0x7A 0x61 0x72 0x74

TEAM RESURRECTiON
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Sep 28, 2007 11:51 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
zart
Master Cheater
Reputation: 0

Joined: 20 Aug 2007
Posts: 351
Location: russia

PostPosted: Fri Sep 28, 2007 12:16 pm    Post subject: Reply with quote

Flyte wrote:
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

_________________
0x7A 0x61 0x72 0x74

TEAM RESURRECTiON
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Sep 28, 2007 3:58 pm    Post subject: Reply with quote

zart wrote:
Flyte wrote:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites