isolation Posted March 26, 2009 Posted March 26, 2009 Hi I've done this script but it doesn't work: $a=WinGetProcess("[ACTIVE]") WinSetState(retrivehandle($a),"",@SW_MINIMIZE) Func retrivehandle($pid) $list = WinList() for $i = 1 to $list[0][0] If WinGetProcess($list[$i][1])=$pid Then Return $list[$i][1] next Return -1 EndFuncoÝ÷ Øý½ëkçpØVp¥¢ÇºwÒ-)ä¶¶ªºm{jºij¶¦z׫ËazènW¦mçºÇ+0¢¹,jëh×6$a=WinGetProcess("[ACTIVE]") WinClose(retrivehandle($a))oÝ÷ Ù»ÐÎ#wõ Is the WinClose problem like the WinSetState one? Is there a default value?(I've already tried with Default but it doesn't work)
youknowwho4eva Posted March 26, 2009 Posted March 26, 2009 lol your script makes it so I can move my Nvidia controls. I believe the issue is your mixing pid and handle. Replace wingetprocess with wingethandle Giggity
isolation Posted March 26, 2009 Author Posted March 26, 2009 This is only a piece of script, however I obtain the same result with wingethandle: winsetstate doesn't work!
youknowwho4eva Posted March 26, 2009 Posted March 26, 2009 $a=WinGetHandle("[ACTIVE]") WinSetState(retrivehandle($a),"",@SW_MINIMIZE) Func retrivehandle($pid) $list = WinList() for $i = 1 to $list[0][0] If WinGetHandle($list[$i][1])=$pid Then Return $list[$i][1] next Return -1 EndFunc Works for me. Ran in Scite, Minimizes Scite. Giggity
isolation Posted March 26, 2009 Author Posted March 26, 2009 (edited) It doesn't for me... but I use the last version of Autoit..... Edit:I've also captured the return value of winsetstate and it is setted to 1 Edited March 26, 2009 by isolation
AdmiralAlkex Posted March 26, 2009 Posted March 26, 2009 @isolation I am not sure what the problem is but it works if I use the title: $a=WinGetProcess("[ACTIVE]") WinSetState(retrivehandle($a), "",@SW_MINIMIZE) Func retrivehandle($pid) $list = WinList() for $i = 1 to $list[0][0] If WinGetProcess($list[$i][1])=$pid Then Return $list[$i][0] next Return -1 EndFunc Or you could use WinGetHandle() as youknowwho4eva said. $a=WinGetHandle("[ACTIVE]") WinSetState(retrivehandle($a), "",@SW_MINIMIZE) Func retrivehandle($handle) $list = WinList() for $i = 1 to $list[0][0] If $list[$i][1]=$handle Then Return $list[$i][1] next Return -1 EndFunc @youknowwho4eva Your example makes no sense. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
youknowwho4eva Posted March 26, 2009 Posted March 26, 2009 i just replaced wingetprocess with wingethandle, I didn't change his function names or his variables... I just noticed I was getting the handle of the handle but it still worked so eh. Giggity
AdmiralAlkex Posted March 26, 2009 Posted March 26, 2009 i just replaced wingetprocess with wingethandle, I didn't change his function names or his variables... I just noticed I was getting the handle of the handle but it still worked so eh.But you're wasting cpu-cycles .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
isolation Posted March 26, 2009 Author Posted March 26, 2009 $a=WinGetProcess("[ACTIVE]") is only for example the pid passed to retrivehandle func can be of any process
AdmiralAlkex Posted March 26, 2009 Posted March 26, 2009 $a=WinGetProcess("[ACTIVE]") is only for example the pid passed to retrivehandle func can be of any processWorks for me with "[ACTIVE]" when I have SciTE opened .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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