Sign in to follow this  
Followers 0
bafh

explain code

10 posts in this topic

#1 ·  Posted (edited)

Hello, can anyone explain this code to me??? like a short reference

Opt('WinTitleMatchMode', 4)
$hwnd = WinGetHandle('classname=Progman')
DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', 274, 'int', 61808, 'int', 2)
Sleep(5000)
Send ("{Up}")

Its pretty cool, how do i make the screen stay off longer without doing the DllCall again?

Thanks alot

Edited by bafh

Share this post


Link to post
Share on other sites



Hello, can anyone explain this code to me??? like a short reference

Opt('WinTitleMatchMode', 4)
$hwnd = WinGetHandle('classname=Progman')
DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', 274, 'int', 61808, 'int', 2)
Sleep(5000)
Send ("{Up}")

Its pretty cool, how do i make the screen stay off longer without doing the DllCall again?

Thanks alot

<{POST_SNAPBACK}>

Change the Sleep. For example to blank for ten seconds change 5000 to 10000 (1000 ms = 1 sec)

Opt('WinTitleMatchMode', 4)
$hwnd = WinGetHandle('classname=Progman')
DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', 274, 'int', 61808, 'int', 2)
Sleep(10000)
Send ("{Up}")

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites

Hmm this seems to work very differently on different pcs!

on mine i have to refresh it every half second or the screen will turn on. on a friends pc this does not have any effect at all.

all on xp.... what to do?

Share this post


Link to post
Share on other sites

Well:

SC_MONITORPOWER

Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.

The lParam parameter can have the following values:

1 - the display is going to low power

2 - the display is being shut off

So my friend doesnt seem to have a monitor with powermenagement. how else could i turn off ANY monitor with autoit?

Are there any conflicts with autoit and winxp sp2 known by the way?

Share this post


Link to post
Share on other sites

Okay thank.

But still, does anyone know how to turn off any screen using autoit?

without using SC_MONITORPOWER

Share this post


Link to post
Share on other sites

other then setting the refresh rate so high that it explodes,

i cant think of anything.

well, there are IP controlable power strips on the market. http://www.leunig.de/_en/_pro/remote-power-switch/eps.htm. This will definitely turn off the screen :)

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Okay thank.

But still, does anyone know how to turn off any screen using autoit?

without using SC_MONITORPOWER

<{POST_SNAPBACK}>

You see that round button in the lower right corner of your monitor ?

Try to press it.. always works for me :)

If that doesn't work, then unplugging either the cable that goes to the

wall or to the back of your computer should do it.. Good luck btw !

Share this post


Link to post
Share on other sites

Turning the monitor off manually defeats the purpose of scripting it!

/DEV/NULL has the best idea. I've never used that particular brand before, but I've used similiar products. They're great for when you need to remotely (or programatically) hard-boot a server or other equipment. I prefer the serial-based ones over the IP-based ones, because the serial ones you can plug a modem into and still be able to dial in if your IP infrastructure (switches/routers/firewall/etc) is what you need to boot.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0