Jump to content

Edit: Detect key before updating content?


Recommended Posts

Hi everyone :) ,

i'm trying to make some sort of full screen console window where some of the text must be non-editable like windows CMD.exe.

Text already typed before pressing enter or the working folder 'C:\...>' is read only in CMD.exe and I want to know if mimicking this behavior in an edit control is possible.

 

My attempt to make a console makes all the [A-Za-z0-9] keys a hotkey and the main edit control is set to read only.

Every time the user types something the hotkey function is triggered, the cursor in the edit control is set to the end of the text and the character you typed is added to the edit.

If you try to press the {backspace} key when you are at the edge of some text that is read only nothing happens.

 

This works but I guess it is not the best or most clean way to make something like this..

Can someone give me some advice or help me make a better function for having full control over text in the edit control?

 

kind regards, :)

TheAutomator

 

#include <GuiEdit.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), $WS_EX_TOPMOST)
    GUISetBkColor(0x000000)

    $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, BitOR($ES_READONLY,$WS_VSCROLL), 0)
        GUICtrlSetFont(-1, 28, 400, 0, 'OCR A Extended')
        GUICtrlSetColor(-1, 0x00FF00)
        GUICtrlSetBkColor(-1, 0x000000)
        GUICtrlSetCursor (-1, 2)
        _GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49)

GUISetState(@SW_SHOW)

;##################################################################################################################

Global $keys = 'abcdefghijklmnopqrstuvwxyz _ABCDEFGHIJKLMNOPQRSTUVWXYZ'

;##################################################################################################################

For $_ = 1 To StringLen($keys)
    HotKeySet( StringMid($keys,$_,1), 'keypress')
Next
For $_ = 0 To 9
    HotKeySet($_, 'keypress')
    HotKeySet('{numpad'&$_&'}', 'keypress')
Next
HotKeySet('{bs}','Keypress')
HotKeySet('{enter}','Enter')

_GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:')

$MIN = StringLen(GUICtrlRead($Console)) + 1
$MAX = $MIN

;##################################################################################################################

Func Keypress()
    Local $key = @HotKeyPressed

    If StringLen($key) = 1 Then
        _GUICtrlEdit_AppendText($Console, $key)
        $MAX += 1

    ElseIf StringRegExp($key,'\{numpad[0-9]\}') Then
        _GUICtrlEdit_AppendText($Console, StringMid($key,8,1))
        $MAX += 1

    ElseIf $key = '{bs}' Then
        If $max = $min then
            Return
        Else
            Local $len = StringLen(GUICtrlRead($Console))
            _GUICtrlEdit_SetSel($Console, $len - 1, $len)
            _GUICtrlEdit_ReplaceSel($Console, '')
            $MAX -= 1
        EndIf

    EndIf
EndFunc

Func Enter();handle typed commands when ENTER is pressed:
    Switch StringStripWS(StringLower(StringMid(GUICtrlRead($Console),$min,$max)),8)
        Case ''
            Beep(1000,50)
        Case 'clear'
            GUICtrlSetData($Console,'Command:')
            $MIN = StringLen(GUICtrlRead($Console)) + 1
            $MAX = $MIN
            Return
        Case 'quit'
            Quit()
        Case Else
            _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Unknown command!')
    EndSwitch
    _GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:')
    $MIN = StringLen(GUICtrlRead($Console)) + 1
    $MAX = $MIN
EndFunc

;=============================================================

Func Quit()
    _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Goodbye...')
    Sleep(1500)
    Exit
EndFunc

While True
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then
        Quit()
    EndIf
WEnd
Edited by TheAutomator
Link to post
Share on other sites

Please also read the section in our rules on building a keylogger. This is pretty close to one.

Jos

I'm just trying to make a console screen,

it would even be better if i don't have to use hotkeys so that the keys are only captured when the edit is visible and active.

How can I ask help for making this console without making it look like a key logger?

Link to post
Share on other sites
  • Developers

I wasn't trying to say you are having malicious intentions because then the thread would have been locked and you would be able to post any more by now. ;)

All I am saying is that your posted script looks a lot like it could be used for it so please be careful when posting code in our forums.

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Custom commands is a great idea but also having the normals of a command prompt are nice features as well.

Here is a couple things I've tested :

Variable Changes :

Global $keys = 'abcdefghijklmnopqrstuvwxyz _ABCDEFGHIJKLMNOPQRSTUVWXYZ-;:/?<>,.`~@$%&*()=}|[]\' & "'" & '"'
 ; never know what someone may want to try
Global $string = "Type a command : " ; reason for this is for a switch you'll see in the next code

Keys i didn't get to work are : ! # ^ + {

Change this :

_GUICtrlEdit_AppendText($Console, @CRLF&'Type a command:')

To this :

_GUICtrlEdit_AppendText($Console, @CRLF& $string)

lastly add this to/below your Quit case :

Case 'quit' or 'exit'
            Quit()
        Case 'A:\' or 'A:/'  ; lowercase versions too for lazy people
            $string = "A:\ > "
        Case 'C:\' or 'C:/'
            $string = "C:\ > "
        Case 'D:\' or 'D:/'
            $string = "D:\ > "
        Case '/?' or '\?' or '?' or 'help' or 'command' or 'commands'
            $some variable to hold command list
        ;then some case to hold descriptions/usages of the commands per command
        ;i think another switch would work well for that

That about does it for my ideas so far.

 

edit : If this was Java then id say use a startswith for some of the things that will be needed later on but I'm not sure what autoit has to offer like that.

Edited by xxaviarxx
Link to post
Share on other sites

I would go with a separate control for input than you do for display, seems like it would make it all much easier.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to post
Share on other sites

I found the idea funny... ;)

First attempt :

#include <GuiEdit.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

Global $prompt = "#Type a command:> "
Global $sel, $oldsel, $readonly, $iMinPos, $iStyle

Global $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND), $WS_EX_TOPMOST)
GUISetBkColor(0x000000)

Global $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, $ES_AUTOVSCROLL, 0)
GUICtrlSetFont(-1, 12, 400, 0, 'OCR A Extended')
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0)
GUICtrlSetCursor (-1, 2)
_GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49)

Global $dummy = GUICtrlCreateDummy()

Global $aKeys[1][2] = [["{ENTER}", $dummy]]
GUISetAccelerators($aKeys)

GUISetState(@SW_SHOW)
Sleep(1000)

_Enter()

While True
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Quit()
        Case $dummy
            _Enter()
    EndSwitch
    

    $sel = _GUICtrlEdit_GetSel($Console)
    If $sel <> $oldsel Then
        $oldsel = $sel
        If $sel[0] < $iMinPos Or $sel[1] < $iMinPos Then
            If NOT $readonly Then 
                GUICtrlSetStyle($Console, $ES_READONLY)
                $readonly = 1
            EndIf
        Else
            If $readonly Then
                $readonly = 0
                $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE)
                 GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY))
            EndIf
        EndIf
    EndIf
WEnd


Func Quit()
    _GUICtrlEdit_AppendText($Console, @CRLF&@TAB&'Goodbye...')
    Sleep(1500)
    Exit
EndFunc

Func _Enter()
    Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0]
    Switch $sCommand
        Case "clear"
            GUICtrlSetData($Console, "")
        Case "quit", "exit"
            Quit()
        Case ""
            Beep(1000,50)
        Case Else
            _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & $sCommand & " : command not found")
    EndSwitch
    
    _GUICtrlEdit_AppendText($Console, @CRLF & $prompt)
    $iMinPos = StringLen(GUICtrlRead($Console) )
EndFunc

 

Link to post
Share on other sites

xxaviarxx,

Thanks for the ideas, I think a simple exec with cmd.exe will give me almost all of the functionality of windows command prompt if I want ;).

I like the $string switch idea btw :) .

 

boththose,

"a separate control for input" and that would be? :) .

 

jguinch,

Brilliant! B)

(noticed a little bug, try to remove the space at the end of "#Type a command:> " and then try to type something.)

Link to post
Share on other sites

(noticed a little bug, try to remove the space at the end of "#Type a command:> " and then try to type something.)

also problems with the TAB key...

Quick impressions:

1 - Seems like a combination of the two techniques will work

     a - hotkey to trap any key that will affect the behavior of the edit control

     b - regexp to parse the input

@xxaviarxx - what is the end game?  If your purpose is to try to mimic cmd.exe that has been tried with many issues, search the forum for several examples.  If you are trying to create a app/function/command driver of sorts then there is a whole host of issues to consider, among them, console output, command management, possibly security, etc.

By the way, I like the gui.  Going to use it for the little guessing games that I make for my grandchildren...

kylomas

 

 

 

 

 

Edited by kylomas
correction

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to post
Share on other sites

"a separate control for input" and that would be?

another edit control strictly for entering commands to the 'console', and then you can take that and send it to run and write it prefaced with whatever you want into the readonly edit control.  Much like you see in game console or a chat window. 

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to post
Share on other sites

TheAutomator,

I addressed this to the wrong person.  It was meant for you.

@xxaviarxx - what is the end game?  If your purpose is to try to mimic cmd.exe that has been tried with many issues, search the forum for several examples.  If you are trying to create a app/function/command driver of sorts then there is a whole host of issues to consider, among them, console output, command management, possibly security, etc.

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to post
Share on other sites

TheAutomator,

I addressed this to the wrong person.  It was meant for you.

It's just a funny project, make a full screen console with a custom font and colors, put my own commands in there and add a few tweaks to make it look better.

I'm writing a dll that will handle the commands and scripts because I'm making a programming language for it to (so no need for cmd.exe itself),

so that I can open my own scripts with that console and see the output, make it a useful tool. a bit like batch-files but my language's syntax will be different..

Edited by TheAutomator
Link to post
Share on other sites

2nd attempt :

#include <GuiEdit.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Array.au3>

Global $prompt = "#Type a command :> "
Global $sel, $oldsel, $readonly, $iMinPos, $iStyle
Global $iFontSize = 12, $sFontName = "OCR A Extended", $iFontcolor = 0x00FF00

Global $Form = GUICreate("Console", @DesktopWidth, @DesktopHeight, 0, 0, BitOR($WS_POPUP, $DS_SETFOREGROUND))
GUISetBkColor(0x000000)

Global $Console = GUICtrlCreateEdit('Loading...', 32, 32, @DesktopWidth-15, @DesktopHeight - 64, $ES_AUTOVSCROLL, 0)
GUICtrlSetStyle($Console, $ES_READONLY)
GUICtrlSetFont(-1, $iFontSize, 400, 0, $sFontName)
GUICtrlSetColor(-1, $iFontcolor)
GUICtrlSetBkColor(-1, 0)
GUICtrlSetCursor (-1, 2)
_GUICtrlEdit_SetMargins( -1, $EC_RIGHTMARGIN, Default, 49)

Global $dummyEnter = GUICtrlCreateDummy()
Global $dummyTab = GUICtrlCreateDummy()
Global $dummyBS = GUICtrlCreateDummy()
Global $dummyPreviousFunc = GUICtrlCreateDummy()
Global $dummyNextFunc = GUICtrlCreateDummy()
Global $dummyEsc = GUICtrlCreateDummy()
Global $dummyCtrlD = GUICtrlCreateDummy()
Global $dummyCtrlC = GUICtrlCreateDummy()

Global $aHistory[1], $iIndexFunc = 1

Global $aFunctions = [ ["__clear", "clear,cls"], _ 
                       ["__quit", "quit,exit,close"], _ 
                       ["__help", "help"] ]

_ArraySort($aFunctions)


Global $aKeys = [ ["{ENTER}", $dummyEnter], _
                  ["{TAB}", $dummyTab], _
                  ["{BACKSPACE}", $dummyBS], _
                  ["{UP}", $dummyPreviousFunc], _
                  ["{DOWN}", $dummyNextFunc], _
                  ["{ESC}", $dummyEsc ], _
                  ["^d", $dummyCtrlD], _
                  ["^q", $dummyCtrlD], _
                  ["^c", $dummyCtrlC] ]
GUISetAccelerators($aKeys)

GUISetState(@SW_SHOW)
Sleep(1000)


_Enter()
$iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE)
GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY))

While True
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE, $dummyCtrlD
            __Quit()
        Case $dummyEnter
            _Enter()
        Case $dummyBS
            _BackSpace()
        Case $dummyPreviousFunc
            _PreviousFunc()
        Case $dummyNextFunc
            _NextFunc()
        Case $dummyEsc
            _Esc()
        Case $dummyCtrlC
            _CtrlC()
    EndSwitch
    

    $sel = _GUICtrlEdit_GetSel($Console)
    If $sel <> $oldsel Then
        $oldsel = $sel
        If $sel[0] < $iMinPos Or $sel[1] < $iMinPos Then
            If NOT $readonly Then 
                GUICtrlSetStyle($Console, $ES_READONLY)
                $readonly = 1
            EndIf
        Else
            If $readonly Then
                $readonly = 0
                $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE)
                 GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY))
            EndIf
        EndIf
    EndIf
WEnd

Func _CtrlC()
    _GUICtrlEdit_AppendText($Console, @CRLF & $prompt)
    $iMinPos = StringLen(GUICtrlRead($Console) )
EndFunc

Func _Esc()
    Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0]
    _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) )
    _GUICtrlEdit_ReplaceSel($Console, "")
EndFunc

Func _PreviousFunc()
    If $iIndexFunc = 1 Then Return
    $iIndexFunc -= 1
    Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0]
    _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) )
    _GUICtrlEdit_ReplaceSel($Console, $aHistory[$iIndexFunc])
EndFunc

Func _NextFunc()
    If $iIndexFunc = UBound($aHistory) - 1 Then Return
    $iIndexFunc += 1
    
    Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0]
    _GUICtrlEdit_SetSel($Console, StringLen(GUICtrlRead($Console)), StringLen(GUICtrlRead($Console)) - StringLen($sCommand) )
    _GUICtrlEdit_ReplaceSel($Console, $aHistory[$iIndexFunc])
EndFunc

Func _BackSpace()
    Local $aSel = _GUICtrlEdit_GetSel($Console)
    If $aSel[0] = $aSel[1] Then
        If $aSel[0] > $iMinPos Then
            _GUICtrlEdit_SetSel($Console, $aSel[0] - 1, $aSel[0])
            _GUICtrlEdit_ReplaceSel($Console, "")
        EndIf
    Else
        _GUICtrlEdit_ReplaceSel($Console, "")
    EndIf
EndFunc

Func _Enter()
    Local $iFound = 0
    Local $sCommand = StringRegExp( GUICtrlRead($Console), "\R\Q" & $prompt & "\E\h*(\N*)$|()$", 1)[0]
        
    If NOT StringRegExp($sCommand, "^\v*$") Then
        Redim $aHistory[ UBound($aHistory) + 1]
        $aHistory[ UBound($aHistory) - 1] = $sCommand
        $iIndexFunc = UBound($aHistory)
    EndIf
    
    For $i = 0 To UBound($aFunctions) - 1
        If StringRegExp($sCommand, "^\h*$") Then
            $iFound = 1
            ExitLoop
        Else
            If StringRegExp($aFunctions[$i][1], "(?:^|,)" & $sCommand & "(?:,|$)") Then
                $iFound = 1
                GUICtrlSetStyle($Console, $ES_READONLY)
                Call($aFunctions[$i][0])
                $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($Console), $GWL_STYLE)
                GUICtrlSetStyle($Console, BitXOR($iStyle, $ES_READONLY))
                ExitLoop
            EndIf
        EndIf
    Next
    
    If NOT $iFound Then _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & $sCommand & " : command not found. Type ""help"" to list the available commands." & @CRLF)

    _GUICtrlEdit_AppendText($Console, @CRLF & $prompt)
    $iMinPos = StringLen(GUICtrlRead($Console) )
EndFunc

Func __help()
    Local $command
    Local $sAlias
    
    _GUICtrlEdit_AppendText($Console, @CRLF  & "List of available commands : " & @CRLF)
    For $i = 0 To UBound($aFunctions) - 1
        $command = StringRegExpReplace($aFunctions[$i][1], ",\V+", "")
        $alias = StringRegExpReplace($aFunctions[$i][1], "^.+?,", "")
        If @extended Then
            $sAlias = " (alias " & StringReplace($alias, ",", "/") & ")"
        Else
            $sAlias = ""
        EndIf
        _GUICtrlEdit_AppendText($Console, "   " & $command & $sAlias & @CRLF)
    Next
EndFunc

Func __clear()
    GUICtrlSetData($Console, "")
EndFunc

Func __quit()
    GUICtrlSetState($Console, $GUI_DISABLE)
    _GUICtrlEdit_AppendText($Console, @CRLF & @TAB & "Goodbye..." & @CRLF)
    Sleep(1000)
    Exit
EndFunc

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mo0C0w
      Hey guys!
      I just started working with the GUI yesterday and it has only brought more fun to the Autoit adventure  
      Basically I have a GUI windows that opens and based on the selection of the combo box the button will do something different. This specific scenario I am talking about the Client Update Verification  combo selection. When selected and the button is pressed my second gui window opens. As of now if I only paste comp1 or comp2 by itself it works correctly, but if I paste both, it has a fit.
      What would the correct way to do this be? Any help or examples, would be greatly appreciated! Thank you in advance
       
      #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Client_List.au3> #Region ### START Koda GUI section ### Form=c:\users\dnoble\pictures\plexiibox v4.kxf Global $Form1_1 = GUICreate("Plexii", 336, 419, 1548, 586) GUISetBkColor(0xFFFFFF) Global $Pic1 = GUICtrlCreatePic("C:\Users\dnoble\Pictures\plexii.jpg", 41, 0, 252, 268, BitOR($GUI_SS_DEFAULT_PIC,$SS_CENTERIMAGE)) Global $Label2 = GUICtrlCreateLabel("Select Test", 125, 280, 95, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") Global $Combo2 = GUICtrlCreateCombo("Select Test", 39, 312, 257, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "Client Update Verification|Bids") GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") Global $Button1 = GUICtrlCreateButton("Proceed", 111, 352, 129, 33) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If GUICtrlRead($Combo2) = "Client Update Verification" Then _Form2() ;clientupdateverification() EndSwitch WEnd Func _Form2() #Region ### START Koda GUI section ### Form=c:\users\dnoble\pictures\plexiiboxclientupdate verification.kxf $Form1_1 = GUICreate("Plexii", 336, 521, 866, 454) GUISetBkColor(0xFFFFFF) $Edit1 = GUICtrlCreateEdit("", 57, 72, 241, 345) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Execute", 95, 440, 145, 41) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If GUICtrlRead($Edit1) = "comp1" Then comp1() If GUICtrlRead($Edit1) = "comp2" Then comp2() EndSwitch WEnd EndFunc  

    • By mike1950r
      Hi,
      I have a problem with the scrollbar in edit control.
      In my case I use richedit, but it appears also in the "normal" editcontrol.
      The problem ONLY appears, when working with my program (including editcontrol) and another program like notpad on the other screen.
      It appears when using the scrollbar of notepad, then my scroll bar and so on ... (vertical scrollbars only)
      and then suddenly the area behind my scrollbar gets highlighted (black) like selected, above and below,
      if i move the mouse to the left during pressing, the whole area behind the scrollbar gets highlighted in black.
      When my program is loaded alone the problem NEVER happens.
      I have made two screenshots, 1st one when the problem appears, and the second one showing when moving to the left.
      I really have no idea and there is nothing special in my editcontrol.
      I would be really thankful, if someone could help me further to get this issue solved.
      thanks in advance
      cheers mike


       
    • By RaviRai
      Recently i automated token login for my application.
      -snip-
    • By Briefmich
      Hello, I wonder why PSlist waits for some input even when it has finished already?
      If I run it like this pslist.exe -s 2 in task manager mode for 2 seconds (so I have the CPU load numbers for processes) it never ends unless a key is pressed. This is useless if I want to call it from another script and have output in a file like this pslist.exe -s 2 >procs.txt because it never finishes! Anybody has an idea if anything else can be done except killing a process after some time?
    • By rudi
      Hello,
      very propably this has been asked before, well, I miss the thread(s) ...
      Is there a command line switch to tell the SciTE setup EXE to install silently ("/S") *AND* to end up with "edit" (instead of "run") as system wide default action for *.au3 files?
       

       
      As it can be done with the config tool:
      https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/SciTEConfigb1.PNG
       
      Regards, Rudi.
×
×
  • Create New...