fisofo Posted February 16, 2007 Share Posted February 16, 2007 Happy Friday!Ok, I've written some basic stuff using Larry's Mousehook that will move a window monitor-to-monitor when a hotkey is pressed and the mouse scroll wheel is used. Works great, but I find that most single key shortcuts are already used by most apps (Ctrl+scroll wheel, particularly for zoom, change font size, etc...).I found that the windows key is a nice alternative (I'm using _IsPressed to check) but of course, when I release the key, the windows start menu pops up and I lose program focus. Same type of behavior goes for the Alt Key, the Right mouse click and middle button click.So I'm wondering if I can have my script's last action before returning to be to suppress the windows key from opening the start menu (or Alt or Right click, but I'd prefer windows key)... I could always send the windows key a second time to pop it back down, but just the thought of that code makes me feel dirty inside.Any thoughts on how to accomplish this? Link to comment Share on other sites More sharing options...
fisofo Posted February 19, 2007 Author Share Posted February 19, 2007 I have just posted the code that I refer to in this topic over at the SplitMon topic (see sig). I still haven't thought of a good way of accomplishing this, although I found that using middle click + scroll wheel works well if I have the mouse cursor moved too... it depresses as soon as I release the "hotkey" (the middle click) and my universal scroll is not stuck on the screen. Still, I would like to find a way to particularly get this to work with the windows key... anyone got any ideas? I will continue my search in the meantime... Link to comment Share on other sites More sharing options...
fisofo Posted February 19, 2007 Author Share Posted February 19, 2007 The hook is not really written correctly to work like a hotkey. It is passive... You would need a hook that can optionally supress the keystroke/mouse event from reaching it's destination. I can supply no solution for you.Lar.Yep, that makes sense. And I don't think SetWindowsHookEx supports suppressing either from what I've read.Outside of that as an option, is there a sure fire way to temporarily "disable" or suppress the start menu from appearing? It wouldn't be pretty, but perhaps I could do something like that after the script finishes running for a set time... that might work. Link to comment Share on other sites More sharing options...
fisofo Posted February 19, 2007 Author Share Posted February 19, 2007 If you return -1 instead of CallNextHookEx ... I think it supresses it. All except for CTL+ALT+DEL and a few others.Lar.I'll take a look at that, thanks Larry. Link to comment Share on other sites More sharing options...
fisofo Posted February 20, 2007 Author Share Posted February 20, 2007 So... return -1 from what? I tried from your mousehook functions, but that didn't do anything... and I don't see you using CallNextHookEx... I don't think I can ask you to help much more with this simply because I know jack about hooks and it would just be me saying "could you explain..." or "could you code..." and you certainly don't need more of that So I may just need to set this aside until I understand hooks better, because this is still pretty beyond me. Thanks for taking a look though! Link to comment Share on other sites More sharing options...
fisofo Posted February 20, 2007 Author Share Posted February 20, 2007 CallNextHookEx is in my dll. The dll would need a rewrite.Gotcha. Well, no pressure then... But let me know if you ever do it! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now