Jump to content
Sign in to follow this  
TnTProductions

Making a background color/new style to a GUICreate()

Recommended Posts

TnTProductions

I made a desktop cleaner and i was wondering how to set the Background color of my GuiCreate() table tp a more stylish and cooler look?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiComboBoxEx.au3>
#include <File.au3>

Opt("GUICloseOnESC", 1)
Opt("GUIOnEventMode", 1)

Global $fTypes = "au3|doc|docx|txt|zip|rar|lnk"

$Gui = GUICreate("Desktop Cleaner V1.03", 385, 185, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GUISetOnEvent($GUI_EVENT_CLOSE, "Event", $Gui)

$LV = GUICtrlCreateListView("Desktop Files", 5, 10, 280, 140, -1, BitOR($LVS_EX_CHECKBOXES, $WS_EX_CLIENTEDGE))
FindDesktopFiles()

GUICtrlCreateGroup("File Types", 290, 5, 90, 45)
$Combo = GUICtrlCreateCombo("All Types", 300, 20, 70, 20, $CBS_DROPDOWNLIST)
GUICtrlSetOnEvent(-1, "Event")
GUICtrlSetData(-1, $fTypes, "All Types")

$SelectAll = GUICtrlCreateButton("Select All", 290, 65, 90, 25)
GUICtrlSetOnEvent(-1, "Event")
$SelectNone = GUICtrlCreateButton("Select None", 290, 95, 90, 25)
GUICtrlSetOnEvent(-1, "Event")
$InvertSeleced = GUICtrlCreateButton("Invert Selected", 290, 125, 90, 25)
GUICtrlSetOnEvent(-1, "Event")

$SendToBin = GUICtrlCreateButton("Send Selected File(s) To Recycle Bin", 5, 155, 375, 25)
GUICtrlSetOnEvent(-1, "Event")
GUICtrlSetFont(-1, 10, 700)

GUISetState(@SW_SHOW, $Gui)

While 1
    Sleep(100)
WEnd

Func Event()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Combo
            FindDesktopFiles(GUICtrlRead($Combo))
        Case $SelectAll
            For $s = 0 To _GUICtrlListView_GetItemCount($LV) - 1
                _GUICtrlListView_SetItemChecked($LV, $s, True)
            Next
        Case $SelectNone
            For $s = 0 To _GUICtrlListView_GetItemCount($LV) - 1
                _GUICtrlListView_SetItemChecked($LV, $s, False)
            Next
        Case $InvertSeleced
            For $s = 0 To _GUICtrlListView_GetItemCount($LV) - 1
                If _GUICtrlListView_GetItemChecked($LV, $s) Then
                    _GUICtrlListView_SetItemChecked($LV, $s, False)
                Else
                    _GUICtrlListView_SetItemChecked($LV, $s, True)
                EndIf
            Next
        Case $SendToBin
            For $s = 0 To _GUICtrlListView_GetItemCount($LV) - 1
                If _GUICtrlListView_GetItemChecked($LV, $s) Then _
                        FileRecycle(@DesktopDir & "\" & _GUICtrlListView_GetItemText($LV, $s, 0))
            Next
            FindDesktopFiles(GUICtrlRead($Combo))
    EndSwitch
EndFunc

Func FindDesktopFiles($sType = "All Types")
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($LV))
    Local $ext = "*." & $sType, $FL2A
    If $sType = "All Types" Then $ext = "*.*"
    $FL2A = _FileListToArray(@DesktopDir, $ext, 1)
    If Not @error Then
        For $i = 1 To $FL2A[0]
            If $sType = "All Types" Then
                Local $SST = StringSplit($fTypes, "|")
                For $j = 1 To $SST[0]
                    If $SST[$j] = StringMid($FL2A[$i], StringInStr($FL2A[$i], ".", 0, -1) + 1) Then _
                            GUICtrlCreateListViewItem($FL2A[$i], $LV)
                Next
            ElseIf $sType <> "All Types" Then
                If $sType = StringMid($FL2A[$i], StringInStr($FL2A[$i], ".", 0, -1) + 1) Then _
                        GUICtrlCreateListViewItem($FL2A[$i], $LV)
            EndIf
        Next
        _GUICtrlListView_SetColumnWidth($LV, 0, $LVSCW_AUTOSIZE)
    EndIf
EndFunc

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
sandin

did you mean something like this:

bellow this line:

$LV = GUICtrlCreateListView("Desktop Files", 5, 10, 280, 140, -1, BitOR($LVS_EX_CHECKBOXES, $WS_EX_CLIENTEDGE))

p.s. a suggestion: [suggestion] Your script is cool, it would be even better if you could make it read all extensions of the files on the desktop, and according to the extensions make a dynamic combo with all extensions that exist on the desktop (and not static, limited to "au3|doc|docx|txt|zip|rar|lnk" only) I know it may sound strange but some ppl keep exe files on desktop too ^^. :D:)

oh and yeah, how about desktop folders removal support? :( [/suggestion]

Edited by sandin

Share this post


Link to post
Share on other sites
TnTProductions

did you mean something like this:

add this lines:

GUISetBkColor (0xf0f8ff)
GUICtrlSetColor(-1, 0xff6347)
GUICtrlSetBkColor(-1, 0xf0f8ff)
Ill Try that out i was looking in the helpfile at the same thing you told me but it only showed up as the text color maybe I did something wrong Ill Retry it

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
TnTProductions

yea, i did exactly as you instructed me and no change happened i entered in the

GUISetBkColor (0xf0f8ff)
GUICtrlSetColor(-1, 0xff6347)
GUICtrlSetBkColor(-1, 0xf0f8ff)

and other items you showed me but no affect happened it looked exactly the same


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
TnTProductions

Wait i got it to work now but, i want like the entire color of the Guicreate() table to be a different color like lets say the background is black instead of white with an orange top bar(the one with the X that you close out of i forget the name)

not just the text color to change

Edited by TnTProductions

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
sandin
TnTProductions

I edited my previous post, I forgot to add:

add those lines below:

$LV = GUICtrlCreateListView("Desktop Files", 5, 10, 280, 140, -1, BitOR($LVS_EX_CHECKBOXES, $WS_EX_CLIENTEDGE))
I want the entire background color to change not just the text color!

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
sandin
sandin
sandin
TnTProductions

add this line:

GUISetBkColor (0xe98fb98)oÝ÷ Ù·¥ºÚ"µÍÌÍÑÝZHHÕRPÜX]J  ][ÝÑÚÝÜÛX[KÉ][ÝËÎ
KN
KLKLK]Ô    ÌÍÕÔ×ÓÕTTQÒSÕË    ÌÍÕÔ×ÐÓTÒPSÔÊJ
Still didnt work at all... :)

whats up with the wierd language??? :(

oo didnt see your edit ill try that

Edited by TnTProductions

"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
TnTProductions

still no change at all to the background whats up with that does it work for you???


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
sandin
TnTProductions

exacctly what i was looking for i just had to remove you setcolor functions that changed the text color

P.S is there andy way to change the border/list color so it can all be a macthing color??


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

Share this post


Link to post
Share on other sites
sandin
TnTProductions

Thanks for all your help!

my scripts complete now and ready for download in example scripts!


"FREEDOM is not FREE""Its a good thing war is so terrible, or we grow too fond of it" -Robert E. Lee[quote]Firestrom: global $warming = False[/quote]My scripts:Desktop Cleaner---->Total Downloads:167;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;111111;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;;;;;;;;;;;1;;;;;;1;;;;;;;;;;;;;;11;;;;;;"a wise man once said why use your skills when we have technology"

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.