Caster Posted July 21, 2012 Share Posted July 21, 2012 I am currently working on a (small) project, which will set my pc screen blank for x seconds and then turn it back on. The code looks like this now (I've copied the blackscreen func and put some other variables in): func BlackFor($time) Global $untilback = $time EndFunc BlackFor(5000); Sets how long the screen should be black, in milliseconds. func screenFlicker() Opt("WinTitleMatchMode", 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_On = -1 $Power_Off = 2 $X = 1 $HWND = WinGetHandle("classname=Progman") DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_Off) Sleep($untilback) DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_On) endFunc screenFlicker() But, when I start a project and it works, I want to make it even better. So I thought about a GUI which sets the milliseconds to a config file. I understand the GUI part, but I need a solution of a config file. I saw a topic some months ago with a config script saver - which I can't find anymore. I've searched on Google, AutoIt forums.. can't find that excact one. It had functions like ConfgWrite and ConfgRead I think. I've looked into the AutoIt config systems, but I really want a config to be saved somewhere on a pc - easy to edit even without the editor I'll make for the script. The reason I want this screen-flicker, is that it might come good in the future :3 Even though I know that there are lots of these already... -CasterAnd Link to comment Share on other sites More sharing options...
Jeff987 Posted July 21, 2012 Share Posted July 21, 2012 check the help file for iniread(), you can make a file that contains your variable and the value of that variable. then it will allow you to change the value whenever you want. 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