Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I was wondering if its possible to disable all user input to my secondary desktop using the windows API ?
Posted
Updated 2-Mar-11 5:10am
v2
Comments
Emilio Garavaglia 2-Mar-11 7:40am    
What do you mean as "secondary desktop"? another alternative windows desktop into the windowstation, or ... just a secondary MONITOR?
Olivier Levrey 2-Mar-11 8:52am    
Emilio is right. Your question is ambigous. Please rephrase it.
Bart Poirters 2-Mar-11 10:33am    
Ok i should have explained my self more clearly. The thing is, i made a c++ application which runs full screen on my secondary monitor and is always on top. This application is only used to show information regarding the system and my other application. Also the monitors can be far away from each other. And this is why i want to disable all user input on the secondary monitor.

In my opinion, there is no clean way to do that.

If you extended your windows desktop to use 2 monitors, then nothing can prevent the user to move the mouse to the secondary monitor. You can hide the mouse, catch all clicks if you want, but the user will not understand where the mouse has gone...

Although extending the desktop is an easy solution, it is probably not a good idea in your case.

You may try to search a VGA device (connected from the controlling PC in USB for example). With such a device, you could send an image to your secondary monitor without using desktop extension.

I am not sure if such a device exists though...
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 2-Mar-11 11:19am    
I agree with you, my 5. Any non-standard use of hardware it not realistic I think (see my answer).
--SA
There is not way to do it on system level, I think. So I agree with Olivier.

(His idea about special hardware is probably solvable, but… Theoretically speaking, it could be a standard second monitor used in a special way through software, but this looks a bit fantastic and would defeat the purpose, because you need a simple solution for using existing software.)

Now, let's think why you may need a solution. This is probably because you are trying to use available application on your secondary monitor for the purpose of monitoring only, but this software is not designed for this purpose; it accepts user input; and you worry about accidental input to this application. In other words, you use wrong application for your purposes. So, instead of attempting a system-level trick on top of this situation, you can only replace this application with something that satisfy your requirements (for example, blocks the input). The ugly truth of your situation is probably that you cannot have easier solution; the easiest it to give up and tolerate the risk of input, the second easiest is to replace the application.

—SA
 
Share this answer
 
Comments
Olivier Levrey 2-Mar-11 11:23am    
Your analysis makes sense. My 5.
Sergey Alexandrovich Kryukov 2-Mar-11 18:09pm    
Thank you.
--SA
From your description you application is full screen and on top always. Is that right? Now if that is the case you need to think a little bit differently. The only way an input can be entered in the secondary monitor is through your application. Don't you think? Of course your application can be minimized and other application can have a focus. But it is my understanding that would not be an issue.

So, the problem is very easy. Forget about secondary monitor and Windows API. Since your application has the focus you will be notified of all the inputs. Right? Now all you need to do is have your application to act into two different modes.

1. Regular mode
2. View Only Mode.

In regular mode you will continue business as usual. in View Only mode you intercept all inputs and "eat them". You ignore it and do nothing with it. Problem Solved.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 2-Mar-11 18:11pm    
Yusuf, if you read my Answer you will see this is exactly the same as what I say; in addition, you add the idea of two modes. Well, that would be... my 5.
--SA
Yusuf 2-Mar-11 19:20pm    
Thanks
Bart Poirters 4-Mar-11 6:21am    
Hi thanks for replying. The thing is i did catch things like mouse movement and such. However The problem is that i still can drag a windows from the primary monitor to my secondary one. Which is quit problematic when a user does this on the primary monitor.

In other words my problem could be resolved when i could disable dragging of other windows over my full screen application. I dont know if its possible tho.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900