Tricky question: my and other applications are competing?!

ivor

Member
Joined
Mar 22, 2011
Messages
7
Location
Croatia
Programming Experience
1-3
I have an little application that has a role to zoom currently screen (magnify it). There is also posibillity to zoom more if you scroll wheel. BUT - if currently PowerPoint slideshow is running, it is not possible to zoom - and i realize why - because PowerPoint also uses mouse wheel for going to next or previous slide. So - this makes me sad, because just when I become happy because made things work - i realized that problem. Does anybody know how to make MY application win in this competition for mouse events

Thanks for any suggestion or idea.
 
i cant think of anything that would allow events to still execute while the form is not the focus only thing you would try would to make a shortcut key IDK like
Ctrl + Alt + '+' for zoom in
Ctrl + Alt + - for zoom out

only an idea i dont know for sure this would work, but maybe some of the more advanced user on thef orum can help you better
 
have you tried hooking the mouse event, i dont know too much unmmanged code and win API, but i use the one for the keyboard event to prevent the user from being able to use the windows short cut keys, alt f4, ctrl alt,alt-tab, and stuff. pinvoke.net: the interop wiki! i think from user32.dll or maybe kernel.. something.. maybe these links might help?

hooking global mouse clicks

[solved] how to do global mouse hook in VB .NET? - VBForums

pinvoke.net: mouse_event (user32)


another idea is to try and bring your app to the top of the focus every 1second or something... its really not recommended though, i think people talked about how you cant do it in .net or versions pass win XP but i feel like i got it to work for win 7 once. There should be some code online, google it. Its basically just a timer loop that brings your app to focus every second or whatever internal, i think its like Me.TopMost? or most likely some ummanged win API code thing?


Good luck, if you find out how to keep the focus of the global mouse events, please share :)
 
Thanks for trying guys, actually both ideas are ok: that with shortcut keys, and that with setting to topmost. I will try both. But do you think that this mean powerpoint do the same, every moment sets itself to top? If that is case, then why you think Flippedbeyond that is not good idea?
 
edit: didnt read your message to well and missed the "If thats the case": o well :p
If that is case, then why you think Flippedbeyond that is not good idea?
I dont think powerpoint does that, what i meant by taking the focus every second or something is like say you had another program running besides yours, every second or whatever interval the focus will be brought back to your program. ex. your app takes focus back every second, your app is open, the user wants to view something in firefox/word/.. another app, one second later the focus is taken by your app and the user loses focus of whatever else they were on, kinda like a spam/virus like behavior, unless you had a specific purpose, like what i tried to used it for was to force the user to stay on my app and never leave unless a correct password was inputted. It is an app that is set up as a public form for people to sign in so we want to be able to prevent unauthorized access to anything besides my input form.

But do you think that this mean powerpoint do the same, every moment sets itself to top?
i dont think so because you can have another app running and use it without losing focus to powerpoint. Some services i've noticed like Google Updater or something does something similar i think because while i am watching a video or something in fullscreen the google updater will steal the focus and throw my app out of fullscreen to do something in the background, which is really annoying from the users pov. I think powerpoint maybe just takes the mouseevents if anything?

Anyways good luck, Happy Coding :)
 
I understand now, excellent explanation. Actually I tried to use timer but need to change interval to 1 (from 1000; because only then has changed behavior, I mean, only in that case everything worked like it should). Although, I will ask you again, having in mind that this part of my program (zooming) is something that user will use mostly for short time (to temporarily emphasis something important on screen, slide, and so on), do you think that is bad?
Anyway, thanks for enlightening me Flippedbeyond

p.s. This is my first post ever, so can you tell me where can I add a value to your reputation?
 
having in mind that this part of my program (zooming) is something that user will use mostly for short time (to temporarily emphasis something important on screen, slide, and so on), do you think that is bad?
My opinion on that is if you are going to give the user some control on that or just turn it on and off when it is necessary, then it is fine. Like if the user is no longer going to use the zoom feature, you will disable the focus timer so they can alt-tab or switch apps as they choose. maybe a esc button feature or something?

dunno exactly what your app is, but if you think it through with the intended users pov and needs in mind, i think you should be fine.



Anyway, thanks for enlightening me Flippedbeyond

p.s. This is my first post ever, so can you tell me where can I add a value to your reputation?

no problem,
Welcome to the forum!

the add rep is at the bottom left of a post, its like a star shaped black symbol. Thanks :)
 
Last edited:
Back
Top