postmessages blocks other messages

I'm trying to solve a problem with a homemade button, because mouseleave not always work ( ). Now i'm trying to solve the problem by sending myself a message (by postmessage) to check if the mouse is outside my button area - BUT if i postmessage everytime i get the message and the mouse is still over the button area i'm blocking for other messages to get through (e.g. invalidate, onclick)
I've tried to insert Application.processmessags - that will solve the problem, but i think it is too heavy to call so often. How can i be sure not to block the message queue ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's not the idea to post messages application internal. To check if the mouse is over the butten use the OnMouseMove-Event. It's forced every time the mouse is over your button (an you can do your hovver-effect).
I hope your button derives vom TWinControl, isn't it?
espensenAuthor Commented:
My button is derived from TPaintbox because it's very simpel. It's showing 3 states (bitmaps), one if disabeld another if enabled and the 3. if the mouse is over the button (and enabled). I've made my own handle to send messages.

I need to know that the mouse is OUTSIDE my button, so I can change it's state (bitmap). MouseLeave isn't arriving if the program is busy with something else.......
Perhaps looking at Jordan Russell's speedbutton component will give you a hint. He's documented this problem and solved it by using a timer (if I remember right).

The button is in the toolbar97 collection.

Regards, Madshi.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
espensenAuthor Commented:
It was a timer..... Thanks !
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.