Trying not to hijack 3Dxware's messages in win32 api

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
mpco
Posts: 5
Joined: Tue Jul 22, 2008 1:40 pm

Trying not to hijack 3Dxware's messages in win32 api

Post by mpco » Wed Jul 23, 2008 5:00 am

Good afternoon! I'll try to keep this question as simple as possible. I'm not an expert at win32 api, so if I make glaring mistakes, feel free to point them out :)

I'm writing an application for Unigraphics NX5 (UG) that is launched internally, as it is a DLL file. The application calls CreateWindowEx and then enters a simple message loop:

Code: Select all

<snip>

HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(NULL);	
HWND ug = UF_UI_get_default_parent ( ); // This is the parent window of my new window, which is UG

	hwndMain = CreateWindowEx(0, 
				"test_window", 
				"Test Window", 
				WS_OVERLAPPEDWINDOW, 
				100,100, 
				500,500, 
				ug, 
				NULL, 
				hInstance,
				NULL); 

	while (GetMessage(&msg,NULL,0,0))
	{

			TranslateMessage(&msg);
			DispatchMessage(&msg);

	}
</snip>
This doesn't include registering the class and so forth, but I assume that it is unrelated to my question.

Anyway, using spy++, I noticed there was a window named "3DxWare Client Interface" where all the motion messages are ending up. They are 0xC109 Registered: "MotionEvent". Accompanying these are WM_SETCURSOR messages set to the display window of UG, which is a child of the MDIclient.

However, after I create my window, the WM_SETCURSOR messages are no longer reaching the display window, and my device stops working with UG. I've had this problem since the spaceball 2002C. I'm currently using a Space Pilot, but I've had this problem on every 3Dxware device I've used.

I can't figure out where they are going, and am also assuming they are vital for interaction of 3DxWare with UG. It doesn't look like my new window is eating the WM_SETCURSOR messages, it just looks like they aren't being set to UG's window. While this is happening, all of the 0xC109 messages are still reaching the 3DxWare Client Interface window with no problem.

So far, I've tried setting up some filters, such as having my window ignore messages > 0xC000, setting the second parameter of GetMessage to the handle of the window I've created, and a couple of other things, all to no avail. Anyone have any ideas? I know that I probably should be doing something else so not to snarf all of the messages from UG, but I'm not really sure what exactly.

Thanks for any help, let me know if more information is needed.

jwick
Moderator
Moderator
Posts: 2482
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick » Tue Jul 29, 2008 7:50 am

???

It appears that you are interfering with some unwritten protocol that UG expects. Perhaps you can try forwarding all the events you receive to the UG window.

Post Reply