THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/12/2010 at 12:01, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
---------
Hello;
hopefully someone can explain away the following problem once and for all. There are a few threads on the forum that point into the same direction but as far as I can see, none addresses the core issue (or maybe I'm just too dumb...)
Situation: I want to get system messages (here: Windows) but for obvious reasons not through busy loops, active polls, secondary libraries or parallel threads, but through the clean and safe system methods.
Under Windows, I normally derive my window class, add a message map, and use a callback that will be called when the desired message is present.
Unfortunately, GeDialog is not derived from the proper Windows class, and thus I cannot derive it and overload/expand the message map. I assume that isn't possible with other means since GeDialog is system independent.
GeDialog does provide a method that returns the handle of the window, but I'm not sure whether this is the real Windows handle or some other descriptor, and anyway, by the time I can access the handle, the window has already been created. I would need to inject the message map and callback handler after the window has been created already, not sure whether there is a clean way to do this.
The standard messaging system in C4D is not equivalent to the Windows messaging, so I can't really expect to get WM_xxx messages here, can I?
I could probably open a normal Windows window to receive the messages - provided the messages are routed through an inactive window's message map at all -, but I am pretty sure that this is not necessary.
The built-in 3Dconnexion SpaceMouse dialog does something like this. Even more, since R12 you don't even have to have the dialog open any more to make the SpaceMouse work. How? (Incidentally, it's precisely the SpaceMouse I want to poll - the provided example from the 3Dconnexion website does use WM_INPUT messages through the standard Windows class system though, and I'm missing the proper join to the C4D system.)
Currently, I don't even know what direction I should think in. Any pointers, so I won't waste my time with testing stuff that cannot work anyway?
Thanks.