Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Why use "Window Messages" instead direct implementations?

Post Reply
geziel
Posts: 6
Joined: Thu Jun 14, 2018 8:15 pm

Why use "Window Messages" instead direct implementations?

Post by geziel »

I modified the "tabbrowser" demo to directly respond to events without using messages, and everything seems to work fine.

Why use "PostMessage" instead of implementing events directly?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Why use "Window Messages" instead direct implementations?

Post by salvadordf »

Many TChromium events are executed in different threads that the main thread.
VCL components are not thread safe and you could have problems if you modify some of their properties inside TChromium events.

I tend to use sync objects and messages with the TChromium events but if your application works fine without messages then don't use them! :)
geziel
Posts: 6
Joined: Thu Jun 14, 2018 8:15 pm

Re: Why use "Window Messages" instead direct implementations?

Post by geziel »

Understood. Thank you again.
Post Reply