Re: How to avoid windows console with stdin
- Posted by Larry Miller <larrymiller at sasktel.net> Apr 27, 2006
- 430 views
By default all windows programs will receive standard input from the console. If the program does not have a console then the exw interpreter will open one for you. The exw interpreter will not use a previously opened console. If you are writing a console application then using exwc.exe would be the way to go. This interpreter will use an existing console. You can prevent a console from being opened by first redirecting standard input to a file. Euphoria does not have a native function to do this but it may be done with the API function SetStdHandle(), which expects as input a handle to the desired file. Unfortunately, Euphoria's open() function can not be used to obtain this handle. open() obtains a private handle that can only be used by the native Euphoria file functions. A suitable file handle can be obtained by using the API function CreateFile(). The function is badly named but performs the same function as Euphoria's open(). CreateFile() has many options and can be quite confusing. I haven't used Win32Lib in some time but I do not believe it has this function. It seems to me that there must be an alternative to using standard input in this case. I haven't actually done this but I believe the process outlined is accurate. If I had a better idea of what you were trying to accomplish I could be of more help. Larry Miller