wraithdu Posted December 11, 2012 Share Posted December 11, 2012 (edited) I'm not sure whether to classify this as a bug or not yet, but this simple script no longer seems to work in Win 8 when compiled as CUI. It should pause and wait for input as it does on Win 7, but it just exits immediately. You can still see that the 'pause' command prints its text however. Any ideas, or go with bug and I'll open a ticket? #NoTrayIcon #AutoIt3Wrapper_Change2CUI=y RunWait(@ComSpec & " /c pause", "", Default, 0x10) It's strange that something as basic as this would change from Win 7 to 8. Edited December 11, 2012 by wraithdu Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 12, 2012 Share Posted December 12, 2012 What happens if you were to run that command line yourself in the prompt? Link to comment Share on other sites More sharing options...
wraithdu Posted December 12, 2012 Author Share Posted December 12, 2012 Normal behavior, just like a .bat file. Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 13, 2012 Share Posted December 13, 2012 Ok. Couple questions on the code. Why are you passing the default keyword for window state? That results in a hidden window which seems like it would cause issues when you want it to share the CUI. I don't imagine that's the problem though. Second, what's this 0x10 flag? I don't see that documented anywhere. Link to comment Share on other sites More sharing options...
BrewManNH Posted December 13, 2012 Share Posted December 13, 2012 From looking at the help file for RunWait, using 0x10000 in the last parameter spawns a new console window, but you're hiding it by using the Default keyword. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
wraithdu Posted December 13, 2012 Author Share Posted December 13, 2012 (edited) The show state is irrelevant. The 0x10 flag means to use the existing console window (as opposed to creating a new window, see the Run() command), which is visible by default since it is compiled as a CUI. So the command runs in the context of the existing console window. Try it on Win7, it works as it should. The diff on Win8 is that it doesn't pause and wait for input, it just blows right through and exits. You really think I'd post non-working code without testing it... gimme a little credit here Edited December 13, 2012 by wraithdu Link to comment Share on other sites More sharing options...
BrewManNH Posted December 13, 2012 Share Posted December 13, 2012 (edited) No offence intended, I just confused 0x10 and 0x10000 in my head. Perhaps when that value ($STDIO_INHERIT_PARENT = 0x10) was added to the Runxxx commands something was done incorrectly and it took Windows 8 to discover it. Edited December 13, 2012 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
wraithdu Posted December 13, 2012 Author Share Posted December 13, 2012 (edited) I think you're probably right about the flags param. There was some other weirdness I remember as well when trying to read console input using Mat's console UDF (ReadConsole API function). Here's the addition and note I made: ; ugly fix for input handle when script is compiled as CUI, otherwise reading input fails _WinAPI_CreateFile("CONIN$", 2, 6, 6) So I definitely think that console mode and IO streams needs to be revisited. Edited December 13, 2012 by wraithdu Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 16, 2012 Share Posted December 16, 2012 I never said it was invalid, only that I didn't see it documented anywhere. 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