RaiNote

CUI Compiled

11 posts in this topic

Hi,

would there a way to disable enable the CUI after the exe was compiled If a certain Action is being used?


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

CUI=Console User Interface. I am speaking about.

But maybe this is to less Information so: What i want  to do is to use a GUI within a CUI compiled exe and if a button or something else is clicked/running the CUI will be hidden. or could i do this with GUI compiled too?

Edited by RaiNote

  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

Is there any way?


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

Give it at least 24 hours before bumping a topic.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Is there any way?

not sure what you are looking for but when you want to use a gui in a cui compiled script then just do so, as that should work fine.

else try explaining what you problem is.

jos


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

Share this post


Link to post
Share on other sites

I want to disable/enable the Console with a button in the gui or another action


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

I am using the Console for Debug Error Info etc Output so that the user can see more Details whats going on. But also that the user could disable it if it could annoy him.


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

Share this post


Link to post
Share on other sites

That still does not explain why you feel the need for changing a bit in the PE header of the program to change it between cui and gui. Build your program such that the consolewrites only write are active when something is selected or button pressed.

the cui versus gui compile option is only there to write the consolewrite to a cmd window when shelled from it.

jos


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

Share this post


Link to post
Share on other sites

Hmh okay thanks.^^


  • C++/AutoIt/OpenGL Easy Coder
  • I will be Kind to you and try to help you
  • till what you want isn't against the Forum
  • Rules~

 

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

  • Similar Content

    • 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  
    • thoms
      By thoms
      Hello Forum,
      As said in the title, I'm searching a way to disable all tabstops in a GUI. My GUI includes 15 buttons and 3 edit controls.
      My questions:
      - is there a way to disable all tabstops at a time
      - is there a way to list all controls of a GUI and then disable tabstops one by one
      - or should I use the following line after each button creation:
      _WinAPI_SetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE, BitAND(_WinAPI_GetWindowLong(GUICtrlGetHandle(-1), $GWL_STYLE), BitNOT($WS_TABSTOP))) Thanks in advance for your valuable help!
      Thoms
      Edit: or maybe disable TAB key? I don't remember how to do!
    • WoodGrain
      By WoodGrain
      Hi All,
      I'm using UseTraySetIcon("shell32.dll", xx) to set my tray icon to a specific icon while running, is there a way I can specify this icon when I compile my script into an exe so my exe icon is the same?
      Thanks!
    • irishsurfer22
      By irishsurfer22
      Hi,
      I'm trying to automate the process of configuring the three McAfee settings seen in the image I've attached (Host IPS, Network IPS and Firewall).  Clicking one of them toggles the setting and closes the menu.  I want them all OFF.  This script will be used on different computers so the settings might be have different initial setups.
      This is my first time using AutoIt and I have very limited coding experience--mostly MATLAB.  Please excuse any lack of knowledge or terminology. 
      So far my code is able to
      1. Find the visible McAfee icon in the system tray. 
      2. Click the icon.
      3. Send "Q" to open up the Quick Settings menu.
      4. Toggle settings blindly using keystrokes.
      The problem I'm having is I don't know how to "read" the status of the setting before toggling it.  This means I might be switching it from Off to On by mistake,
      when I should really just leave it alone. 
       
      I'm wondering a couple of things. 
       
      1. Is there an easy way to "read" the status of the setting?  This would solve the problem.  Part of the challenge with this overall assignment is that there doesn't
      seem to be any sort of "control" built into these menus.  In other words, the only thing that changes in Au3Info when you hover over different options is the
      coordinates of the mouse--there aren't any unique control IDs or texts to my knowledge that differentiate between different settings or menus.  I don't know how to search for text in a menu and get an index or anything like that.  I've attached my code at the bottom and commented-out two ideas I had for reading the status and acting accordingly after "Send (Q)".  Neither of which were fruitful. 
       
      2. Is there an alternative to the overall method I've chosen that is simpler and more robust?  It seems like there must be an alternative path to these settings besides the system tray, but I don't know of any such paths.   The final script is going to be used on a number of computers which may have the McAfee icon either hidden or visible in the system tray, but currently my script only works if it is visible.  I haven't figured out how to access hidden icons with mouse clicks yet. 
       
      I should also mention that most of my code for step 1 (find the McAfee icon) comes from something I found online.  I've stared at it for a while, and I think I know how it works, but I wouldn't have known those GUI commands existed and wouldn't have been able to write that bit of code on my own.    I don't want you to overestimate my understanding of AutoIt.  Sorry for the long post, just wanted to provide all the relevant info. 
       
      Any advice you can offer would be greatly appreciated!  Thanks in advance.
      -Cody
       
      #cs AutoIt McAfee disable #ce #Include <GuiToolBar.au3> #Include <GUIConstants.au3> Local $Array[3] For $Element In $Array Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "McAfee status: OK" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") EndIf Send( "Q" ) ;$DropDownHandle = Controlgethandle( "", "Host IPS - on", "") ;$text = ControlGetText( "", "Host IPS - on", "") ;If "Host IPS - on" = 1 Then ; Send( $Element ) ;EndIf Next Exit ;........ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFunc  

    • pinkfoyd
      By pinkfoyd
      Hi,
       
      I remember a script where i had seen an user inverse state of a button ( $GUI_ENABLE (64)   /  $GUI_DISABLE (128) ) in one line only
      I remember it use Bit operation but i cannot reproduce it, can someone help ?
       
      In fact if the button is enable i want to disable it and if he is disable , want to enable it, something like that :
       
      GuiCtrlSetState ( $button , BitOr ( GuiCtrlGetSate ( $button ) )        ; i know this is NOT working, for explanation only
       
       
      Thanks !