Sign in to follow this  
Followers 0
Unc3nZureD

Hide CUI

5 posts in this topic

#1 ·  Posted (edited)

Hi guys,

I would like to create an application that uses CUI, and consolewrite.

At compiling I set the CUI enabled and It works well.

#AutoIt3Wrapper_Change2CUI=y

Now I have only one question:

Is there any way to hide/delete the CUI?

(I write something on it, let it be there for some sec, then it would disappear)

Thanks a lot:

Unc3nZureD

Edited by Unc3nZureD

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

The only benefit of using CUI is that, when you run a script from the COMMANDPROMPT, the ConsoleWrite() output is shown in this CMD window and can be Piped into a file or something.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You have to search for the CMD windows and hide it:

Something like that:

$var = WinList()
For $i = 1 To $var[0][0]
    If $var[$i][0] <> "" And BitAND(WinGetState($var[$i][1]), 2) Then
        If WinGetProcess($var[$i][0], "") = @AutoItPID Then
            WinSetState($var[$i][1], "", @SW_HIDE)
            ExitLoop
        EndIf
    EndIf
Next

I used the code above in Head-Tail to have a semi CLI version.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Thanks, I tried this method and works well :)

In my opinion (I'm not sure) CUI might mean Console User Interface, hm?

Edited by Unc3nZureD

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • TheAutomator
      By TheAutomator
      A fullscreen console with custom commands!

      Introduction:
      Hi everyone!
      This funny project started as a question in the help section:
      https://www.autoitscript.com/forum/topic/174404-edit-detect-key-before-updating-content/
      I'd like to share this script with everyone that is interested. 
       
      Why would I want it?
      You like the old style fullscreen console (like in the old day's), You can add custom commands, You can customize the font a lot more compared to cmd.exe, You can share ideas or add tweaks to the script.  
      What's next?
      I'm planning to add my own programming language to it!
      Its going to be implemented with an ActiveX COM dll.
      The syntax is going to be a bit like Lua I guess, any ideas are welcome!
       
      Todo:
      Add sounds. Make an icon / logo. Design a better grammar ( Backus-Naur-vorm: https://nl.wikipedia.org/wiki/Backus-Naur-vorm ). Make test "Console-Scripts" for it. Add a file type for script files ( like batch scripts ). Clean up and modify Console.Au3 content. Add an option to have to type a login password (maybe). Call neo   
      Thanks to:
      xxaviarxx: debugging, some ideas. jguinch: debugging, adding a bunch of tweaks and ideas. kylomas: debugging, new ideas.  
      Edits and updates:
      Added tab key Main edit has focus now on startup Made a pdf that explains the upcoming programming language (need feedback about it!)  
      Until the dll is ready you can have fun with what I already have, hope you like it!
      UDF can be downloaded from the attachments.
      Regards
       
      [The programming language part is been postponed]
      [It's been a while, made a custom recursive descent parser in AutoIt, language and updates will be uploaded soon!]
       
      TheAutomator
       
      Console.au3
      ConsoleScript.pdf
    • FMS
      By FMS
      Hello,
      As I was searching this forum I came along something intresting what was new to me.
      CUI/GUI hybrid.
      Whish sounds very usefull to me to compile it all into 1 script.
      So i was fideling around whit it but couldn't get it to work.
      In the real script (not this simplified version) i got a lot of functions whish i can use whan talking to it by commandline and switches.
      I could not get this to work and hope somebody could give me some pointers on how to make it work.
      Also I was hoping iff somebody could help me whit the /? function?
      (I don't know how to output the help text back to the commandline or the function that can help me do it)
      please advice and thanks in advanced.
      #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Change2CUI=y #include <Process.au3> #include <Array.au3> If $CmdLine[0] = 0 Then If _ProcessGetName(ProcessGetParent(@AutoItPID)) = "cmd.exe" Then ;ConsoleWrite("Program was started in CMD" & @CRLF) If Mod($CmdLine[0], 2) <> 0 Then Exit MsgBox(16, $sTitle, "Invalid number of parameters! has to be a multiple of 2!") If $CmdLine[0] = 0 Then Exit MsgBox(16, $sTitle, "No parameters passed!") For $i = 1 To $CmdLine[0] Step 2 If $CmdLine[$i] = "/switch" Then MsgBox(64, "Passed Parameters", "/switch is " & $CmdLine[$i+1]) If $CmdLine[$i] = "/?" Then MsgBox(64, "Passed Parameters", "/? " ) Next _ArrayDisplay($CmdLine) Else #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 239, 65, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 32, 24, 75, 25) $Button2 = GUICtrlCreateButton("Button2", 120, 24, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 button1() Case $button2 button2() EndSwitch WEnd EndIf EndIf Exit Func button1() MsgBox(16, "title", "button1()!") EndFunc Func button2() MsgBox(16, "title", "button1()!") EndFunc Func ProcessGetParent($i_PID) ;get PID from parent process done by SmOke_N Local $TH32CS_SNAPPROCESS = 0x00000002 Local $a_tool_help = DllCall("Kernel32.dll", "long", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPPROCESS, "int", 0) If IsArray($a_tool_help) = 0 Or $a_tool_help[0] = -1 Then Return SetError(1, 0, $i_PID) Local $tagPROCESSENTRY32 = _ DllStructCreate( _ "dword dwsize;" & _ "dword cntUsage;" & _ "dword th32ProcessID;" & _ "uint th32DefaultHeapID;" & _ "dword th32ModuleID;" & _ "dword cntThreads;" & _ "dword th32ParentProcessID;" & _ "long pcPriClassBase;" & _ "dword dwFlags;" & _ "char szExeFile[260]" _ ) DllStructSetData($tagPROCESSENTRY32, 1, DllStructGetSize($tagPROCESSENTRY32)) Local $p_PROCESSENTRY32 = DllStructGetPtr($tagPROCESSENTRY32) Local $a_pfirst = DllCall("Kernel32.dll", "int", "Process32First", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32) If IsArray($a_pfirst) = 0 Then Return SetError(2, 0, $i_PID) Local $a_pnext, $i_return = 0 If DllStructGetData($tagPROCESSENTRY32, "th32ProcessID") = $i_PID Then $i_return = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID") DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0]) If $i_return Then Return $i_return Return $i_PID EndIf While @error = 0 $a_pnext = DllCall("Kernel32.dll", "int", "Process32Next", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32) If DllStructGetData($tagPROCESSENTRY32, "th32ProcessID") = $i_PID Then $i_return = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID") If $i_return Then ExitLoop $i_return = $i_PID ExitLoop EndIf WEnd DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0]) Return $i_return EndFunc ;==>ProcessGetParent  
    • ur
      By ur
      I am running the tomcat batch file through autoit   and need to wait until the below line I get in console output.

      But when I am trying to read the console output using the ProcessEx UDF, I am getting only the partial output.
      So, can you please suggest how to handle this.
    • Aphotic
      By Aphotic
      Just wanted to share my functions for managing a GUI with lots of controls and many screens.
      I personally feel that it is very efficient and keeps line count to a minimum.
      And if it's not, I'll learn a better solution!
      Note: There are some conditional veriables such as $changes and $cont that are modified by the main loop in this particular script; they are meant as an example, please don't try too hard to understand why they're used.
      *Usage*
      This allows you to re-state a handful of buttons in one line when doing slight GUI changes:
      ToggleCTRL($GUI_DISABLE, $dALO, $dAAF, $dRLA) (A few buttons on a certain screen)
      ToggleCTRL($GUI_DISABLE, $dSAV, $dCAN) (Save/Cancel buttons)
      AND
      A single line solution to switching a GUI "screen":
      GuiMod("MAIN", $GUI_HIDE)
      GuiMod("DETAILS", $GUI_SHOW)
      GuiMod("PLANS", $GUI_HIDE)
      Another way I've used this to my advantage is as follows:
      Say a GUI has 3 or 4 main screens, and 3 or 4 "form" screens.
      When switching to a form screen, save the main screen that it was on to a variable; then once the user is done with the form, either submitting or cancelling, you can call the variable to revert back to the main screen it was on.
      Func _GuiMod($i, $tog, $act = True) Switch $i Case "MAIN" If $tog = $GUI_SHOW And $changes Then $changes = False ControlClick($GUI, "", $LOGfg) Else EndIf If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 535, 445) _ToggleCTRL($tog, $TAB, $LOGfl, $LOGfc, $LOGfi, $LOGfg, $LOGta, $LOGvd) _ToggleCTRL($tog, $LOGtp, $LOGse) Case "DETAILS" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 535, 475) Local $cont = True If $tog = $GUI_SHOW And $act Then If Not UpdateDetails() Then $cont = False _GuiMod("MAIN", $GUI_SHOW) EndIf EndIf If $cont Then _ToggleCTRL($tog, $dUID, $dICU, $dACC, $dCOF, $dNAM, $dCO2, $dIPW, $dEMA, $dEDI, $dLOG, $dMOD) _ToggleCTRL($tog, $dUPD, $dINP, $dAPL, $dALO, $dAAF, $dPLL, $dLOL, $dAFL, $dSAV, $dCAN, $dRPL) _ToggleCTRL($tog, $dRLA, $dACT, $dAC2, $dRET, $dDEL, $dADD, $dMQC) EndIf Case "ADD-INPUT" _ToggleCTRL($tog, $nCOMi, $nCO2i, $nNAMi, $nNAMb, $nEMAi, $nPREc, $nACCc, $nICUi, $nADDi, $nNOTi) _ToggleCTRL($tog, $nAPLb, $nALOb, $nAAFb, $nPLAl, $nLOCl, $nAFFl, $nRPLb, $nRLAb, $nADDb, $nCLEb) Case "PLANS" If $tog <> $GUI_SHOW Or Not $changing Then If $act Then _ToggleCTRL($tog, $dMOD, $dLOG, $dUPD, $dDEL) _ToggleCTRL($tog, $dINP, $dAPL, $dALO, $dAAF, $dPLL, $dLOL, $dAFL, $dSAV, $dCAN, $dRPL, $dRLA) EndIf Case "CHANGE" _ToggleCTRL($tog, $dITL, $dITC, $dAML, $dAMC, $dSCB, $dCCB, $dEAB) If $tog = $GUI_SHOW Then GUICtrlSetState($dRET, $GUI_DISABLE) Else GUICtrlSetState($dRET, $GUI_ENABLE) EndIf Case "NEW" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 465, 475) _ToggleCTRL($tog, $TAB, $nCOMl, $nCOMi, $nCO2l, $nCO2i, $nNAMl, $nNAMi, $nEMAl, $nEMAi, $nPREl, $nPREc) _ToggleCTRL($tog, $nACCl, $nACCc, $nPAEb, $nICUl, $nICUi, $nADDi, $nAPLb, $nALOb, $nAAFb, $nPLAl, $nLOCl) _ToggleCTRL($tog, $nAFFl, $nRPLb, $nNOTl, $nNOTi, $nADDb, $nCLEb, $nLAST) Case "ACCESS" If $tog = $GUI_SHOW Then WinMove($GUI, "", Default, Default, 465, 330) _ToggleCTRL($tog, $ACCd1, $ACCd2, $TYPla, $TYPli, $TYPad, $TYPde, $TYPmu, $TYPmd, $ACCla, $ACCli) _ToggleCTRL($tog, $ACCde, $ACCmu, $ACCmd, $ACCdl, $ACCdi, $ACCal, $ACCai, $ACCaa, $taRET) Case "TPi" _ToggleCTRL($tog, $tpOPEb, $tpCREr, $tpLINr, $tpCO2i, $tpEMAi, $tpEMAl, $tpCREb, $tpCOPb, $tpCOPi, $tpCTOi, $tpCGOb) _ToggleCTRL($tog, $tpUFLi, $tpUFLb, $tpICUi, $tpPLAi, $tpLINb, $tpDLIb, $tpUFMi, $tpSCAl, $tpCFAr, $tpCBAr) Case "TPC" If $tog = $GUI_SHOW Then _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpCO2l, $tpCO2i, $tpCOPl, $tpCOPi, $tpCREb, $tpCOPb, $tpSEPl, $tpCTOl, $tpCTOi, $tpCGOb, $tpLAST) _ToggleCTRL($tog, $tpIDNl, $tpIDNi, $tpIDNn, $tpSCAl, $tpEMAi, $tpEMAl, $tpCFAr, $tpCBAr) Case "TPL" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpUFLl, $tpUFLi, $tpUFLb, $tpICUl, $tpICUi, $tpPLAl, $tpPLAi, $tpLINb, $tpDLIb, $tpUFMl, $tpUFMi, $tpIMAb, $tpIMRb) Case "TPH" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPD", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpUFLl, $tpUFLi, $tpUFLb, $tpUFMl, $tpUFMi, $tpCOCl, $tpCOCi, $tpCOGb) Case "TPD" If $tog = $GUI_SHOW Then _GuiMod("TPC", $GUI_HIDE) _GuiMod("TPL", $GUI_HIDE) _GuiMod("TPH", $GUI_HIDE) EndIf _ToggleCTRL($tog, $tpDIDl, $tpDIDi, $tpDIDb) EndSwitch EndFunc Func _ToggleCTRL($tog, $c0 = 0, $c1 = 0, $c2 = 0, $c3 = 0, $c4 = 0, $c5 = 0, $c6 = 0, $c7 = 0, $c8 = 0, $c9 = 0, $c10 = 0, $c11 = 0, $c12 = 0) For $i = 0 To @NumParams GUICtrlSetState(Eval("c" & $i), $tog) Next EndFunc  
    • PClough
      By PClough
      Hi everyone!
      I want to programmatically alter the structure of a large number of PDF which have different sizes and orientation, and come from different generators. To do this I need to be able to capture different parameters describing their layout.  I use a console tool called pdfInfo (part of the xpdf public domain suite) which provides me with everything I need. The idea is first to run pdfInfo against my pdf file redirecting the console's output to a text file. And then to load and parse the text file to get the parameters I need.  The only problem is that no output file is ever created.  I've looked through the forums and saw a number of threads loosely related to this but none of the suggested solutions (like using StdoutRead) has worked for me. I should say maybe that I'm running Win10.
      So here's the code that doesn't work:
      $pdfInfo = "f:\pdfinfo.exe" $pdfTest = "f:\test.pdf" RunWait(chr(34) & $pdfInfo & " -box " & $pdfTest & " > f:\log.txt", "", @SW_HIDE) If you use in a console the command line: 
      f:\pdfinfo.exe -box f:\test.pdf > f:\log.txt
      it works perfectly.  But the piece of code above does not create the log.txt file. So any idea what I am doing wrong.  Thanks for any help!