c# - Mouse Wheel event not firing on one computer, works on another -


here's problem:

i wrote wpf application uses hwnd host drawing surface. hwnd responsible sending mouse events happen. on computer, works , see 522(0x020a) mouse wheel message without issue.

i installed same software on computer, , event didn't fire. went far logging event messages file see if 522 fired @ all, , never showed up.

things i've tried:

-making sure hwnd has focus. not did make thread re-focus every second, made sure on computer (working) "isfocused" true hwnd.

-closing down any other program running. included things normal computer running in background, in case taking focus off.

-switching mouse. used mouse i'm using on computer sure, , still did not work on new computer.

here's base code:

public abstract class win32hwndcontrol : hwndhost {     protected intptr hwnd { get; private set; }     protected bool hwndinitialized { get; private set; }      private const string windowclass = "hwndwrapper";      protected win32hwndcontrol()     {     }  protected override handleref buildwindowcore(handleref hwndparent) {     var wndclass = new nativemethods.wndclassex();     wndclass.cbsize = (uint)marshal.sizeof(wndclass);     wndclass.hinstance = nativemethods.getmodulehandle(null);     wndclass.lpfnwndproc = nativemethods.defaultwindowproc;     wndclass.lpszclassname = windowclass;     wndclass.hcursor = nativemethods.loadcursor(intptr.zero, nativemethods.idc_arrow);     nativemethods.registerclassex(ref wndclass);      hwnd = nativemethods.createwindowex(             0, windowclass, "", nativemethods.ws_child | nativemethods.ws_visible,             0, 0, (int)width, (int)height, hwndparent.handle, intptr.zero, intptr.zero, 0);      return new handleref(this, hwnd);  }   protected override intptr wndproc(intptr hwnd, int msg, intptr wparam, intptr lparam, ref bool handled)     {         switch (msg)         {             case nativemethods.wm_lbuttondown:                 raisemouseevent(mousebutton.left, mouse.mousedownevent);                 break;              case nativemethods.wm_lbuttonup:                 raisemouseevent(mousebutton.left, mouse.mouseupevent);                 break;              case nativemethods.wm_rbuttondown:                 raisemouseevent(mousebutton.right, mouse.mousedownevent);                 break;              case nativemethods.wm_rbuttonup:                 raisemouseevent(mousebutton.right, mouse.mouseupevent);                 break;             case nativemethods.wm_mousewheel:                 raisemousewheelevent(wparam.toint32(), mouse.mousewheelevent);                 break;          }          return base.wndproc(hwnd, msg, wparam, lparam, ref handled);     } 

there more code class, i've confirmed not hitting wndproc method.

any tips on why happening on 1 computer , not other?


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -