|
|
My apologies. Maybe you could try
while (MessageBox.Show("Turn off your monitor now", "Secret Programmers Business", MessageBoxButtons.YesNo) == DialogResult.No) { };
Hope that helps
Seriously though, you can't turn off someones monitor. As a programmer, you need to analyse the problem and suggest a better solution
|
|
|
|
|
Thank you for the answer. I know this is not an elegant solution, but you don't know my boss... Anyway I will manage it somehow... Good job
|
|
|
|
|
Do you honestly think that we are all sitting here 24/7 just waiting for you to ask a question, so that we can rush to answer it?
Get real!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I think I was misunderstood ... I was not expecting an immediate response, I just wanted to ask the question differently because I realized that my previous request is not feasible. all.
Perhaps my poor English can create these misunderstandings...sorry again.
|
|
|
|
|
It sounds very like you are trying to hack a system and our help isn't quick enough. It's pretty rude to bump your question like this.
|
|
|
|
|
Can you alter the program you are interacting with?
|
|
|
|
|
No, unfortunately I can't. It's a web page remotely sent by a clima controller inside a hotel. This the reason why I use a 'bot'. I didn't find other solutions.
|
|
|
|
|
If it's a web page, you might be able to make direct HTTP request/responses, without even having the browser open. Is this an option?
|
|
|
|
|
Thank you, but this is not an option, we just used a "sniffer" and did not intercept traffic
|
|
|
|
|
just to clarify, did the sniffer not intercept anything, or did the site not accept sniffed traffic?
If it is the former, there is something wrong with the sniffer: there must be traffic between the site and the browser .
|
|
|
|
|
The site did not accept sniffed traffic. Sorry, my mistake.
|
|
|
|
|
Just throwing out ideas: Can you host the web-page in a .net WebBrowser control? You can interact with DOM elements in it IIRC, and you might not need to render it. It's a brittle solution though, a change to the web site can smash the functionality.
|
|
|
|
|
Yes, I can host the web page in a web browser control, in fact it was my first approach to the problem... but this doesn't help, since the web page is a SunAwtFrame with only SunAwtDialogs and Java applets, so I have no access to buttons... they're seen purely like images.
|
|
|
|
|
IngValentini wrote: is at least possible to detect if PC monitor is powered on
You probably can because Windows needs the monitor to be powered up so it can determiine an appropriate resolution. I don't know how to go about doing this.
IngValentini wrote: detect if someone is sharing my desktop (perhaps using some kind of Windows APIs??)
Again, you probably can, and again, I don't know how you would go about doing it.
Google is your friend.
BTW, wbhen posting a question here, you have to consider that the majority of people that have any hope of answering questions are living in another timezone. You have to either learn patience, or develope your google foo to a finer art.
For what it's worth, I'd write a windows service to sit on the machine in question, and as long as the machine is on, it can be communicated with via TCP/IP or even HTTP.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Sorry, but I don't understand why you are blaming me... I already apologized for the misunderstanding. And yes, I googled before posting my question. I simply was wondering if other people could help me in some different way, with tricks known by experts. That's it.
|
|
|
|
|
The display drivers can get the EDID data from the montitor, including native resolution, without the monitor being turned on.
|
|
|
|
|
Dave Kreskowiak wrote: The display drivers can get the EDID data from the montitor, including native resolution, without the monitor being turned on.
That's what I thought as well. As long as the monitor is plugged in, it can be queried for this information, but chances are that most monitors will turn on automatically when a signal from the video adapter is sensed, so it is a moot point.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
PogoboyKramer wrote: but chances are that most monitors will turn on automatically when a signal from the video adapter is sensed
Not unless they're alreday actually powered on. They also only go "off" automatically when the computer goes into "sleep" mode.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Noted, and I stand corrected.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
Just out of curiosity - what are you actually trying to do?
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
The only way I can solve the problem, at this point, is to stop the app when monitor is powered on and restart it when the monitor is powered off. I've previously explained that my boss doesn't want users to see the 'bot' in action.
|
|
|
|
|
You should tell your boss not to sell functionality that he doesn't know is achievable
|
|
|
|
|
I have already told him... but unfortunately for me he doesn't understand 'no' as an answer.
|
|
|
|
|
After you've made sure the monitor is off, will you need to switch the mouse off too? And the keyboard? Because they would (probably more than the monitor) interfere with the running process?
|
|
|
|