afsar Posted August 18, 2005 Posted August 18, 2005 hi to all, when i am installing our company software automatically a command promt window also occurs while installing. how can i know by script that command prompt windows exixts or not. i tried with if processexists("cmd.exe") then msgbox(4096,"windows existence"," window exists") bla bla bla endif but i didnt get any messagebox even the command prompt window is active thanks for help in advance Afsar
BigDod Posted August 18, 2005 Posted August 18, 2005 You could try If WinExists("Command Prompt") Then MsgBox(0, "", "Window exists") EndIf BTW This is straight from the help files. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
afsar Posted August 18, 2005 Author Posted August 18, 2005 You could tryIf WinExists("Command Prompt") Then MsgBox(0, "", "Window exists") EndIf BTWThis is straight from the help files. <{POST_SNAPBACK}>if the command prompt window name is like..C:\wINDOWs\Microsoft.Net\..... then also can i use as winexists("command Prompt") ?
BigDod Posted August 18, 2005 Posted August 18, 2005 if the command prompt window name is like..C:\wINDOWs\Microsoft.Net\..... then also can i use as winexists("command Prompt") ?<{POST_SNAPBACK}>Change the words "Command Prompt" to whatever the window is called. If you are not sure of the window name use "Autiit Window Info" Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
afsar Posted August 18, 2005 Author Posted August 18, 2005 Change the words "Command Prompt" to whatever the window is called. If you are not sure of the window name use "Autiit Window Info"<{POST_SNAPBACK}>ya i tried with that but the command prompt window with the same window name which has hidden property then also showing the messagebox.and the hidden command prompt windows exists through the end of setup.Is there any possible to display messagebox only for active display windows and not for active hidden windows
BigDod Posted August 18, 2005 Posted August 18, 2005 ya i tried with that but the command prompt window with the same window name which has hidden property then also showing the messagebox.and the hidden command prompt windows exists through the end of setup.Is there any possible to display messagebox only for active display windows and not for active hidden windows<{POST_SNAPBACK}>Sorry but you have lost me, I have no idea what you are trying to do. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
afsar Posted August 18, 2005 Author Posted August 18, 2005 Sorry but you have lost me, I have no idea what you are trying to do.<{POST_SNAPBACK}>OK, i am using wingettitle for windows title like..$WinTitle = WinGetTitle( '', '' ) if StringInStr ( $WinTitle, 'InstallShield Wizard') > 0 then CheckWinText ( ) endif if StringInStr ( $WinTitle, 'C:\WINDOWS\Microsoft.NET\') > 0 then CheckWinText ( ) endifFunc checkwintext()if winactive($WinTitle,'Preparing to Install...')send('{ENTER}')endifif winactive($WinTitle,'') ; becos we cant read command prompt text and we cant give the textmsgbox(0,"","Window Exists")endifendfuncbut the problem is this wingettitle returns a string for hidden windows also.i need a window title for only active windows..hope u get an idea now..
BigDod Posted August 18, 2005 Posted August 18, 2005 (edited) Could you not use something like WinWaitActive for your installation program rather than searching all active windows for title. EDIT Code added If WinWaitActive("Window Title") Then Send("{ENTER}") EndIf Edited August 18, 2005 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
afsar Posted August 18, 2005 Author Posted August 18, 2005 Could you not use something like WinWaitActive for your installation program rather than searching all active windows for title.EDITCode addedIf WinWaitActive("Window Title") Then Send("{ENTER}") EndIf<{POST_SNAPBACK}>i cant use like that cos i am testing the software for errors..so i have to search all the window titles and compare it..i am using 1 script for 3 installations..so i must search for titles..
jdickens Posted August 18, 2005 Posted August 18, 2005 I'll bet there is a better way, but you could determine if the window you're after is hidden or not: "WinGetPos returns negative numbers such as -32000 for minimized windows, but works fine with (non-minimized) hidden windows. If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used." --from help file. J If I am too verbose, just say so. You don't need to run on and on.
BigDod Posted August 18, 2005 Posted August 18, 2005 I think that this is beyond my limited knowledge so I will have to leave it and hope that someone else picks it up. Sorry :"> :"> :"> Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother
afsar Posted August 18, 2005 Author Posted August 18, 2005 I think that this is beyond my limited knowledge so I will have to leave it and hope that someone else picks it up.Sorry :"> :"> :"><{POST_SNAPBACK}>thanx for ur help.. keep posting..
afsar Posted August 18, 2005 Author Posted August 18, 2005 I'll bet there is a better way, but you could determine if the window you're after is hidden or not:"WinGetPos returns negative numbers such as -32000 for minimized windows, but works fine with (non-minimized) hidden windows.If the window title "Program Manager" is used, the function will return the size of the desktop. If multiple windows match the criteria, the most recently active window is used."--from help file.J<{POST_SNAPBACK}>in my installation the window C:\WINDOWS\Microsoft is almost active but hidden till the end of setup. but only twice it is active and display the window as command prompt with title C:\Windows\Microsoft...can u tell me how to find thw window is hidden or not...my be i can use this b4 enetering into the function
LxP Posted August 18, 2005 Posted August 18, 2005 opt("winTitleMatchMode", 4) if winActive("classname=ConsoleWindowClass") then msgBox(0x40040, "AutoIt", "Window exists.") ; (other commands) endIf Does this do what you want?
LxP Posted August 18, 2005 Posted August 18, 2005 (edited) My above post was in relation to determining if a console window is active. To determine if it is hidden:opt("winTitleMatchMode", 4) if not(bitAND(winGetState("classname=ConsoleWindowClass"), 2)) then msgBox(0x40040, "AutoIt", "Window exists but is not visible.") ; (other commands) endIf Edited August 18, 2005 by LxP
afsar Posted August 19, 2005 Author Posted August 19, 2005 My above post was in relation to determining if a console window is active. To determine if it is hidden:opt("winTitleMatchMode", 4) if not(bitAND(winGetState("classname=ConsoleWindowClass"), 2)) then msgBox(0x40040, "AutoIt", "Window exists but is not visible.") ; (other commands) endIf<{POST_SNAPBACK}>Thanx, i hope that helps me..i try it on next week again in Company..i will update u soon
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