I'm giving the user the ability to rotate objects that they've picked up. I
have various "modes" of my application that alter the default way AutoCAD
processes points. This is one of those modes - it figures out where the
user clicks, and whether it's on or inside the bounds of an object. If it
is, then it "picks it up." When the user clicks somewhere else in the
drawing, it will set it down. During the time the object is "picked up",
the user can rotate the object by moving the mouse wheel. This DOES work
right now, it's just that we have the additional movement of the screen -
either the scroll or pan.
My code is essentially just like the example provided by Owen Wengerd,
except that i'm now sublassing the document window, as was recommended:
Here are the variables i'm using:
WNDPROC g_wprocAcad = NULL; //The original AutoCAD window procedure
HWND g_hwndAcad = adsw_acadDocWnd(); //Store the AutoCAD document window
Here's my function prototype:
LRESULT CALLBACK AcadWndProcHook( HWND hwnd, UINT iMsg, WPARAM wParam,
LPARAM lParam );
Then in my entry point i register my new windows message proc:
g_wprocAcad = (WNDPROC)::SetWindowLong(
g_hwndAcad,GWL_WNDPROC,(LONG)AcadWndProcHook );
And then here's my actual function, which at this piont does essentially
nothing, except printing out that it received scroll and mouse wheel
messages:
LRESULT CALLBACK
AcadWndProcHook( HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
{
CString a;
a.Format("\nGot the following message: %d",iMsg);
//acutPrintf(a);
//Here we just process all the window messages that are on their
//way to the AutoCAD main window.
switch( iMsg )
{
case WM_VSCROLL:
acutPrintf("\nScroll");
return 0;
case WM_MOUSEWHEEL:
acutPrintf("\nMouse Wheel");
return 0;
}
//Now pass the message to the original window procedure
return ::CallWindowProc( g_wprocAcad, hwnd, iMsg, wParam, lParam );
}
"Byron Blattel"
wrote in message news:E9E118F70A2EB35296
[email protected]...
> FWIW, I believe this is by design in Windows so that applications written
> before mice had wheels can handle the mouse wheel through their default
> scroll handlers. Some mouse drivers override this behavior but that's the
> general idea...
>
> What's your goal with disabling the mouse wheel (I personally would find
> that very irritating) 🙂
>
> |
> ----+----------------------------------------------
> | Byron Blattel
> | CADwerx---Applications for AutoCAD
> | Autodesk Registered Developer
> | email: [email protected]
> | web site: http://www.cadwerx.net
> |
>
>
>