i writing application allows scrolling, without focusing windows. i've done yet: created lowlevelmousehook. if lowlevelmouseproc recieves mousewheel-message searching handle @ cursor-position , send scroll-messages handle. hook looks this:
lresult callback mousehookcallback(int code, wparam wparam, lparam lparam) { if(code < 0) return callnexthookex(mousehookinstance, code, wparam, lparam); if(usermousehookcallback != null) { usermousehookcallback(code, wparam, lparam);//scroll hovered window here if(wparam == wm_mousewheel) return -1; } return callnexthookex(mousehookinstance, code, wparam, lparam); } as can see, returing -1 if message mousewheel-message. should avoid scrolling focused window(i don't want scroll focused window, want scroll window hovered cursor). problem is, not cancel scrolling focused window. has idea how avoid scrolling focused window? @ moment there 2 windows getting scrolled. 1 mouse hover , 1 focused.
please don't downvote question , give me chance. doing best not able find solution.
i've found solution. very, very, simple. set <requestedexecutionlevel level="requireadministrator" uiaccess="false" /> in manifest or start administrator manually , works :)
Comments
Post a Comment