Jump to content

why my compiled scripts use win xp style not win 7 !


Recommended Posts

here you are ;)

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>
Global $lastchar=""
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 198, 315, 191, 124)
$ListView = GUICtrlCreateListView("Chars", 0, 0, 201, 249);,BitOR($LVS_REPORT,$LVS_NOCOLUMNHEADER))
GUICtrlSetStyle($ListView,$LVS_REPORT)
$check=GUICtrlCreateCheckbox("Filter",150,260,100,20)
;$chars=_GUICtrlListView_AddColumn($ListView, "Chars")
_GUICtrlListView_SetColumnWidth($ListView, 0, 195)
$random = GUICtrlCreateButton("Random Choice", 19, 288, 154, 25)
$add = GUICtrlCreateButton("+", 104, 256, 25, 25)
$remove = GUICtrlCreateButton("-", 64, 256, 25, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
If FileExists(@ScriptDir&"\charsname_random_choise.ini")<> 1 Then
    IniWriteSection (@ScriptDir& "\charsname_random_choise.ini", "", "")
    IniDelete ( @ScriptDir& "\charsname_random_choise.ini", "" )
EndIf
read_ini()
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $add
            $inputname=InputBox("Add new char","Enter Char")
            IniWriteSection ( @ScriptDir& "\charsname_random_choise.ini", $inputname, "")
            _GUICtrlListView_AddItem($ListView,$inputname)
        Case $remove
                $sel_chars=_GUICtrlListView_GetSelectedIndices($ListView, True)
                If $sel_chars[0] <> 0 Then
                    ;MsgBox(0,"Warning","Delete Selected Item(S) ?")
                    For $i=1 to $sel_chars[0]
                        ;MsgBox(0,"",$sel_chars[$i])
                        _GUICtrlListView_DeleteItem(GUICtrlGetHandle($ListView), $sel_chars[$i])
                        IniDelete( @ScriptDir& "\charsname_random_choise.ini",_GUICtrlListView_GetItemText($ListView, $sel_chars[$i]))
                        Sleep(200)
                    Next
                EndIf
                
        Case $random
                
                $count=_GUICtrlListView_GetItemCount($ListView)
            If GUICtrlRead ( $check )=$GUI_CHECKED And $lastchar <> "" Then
                Do  
                $rnum=Random ( 1,$count ,1)
                Until $rnum <> $lastchar
                $lastchar=$rnum
                _GUICtrlListView_SetItemSelected($ListView, $rnum-1)
                MsgBox(0,"Selected Char",_GUICtrlListView_GetItemText($ListView, $rnum-1))
            Else
                
                $rnum=Random ( 1,$count ,1)
                $lastchar=$rnum
                _GUICtrlListView_SetItemSelected($ListView, $rnum-1)
                ;MsgBox(0,"unchecked",$rnum)
                MsgBox(0,"Random Char Name",_GUICtrlListView_GetItemText(GUICtrlGetHandle($ListView), $rnum-1))
            EndIf
            
                
            
                
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Func read_ini()
    $charsname=IniReadSectionNames ( @ScriptDir& "\charsname_random_choise.ini")
    If Not @error Then
        For $i=1 to $charsname[0]
            _GUICtrlListView_AddItem($ListView,$charsname[$i])
        Next
    EndIf
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...