Let's see the code:Īlthough the code is a bit long, it doesn't need to be read at all. That seems to say althought some beginning statements are executed in the non-UI thread, but it have to switch to the main thread to execute the rest statements of OnAfterCreated. But all of these actions should be executed in the main thread (UI thread), I don't how to execute these actions in the main thread from the non-UI thread. In the OnAfterCreated, I got a underlying browser window (created by the c++ cef library), I want to save that browser (type CefBrowser) and do same addtional actions(e.g., get and save the handle of the browser window). that method (`OnAfterCreated`) runs in a different thread (not the main thread). For example, the OnAfterCreated(CefBrowser browser) method in CefLifeSpanHandler will be called once a new browser is created. In the process of creating the browser window, some handler (callback) can be used to response some events. For example, the WM_CREATE_BROWSER message will create a browser window using cef. In the WndProc of the message-only window, it response to some messages. After creating the window, I also start a new thread that posts windows messages to the main thread using PostMessage ( How to push some messages to a message queue in the main thread from another thread?). I create a message-only window in the Main thread (UI thread). Although this program is made by C# programming language, but the idea is from Win32. It is a little inappropriate to post this question here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |