MarkMarkMark Posted April 25, 2005 Share Posted April 25, 2005 (edited) Hi guys... how can i turn the monitor back on when i turned it off... i need it for a script. tnx already edit: i found this in a other post to turn it off $WM_SYSCOMMAND = 274 $SC_MONITORPOWER = 61808 Opt('WinTitleMatchMode', 4) $hwnd = WinGetHandle('classname=Progman') DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', 2) Edited April 25, 2005 by MarkMarkMark Link to comment Share on other sites More sharing options...
MarkMarkMark Posted April 25, 2005 Author Share Posted April 25, 2005 Owyeah, and does someone know howto list other network computers that are online in a txt file? Link to comment Share on other sites More sharing options...
CyberSlug Posted April 25, 2005 Share Posted April 25, 2005 (edited) EDIT: A simple MouseMove(0,0) might even work. I guess I should stop assuming that people try stuff before asking I have no idea if this will work, but it's worth a shot (Windows XP): The sleep statements are for debugging and can be removed Run(@ComSpec & " /c powercfg.cpl", "", @SW_HIDE) $title = "Power Options Properties" WinWait("Power Options Properties") $count = ControlCommand($title, "", "ComboBox2", "FindString", ControlCommand($title,"","ComboBox2", "GetCurrentSelection","") ) ControlSend($title, "", "ComboBox2", "n") ControlClick($title, "", "&Apply") sleep(2000) ControlSend($title, "", "ComboBox2", "{PgUp}{Down " & $count & "}") sleep(2000) ControlClick($title, "", "OK") Edited April 25, 2005 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
MarkMarkMark Posted April 25, 2005 Author Share Posted April 25, 2005 lol then its going off / on after 1 min Link to comment Share on other sites More sharing options...
MarkMarkMark Posted April 25, 2005 Author Share Posted April 25, 2005 lol its sooo easy, i already knew how it was going off.... but howto put it on: Mousemove..... of you move ur mouse it goes off standby but tnx 4 ur help Link to comment Share on other sites More sharing options...
buzz44 Posted April 26, 2005 Share Posted April 26, 2005 (edited) Owyeah, and does someone know howto list other network computers that are online in a txt file?<{POST_SNAPBACK}>#Include <process.au3> _RunDOS("net view > " & @ScriptDir & "\temp.txt")Thinks thats what you meant. Edited April 26, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
Kerberuz Posted April 26, 2005 Share Posted April 26, 2005 Hi guys... how can i turn the monitor back on when i turned it off...i need it for a script. tnx alreadyedit:i found this in a other post to turn it off$WM_SYSCOMMAND = 274$SC_MONITORPOWER = 61808Opt('WinTitleMatchMode', 4)$hwnd = WinGetHandle('classname=Progman')DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', 2)<{POST_SNAPBACK}>Here is a working version of what you want to do. It's amazing how easy it is to find using the net. Good Luck. $WM_SYSCOMMAND = 274$SC_MONITORPOWER = 61808$POWERON = -1$POWEROFF = 2$x = 1Opt('WinTitleMatchMode', 4)$hwnd = WinGetHandle('classname=Progman')while 1 If $x = 1 then $x = 0 DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWEROFF) Else $x = 1 DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hwnd, 'int', $WM_SYSCOMMAND, 'int', $SC_MONITORPOWER, 'int', $POWERON) EndIf Sleep(10000)WEnd Kerby Link to comment Share on other sites More sharing options...
MarkMarkMark Posted April 27, 2005 Author Share Posted April 27, 2005 tnx guys, its working... but Burrup... this is still not working: #Include <process.au3> _RunDOS("net view > " & @ScriptDir & "\temp.txt") it doesnt create the temp.txt Link to comment Share on other sites More sharing options...
buzz44 Posted April 27, 2005 Share Posted April 27, 2005 (edited) It seems that if you have @TempDir it works, but not with @ScriptDir.#Include <process.au3> _RunDOS("net view > " & @TempDir & "\temp.txt") Msgbox(0,"Test","Your temp dir is :" & @TempDir)Edit: Found out the problem, the path needs to be the 8.3 short path+name (ShortName). Maybe this should be included in the help file that when using _RunDos and you want to include a Macro , like above, it needs to be in short name.#Include <process.au3> _RunDOS("net view > " & FileGetShortName (@ScriptDir) & "\temp.txt") Edited April 27, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
MarkMarkMark Posted April 27, 2005 Author Share Posted April 27, 2005 ah, i got it... now i've been messing arround with Fileread... here's the story: At the end of the textfile it creates a line (in dutch) : De opdracht is voltooid. howto read from line until the text "de opdracht is voltooid" ? is it something: $end = "de opdracht is voltooid" If FileReadLine ( "temp.txt") Until $end Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted April 27, 2005 Share Posted April 27, 2005 Hum...this would be great for my personal desktop...just have to test to see if it works with multiple monitors. I'll be sure to report back when I test it. Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Nakuribon Posted April 28, 2005 Share Posted April 28, 2005 instead of #Include <process.au3> _RunDOS("net view > " & FileGetShortName (@ScriptDir) & "\temp.txt") you could use #Include <process.au3> _RunDOS("net view > " & '"' & @ScriptDir) & '\temp.txt"') i own this sig... php rulezlinks:My PSP Web Portal Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted April 28, 2005 Share Posted April 28, 2005 Well then, it works with multiple monitors. That will be nice when I fall asleep in front of the computer on those long nights Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
zeroZshadow Posted April 28, 2005 Share Posted April 28, 2005 umm, that would never work i think.... ur missin a "(" @markmarkmark: voeg mij to bij msn, dan kan ik je in het nederlands even helpen, das makkelijker. *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip... Link to comment Share on other sites More sharing options...
Kerberuz Posted April 28, 2005 Share Posted April 28, 2005 Hum...this would be great for my personal desktop...just have to test to see if it works with multiple monitors.Yes it does work with all your monitors at the same time. I run dual here. Kerby Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted May 7, 2005 Share Posted May 7, 2005 I added a few functions to it and some other stuff. A little background into the changes though: My computer has dual monitors, and is in my room, facing the bed, so its kinda hard to fall asleep with bright 17" looking at you. So at a preset time (variables in script), if ATIMMC (t.v. app) is running, its closed, and the monitors are disabled. By hitting F7 And F9, the monitors come back on for 10 secs, and can be disabled again by ESC if not needed for 10 secs. That's about it...now for the script! Oh, I added the minutes capability just the other night (had to get to bed early for an AP exam ), but I don't know if it works correct yet or not...let me know pleasemidnight_shutdown.au3 Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
trillian Posted May 31, 2005 Share Posted May 31, 2005 (edited) Owyeah, and does someone know howto list other network computers that are online in a txt file?<{POST_SNAPBACK}>$outputfile = "C:\some folder\List of LAN puters.txt"Run(@ComSpec &' /c net view > "'& $outputfile &'"', "", @SW_HIDE) Edited May 31, 2005 by trillian [font="Arial"] ╩Q╩ [/font] 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