From: SourceForge.net <no...@so...> - 2008-06-13 17:37:19
|
Feature Requests item #1992429, was opened at 2008-06-13 00:18 Message generated for change (Comment added) made by kichik You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373088&aid=1992429&group_id=22049 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Plugins Group: None >Status: Pending Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Amir Szekely (kichik) Summary: UI thread callback Initial Comment: For plugins that are not custom pages but provide functionality, sometimes it is necessary to manipulate the NSIS UI from the plugin. Custom plugin functions run in a separate thread from the UI thread. Attempting to interact with UI in a Windows program should only be done in the thread that owns the UI (AFAIK). I can't find a way to do this except by using SetWindowsHookEx. I'd like to see a way for a custom NSIS dll to register a callback with NSIS's GetMessage pump, or provide some other APC mechanism so that manipulating the UI can be done in the proper thread. ---------------------------------------------------------------------- >Comment By: Amir Szekely (kichik) Date: 2008-06-13 20:37 Message: Logged In: YES user_id=584402 Originator: NO If you call the plug-in from a callback function like .onGUIInit or one of the page callbacks, it'll run of the GUI thread. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2008-06-13 20:33 Message: Logged In: NO Subclassing the window will work, except that when a Windows program subclasses a window via SetWindowLongPtr or SetWindowSubclass in should only do so in the thread that owns it. As far as I can tell, a NSIS plugin function never runs in the same thread that owns the NSIS windows. Please also consider the other issues around subclassing. See the following: http://blogs.msdn.com/oldnewthing/archive/2003/11/11/55653.aspx If a GetMessage hook is unreasonable, consider implementing a way for plugins to subclass windows in the thread they were created in. ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2008-06-13 20:04 Message: Logged In: YES user_id=584402 Originator: NO You can simply load the plug-in in .onGUIInit or subclass the window and handle messages from its own thread. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373088&aid=1992429&group_id=22049 |