开发者

How best to notify my Delphi App from a Windows callback

开发者 https://www.devze.com 2022-12-23 16:48 出处:网络
I\'m using the Multimedia timer in Delphi and this works great for quite accurate callbacks (compared to a traditional TTimer). However the callback is from another thread. I dont have a convenient fo

I'm using the Multimedia timer in Delphi and this works great for quite accurate callbacks (compared to a traditional TTimer). However the callback is from another thread. I dont have a convenient form to use for 开发者_如何学CPostMessage() or a message based means of notifying my app that the callback has happened - I just have a class. I'm happy with a message based solution (if necessary). What is the easiest way of sending some kind of event from the Windows callback into my class? THanks Brian


The standard solution is to create an invisible window using AllocateHWnd procedure as a field of your class to receive messages sent from callback function. A nice usage example of AllocateHWnd procedure is TTimer component.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号