Sign in to follow this  
Followers 0
acidfear

Simple Question

7 posts in this topic

I'm writing a registry tweak program and i use list boxes to show what has been done.

I'm trying to get it to write, in the first list box, each registry it has deleted.

How can i make it so that it will display each one bellow the other instead of one continous line?

here is the unfinished code:

#include <GuiConstants.au3>

GuiCreate("MyGUI", 639, 413,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Button_1 = GuiCtrlCreateButton("Execute", 50, 60, 130, 40)
$List_2 = GuiCtrlCreateList("", 230, 40, 400, 97)
$Label_3 = GuiCtrlCreateLabel("Delete Shortcut Arrows", 350, 10, 180, 20)
$Progress_8 = GuiCtrlCreateProgress(50, 110, 130, 20)


$Button_4 = GuiCtrlCreateButton("Execute", 50, 250, 130, 40)
$List_5 = GuiCtrlCreateList("", 230, 210, 400, 97)
$Label_6 = GuiCtrlCreateLabel("Change menu display speed", 350, 180, 180, 20)
$Date_7 = GuiCtrlCreateDate("Date7", 240, 380, 190, 20)

$Progress_9 = GuiCtrlCreateProgress(50, 300, 130, 20)
$input1=GUICtrlCreateInput("0, 100, 300 | Type one",50, 330, 130, 20)
$bar="done"

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
EndSelect
if $msg = $Button_1 Then
            RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\InternetShortcut", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\piffile", "IsShortcut")
            $List_2 = GuiCtrlCreateList( ($bar &""& $bar )&@LF,  230, 40, 400, 97)
            

        
            
            
    EndIf

WEnd
Exit

Share this post


Link to post
Share on other sites



Did you try @CRLF?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yeah but i can't seme ot get it to work.

I tried this new code, it worked, but is there a way to get it to not show the line after every line of text?

#include <GuiConstants.au3>

GuiCreate("MyGUI", 639, 413,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Button_1 = GuiCtrlCreateButton("Execute", 50, 60, 130, 40)
$List_2 = GuiCtrlCreateList("", 230, 40, 400, 97)
$Label_3 = GuiCtrlCreateLabel("Delete Shortcut Arrows", 350, 10, 180, 20)
$Progress_8 = GuiCtrlCreateProgress(50, 110, 130, 20)


$Button_4 = GuiCtrlCreateButton("Execute", 50, 250, 130, 40)
$val1 = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay")
$List_5 = GuiCtrlCreateList("Current Value:" &""& $val1, 230, 210, 400, 97)
$Label_6 = GuiCtrlCreateLabel("Change menu display speed", 350, 180, 180, 20)
$Date_7 = GuiCtrlCreateDate("Date7", 240, 380, 190, 20)

$Progress_9 = GuiCtrlCreateProgress(50, 300, 130, 20)
$input1=GUICtrlCreateInput("0, 100, 300 | Type one",50, 330, 130, 20)
$bar="done"

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;
EndSelect
if $msg = $Button_1 Then
            RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\InternetShortcut", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\piffile", "IsShortcut")
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\lnkfile\IsShortcut",  230, 40, 400, 97)
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\InternetShortcut\IsShortcut",  230, 60, 400, 97)
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\piffile\IsShortcut" ,  230, 80, 400, 97)
        EndIf
        
if $msg = $Button_4 Then
    $read=GUICtrlRead($input1)
RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay", "REG_SZ", $read)

$val2 = RegRead("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay")
$List_5 = GuiCtrlCreateList("Changed Value:" &""& $val2, 230, 230, 400, 97)


EndIf

WEnd
Exit

Btw, how do you have the inputbox clear when the user clicks on it?

Edited by acidfear

Share this post


Link to post
Share on other sites

GUICtrlSetData() to clear it... I have no idea what you want now...

"0, 100, 300 | Type one" < Do you want that seperated like

0

100

300

Type One?

Why not just use a combobox:

$input1= GUICtrlCreateCombo('Choose One', 50, 330, 130, 140)
GUICtrlSetData($input1, '0|100|300', 'Choose One')

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

GUICtrlSetData() to clear it... I have no idea what you want now...

"0, 100, 300 | Type one" < Do you want that seperated like

0

100

300

Type One?

Why not just use a combobox:

$input1= GUICtrlCreateCombo('Choose One', 50, 330, 130, 140)
GUICtrlSetData($input1, '0|100|300', 'Choose One')

Thanks for the clear, but thats not what i wanted seperated.

This line of code is what i want separate :

if $msg = $Button_1 Then
            RegDelete("HKEY_CLASSES_ROOT\lnkfile", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\InternetShortcut", "IsShortcut")
            RegDelete("HKEY_CLASSES_ROOT\piffile", "IsShortcut")
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\lnkfile\IsShortcut",  230, 40, 400, 97)
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\InternetShortcut\IsShortcut",  230, 60, 400, 97)
            $List_2 = GuiCtrlCreateList( "Deleted Reg Entry HKEY_CLASSES_ROOT\piffile\IsShortcut" ,  230, 80, 400, 97)
        EndIf

Notice the 3 create list. When i run it, it creates 3 labels just to show the 3 lines of text under each other

"" deleted

""deleted

""deleted

Problem is, that it screws up the size of the original list because it's basically stacking 3 labels on top of each other.

What i'm askign is how to get

"" deleted

""deleted

""deleted

with only using 1 create list.

Edited by acidfear

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Actually instead of creating the list 3 times, you should have just used GUICtrlSetData($List_2, 'Whatever') ...

Edit:

This works too.

#include <guiconstants.au3>
GUICreate('', 700)
$List_2 = GUICtrlCreateEdit('1' & @CRLF & '2' & @CRLF & '3' ,  230, 80, 400, 97, BitOR($ES_AUTOHSCROLL, $ES_MULTILINE))

GUISetState()
While 1
    $MSG = GUIGetMsg()
    IF $MSG = - 3 Then Exit
WEnd
Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Thank you so much!! That worked perfect :whistle:

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