blizzedout Posted March 11, 2006 Share Posted March 11, 2006 Not allow more then 1 of the same windows? Like lets say there are two IE windows open would the be a way for AI to find out and close one ? Link to comment Share on other sites More sharing options...
greenmachine Posted March 11, 2006 Share Posted March 11, 2006 If you start it as a new process (like, click the IE icon on the desktop twice), there will be two IEXPLORE.EXE processes in the task manager. Then, you should have gotten the PID from the Run command that started IE so you can know if there are other IE processes that don't match that PID, and close them. If it just starts a new window (such as a popup), you should get the updated window title/text from the window you want to keep open, and close the rest of the windows that don't have that title and text, but do have "- Microsoft Internet Explorer". Link to comment Share on other sites More sharing options...
blizzedout Posted March 11, 2006 Author Share Posted March 11, 2006 If you start it as a new process (like, click the IE icon on the desktop twice), there will be two IEXPLORE.EXE processes in the task manager. Then, you should have gotten the PID from the Run command that started IE so you can know if there are other IE processes that don't match that PID, and close them. If it just starts a new window (such as a popup), you should get the updated window title/text from the window you want to keep open, and close the rest of the windows that don't have that title and text, but do have "- Microsoft Internet Explorer".It just opens up two of the same windows with the same process. Link to comment Share on other sites More sharing options...
greenmachine Posted March 11, 2006 Share Posted March 11, 2006 I answered that too. Try reading next time. Link to comment Share on other sites More sharing options...
blizzedout Posted March 11, 2006 Author Share Posted March 11, 2006 I answered that too. Try reading next time.They have the same titles. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 11, 2006 Moderators Share Posted March 11, 2006 $WinNotToRepeat = WinGetHandle('Name - Microsoft Internet Explorer') While 1 _AllowOnlyOne($WinNotToRepeat) Sleep(100) WEnd Func _AllowOnlyOne($SingleWindow) $w_Winlist = WinList() For $i = 1 To $w_Winlist[0][0] If $w_Winlist[$i][0] == WinGetTitle($SingleWindow) And $w_Winlist[$i][1] <> $SingleWindow Then WinClose($w_Winlist[$i][1]) Next EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
blizzedout Posted March 11, 2006 Author Share Posted March 11, 2006 $WinNotToRepeat = WinGetHandle('Name - Microsoft Internet Explorer') While 1 _AllowOnlyOne($WinNotToRepeat) Sleep(100) WEnd Func _AllowOnlyOne($SingleWindow) $w_Winlist = WinList() For $i = 1 To $w_Winlist[0][0] If $w_Winlist[$i][0] == WinGetTitle($SingleWindow) And $w_Winlist[$i][1] <> $SingleWindow Then WinClose($w_Winlist[$i][1]) Next EndFuncthanks, I would of never been able to comeup with this lol. Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 11, 2006 Share Posted March 11, 2006 (edited) thanks, I would of never been able to comeup with this lol.that script is EVIL! first it made it made windows go crazy, and then ate my hotkeys program! zeroed all the keys! I try it without internet explorer open.. Edited March 11, 2006 by slightly_abnormal Link to comment Share on other sites More sharing options...
Valuater Posted March 11, 2006 Share Posted March 11, 2006 I was wondering about that... if it kills internet explorer... then there would be a problem then i thought about winkill.... Although WinKill can work on both minimized and hidden windows, some windows (notably explorer windows) can only be terminated using WinClose. at least the explorer would not close 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2006 Moderators Share Posted March 12, 2006 (edited) that script is EVIL! first it made it made windows go crazy, and then ate my hotkeys program! zeroed all the keys! I try it without internet explorer open..LOL... That's kind of funny.... I would think you would put the Acutal Titel in there, not a sub title! (P.S... If you use this, and there is no title that matches, it's probably going to take the title of the first active window.) I agree Valuater... WinKill() might have been a better option there... Maybe even to make sure the window was visible as an option....This should be safer for the people that don't take precautions before they use an UDFDim $WinNotToRepeat = WinGetHandle('Name - Microsoft Internet Explorer') While 1 _ThereCanBeOnlyOne($WinNotToRepeat) Sleep(100) WEnd Func _ThereCanBeOnlyOne($w_High_Lander, $w_Kill_Close = 0, $i_IsVisible = 0); $w_Kill_Close = 0 it will use WinKill if will use WinClose If $w_High_Lander <> '' Then $w_Winlist = WinList() For $i = 1 To $w_Winlist[0][0] If $i_IsVisible = 0 Then If $w_Winlist[$i][0] == WinGetTitle($w_High_Lander) And $w_Winlist[$i][1] <> $w_High_Lander And BitAnd(WinGetState($w_Winlist[$i][1]), 2) Then If $w_Kill_Close = 0 Then WinKill($w_Winlist[$i][1]) Else WinClose($w_Winlist[$i][1]) EndIf EndIf Else If $w_Winlist[$i][0] == WinGetTitle($w_High_Lander) And $w_Winlist[$i][1] <> $w_High_Lander Then If $w_Kill_Close = 0 Then WinKill($w_Winlist[$i][1]) Else WinClose($w_Winlist[$i][1]) EndIf EndIf EndIf Next EndIf EndFunc Edited March 12, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted March 12, 2006 Share Posted March 12, 2006 I agree Valik... WinKill() might have been a better option thereVultar, Vulture... and now Valik???8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2006 Moderators Share Posted March 12, 2006 (edited) Vultar, Vulture... and now Valik???8)What are you talking about Edited March 12, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted March 12, 2006 Share Posted March 12, 2006 What are you talking about _ThereCanBeOnlyOne(' Valuater ')lol8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 12, 2006 Moderators Share Posted March 12, 2006 _ThereCanBeOnlyOne(' Valuater ')lol8)You like the new function name and parameter name? wonder if anyone will get it . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
greenmachine Posted March 12, 2006 Share Posted March 12, 2006 There can be only one High Lander! Link to comment Share on other sites More sharing options...
slightly_abnormal Posted March 12, 2006 Share Posted March 12, 2006 There can be only one High Lander!it's easier to call him/her val Link to comment Share on other sites More sharing options...
greenmachine Posted March 12, 2006 Share Posted March 12, 2006 You didn't get it. 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