bigred Posted November 21, 2005 Share Posted November 21, 2005 Why is this not hiding the window? Actually come to think of it I don't think I've ever got the @SW_HIDE command to work. Is it intended for something else? Is there anyone method for hiding a window? This is a little script that turns off the power managment feature of my Dell D610's Ethernet adaptor, and then turns it back on. AutoItSetOption ( "RunErrorsFatal", 1 ) $run = Run("Control.exe NicConfigSvc.Cpl", "C:\WINDOWS\system32", @SW_HIDE) $winchk = WinWait("Internal Network Card Power Management", "", 5) ControlCommand("Internal Network Card Power Management", "", "Button2", "Check", "") ControlClick("Internal Network Card Power Management", "", "Button7") ControlClick("Internal Network Card Power Management", "", "Button8") Sleep (5000) $run = Run("Control.exe NicConfigSvc.Cpl", "C:\WINDOWS\system32", @SW_HIDE) $winchk = WinWait("Internal Network Card Power Management", "", 5) ControlCommand("Internal Network Card Power Management", "", "Button1", "Check", "") ControlClick("Internal Network Card Power Management", "", "Button7") ControlClick("Internal Network Card Power Management", "", "Button8") Exit Link to comment Share on other sites More sharing options...
Developers Jos Posted November 21, 2005 Developers Share Posted November 21, 2005 Why is this not hiding the window? Actually come to think of it I don't think I've ever got the @SW_HIDE command to work. Is it intended for something else?Is there anyone method for hiding a window? Control.exe isn't the program that you see... thats rundll32.exe. Maybe this post helps? http://www.autoitscript.com/forum/index.ph...ndpost&p=125175 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
bigred Posted November 21, 2005 Author Share Posted November 21, 2005 Is this as good as I can make it? On the frist 'run' the windows is not displayed at all, but the second time through after the sleep it is displayed for a few seconds. Is there any other way to hide the window? Is my code ok? AutoItSetOption ( "RunErrorsFatal", 1 ) Opt('WinWaitDelay', 10) $run = Run("Control.exe NicConfigSvc.Cpl", "C:\WINDOWS\system32") $winchk = WinWait("Internal Network Card Power Management", "", 5) WinSetState("Internal Network Card Power Management", "", @SW_HIDE) Opt('WinWaitDelay', 250) ControlCommand("Internal Network Card Power Management", "", "Button2", "Check", "") ControlClick("Internal Network Card Power Management", "", "Button7") ControlClick("Internal Network Card Power Management", "", "Button8") Sleep (5000) Opt('WinWaitDelay', 10) $run = Run("Control.exe NicConfigSvc.Cpl", "C:\WINDOWS\system32") $winchk = WinWait("Internal Network Card Power Management", "", 5) WinSetState("Internal Network Card Power Management", "", @SW_HIDE) Opt('WinWaitDelay', 250) ControlCommand("Internal Network Card Power Management", "", "Button1", "Check", "") ControlClick("Internal Network Card Power Management", "", "Button7") ControlClick("Internal Network Card Power Management", "", "Button8") Exit Link to comment Share on other sites More sharing options...
LxP Posted November 22, 2005 Share Posted November 22, 2005 Does this work any better? -- Opt('RunErrorsFatal', 1) Opt('WinWaitDelay', 0) Local Const $Title = 'Internal Network Card Power Management' Run('Control NicConfigSvc.Cpl', @SystemDir) WinWait($Title) WinSetState($Title, '', @SW_HIDE) ControlCommand($Title, '', 'Button2', 'Check') ControlClick($Title, '', 'Button7') ControlClick($Title, '', 'Button8') WinWaitClose($Title) Run('Control NicConfigSvc.Cpl', @SystemDir) WinWait($Title) WinSetState($Title, '', @SW_HIDE) ControlCommand($Title, '', 'Button1', 'Check') ControlClick($Title, '', 'Button7') ControlClick($Title, '', 'Button8') Exit Link to comment Share on other sites More sharing options...
bigred Posted November 22, 2005 Author Share Posted November 22, 2005 No, pretty much the same, if not slighty worse. But thank you for cleaning up my code. Your's is much nicer! 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