|
You last visited: Today at 07:28
Advertisement
Console application
Discussion on Console application within the AutoIt forum part of the Coders Den category.
06/11/2016, 21:57
|
#1
|
elite*gold: 0
Join Date: Jan 2013
Posts: 103
Received Thanks: 23
|
Console application
Hi guys,
I want to make a console application in AutoIt.
Something like a console application in C#.
Does someone know how to make it?
|
|
|
06/11/2016, 23:47
|
#2
|
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
|
|
|
|
06/12/2016, 00:45
|
#3
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Just use the AutoIt3 Compiler Wrapper and click on "Compile with CLI instead of GUI" and use ConsoleWrite to output your messages.
|
|
|
06/12/2016, 00:51
|
#4
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
|
Hi here is an example for u to begin.
Stop being so selfish, that's why we got an autoit forum to help others... not being rude,
nobody will ask if the solution is to search in google.
Searching in google is not always the best option.
You can compile as usual and create a gui if u want too (need to be compiled to get the console view)
Code:
Global Const $STD_OUTPUT_HANDLE = -11
Global Const $STD_INPUT_HANDLE = -10
Func AllocConsole ()
return DllCall ("Kernel32.dll", "int", "AllocConsole")
EndFunc
Func setTitle($title)
DllCall("Kernel32.dll","none","SetConsoleTitleA","str",$title)
EndFunc
Func std_output_handle()
$r = DllCall("Kernel32.dll","HANDLE","GetStdHandle","dword",$STD_OUTPUT_HANDLE)
Return $r[0]
EndFunc
Func std_input_handle()
$r = DllCall("Kernel32.dll","HANDLE","GetStdHandle","dword",$STD_INPUT_HANDLE)
Return $r[0]
EndFunc
Func setModeInput()
DllCall("Kernel32.dll","BOOL","HANDLE",$inHandle,0x0002)
EndFunc
Func _ConsoleWriteln($text)
$text = $text & @CRLF
DllCall("Kernel32.dll","BOOL","WriteConsole","HANDLE",$outHandle,"str",$text,"DWORD",StringLen($text),"dword*", 0, "ptr", 0)
EndFunc
Func _ConsoleRead()
$out = DllStructCreate("char[255]")
setModeInput()
DllCall("Kernel32.dll","BOOL","ReadConsole","HANDLE",$inHandle,"struct*",$out,"DWORD",255,"dword*", 0, "ptr", 0)
$data = DllStructGetData($out,1)
Return $data
EndFunc
AllocConsole() ;Create console
setTitle("Test console application")
$outHandle = std_output_handle()
$inHandle = std_input_handle()
_ConsoleWriteln("What's your name?")
$input = _ConsoleRead()
MsgBox(0,"you said",$input)
While 1
WEnd
|
|
|
06/12/2016, 10:41
|
#5
|
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
|
Quote:
Originally Posted by elmarcia
Stop being so selfish, that's why we got an autoit forum to help others... not being rude,
|
You know that this is a question where you can find the answer within the first minute of googling right? If everyone would state a question here without googling first we would drown in threads.
|
|
|
06/20/2016, 10:24
|
#6
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
|
|
|
 |
Similar Threads
|
[C++] How to make Trainer Console Application
01/12/2016 - C/C++ - 8 Replies
Please
|
[C++] How to make trainer c++ console Application
12/13/2015 - C/C++ - 7 Replies
say How to make trainer c++ console Application please
i want make trainer
|
[C#] Console-Application crasht bei SetConsoleCtrlHandler und Console.ReadLine()
05/11/2015 - .NET Languages - 4 Replies
Servus!
Ich habe derzeit ein komisches Problem:
Ich schreibe eine Konsolenanwendung und möchte, bevor die Konsole geschlossen wird, den Speicher aufräumen (manuelles GC).
private delegate bool ConsoleEventDelegate(int eventType);
private static extern bool SetConsoleCtrlHandler(ConsoleEventDelegate callback, bool add);
|
[Coding] C# Application Project vs. C# Console Project Threading
07/01/2011 - .NET Languages - 0 Replies
Hey, so I'm coding a private server... and I was just wondering:
Is there a difference between Console Project threading and Application threading? I'm going to add a GUI into the console project if I can't do an Application project for other reasons, so putting the extra thread aside (for the Application running), is there a significant difference?
Thanks.
Sincerely,
Fang
|
All times are GMT +1. The time now is 07:28.
|
|