Jump to content

Vista and XP Sorting problem


PYRODOG
 Share

Recommended Posts

Ok so here is my problem I wrote this program for my daughters so they could find and watch their own media... The problem is well more like an annoyance is on my vista box where I coded this under the movies section all the movies sort fine everything is good... When I move this program to a xp box I can’t get it to sort the movies at all it looks like it tries like a few movies will be in the right place but its scrambled for the most part... honestly the program works great, my daughters love it and I don’t need to keep putting movies on for them... I would really like it to sort and there isn’t any reason why it shouldn't be... any help on this would be great and positive or negative feedback is cool thanks in advance...

#NoTrayIcon
#include <MouseSetOnEvent_UDF.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GuiListView.au3>
#include <File.au3>
#include <Misc.au3>

HotKeySet("{ESC}", "Terminate")

    Opt('MustDeclareVars', 1)

    Global $Games, $directory, $FileList, $File_Name, $NMLISTVIEW, $GUIMOVIE, $GUIGAMES, $TVBUTTON, $MOVIESBUTTON, $GAMESBUTTON, $TVEXIT, $GUIMAIN, $GUITV, $TVNEXT
    Global $deskh, $deskw, $exitbutton, $exitloop, $blackscreen, $GUIEXIT, $GUILOAD, $Paint, $i, $seltxt, $movieexit,$loading, $GAMESEXIT
    Global $listview, $button, $item1, $item2, $item3, $input1, $uparrow, $downarrow, $gobutton, $moviename, $nRow = 0, $avArray[1], $item, $iLastItem = -1, $ret
    Global $BUTTONLOOP, $BUTTONADD, $BUTTONWIDTH, $BUTTONHEIGHT, $BUTTONNUMBER[99], $N, $pausebutton, $moviepath
    Global $GUITV2, $TVEXIT2
    
    $exitloop = 0
    $deskh = @DesktopHeight
    $deskw = @DesktopWidth
    
    
    _BlockMouseClicksInput(0)
    If ProcessExists("SAVER.exe") = 0 Then Run("SAVER.exe")
    Call("Main") 

Func Main() 
    $GUIMAIN = GUICreate("Main",$deskw,$deskh)
    GUICtrlCreatePic(@WorkingDir&"\images\mainbanner.bmp",$deskw / 2 - 300,10,600,150)
    $TVBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\tvbutton.bmp", .25 * $deskw - 125, $deskh / 2 - 125, 250, 250)
    $MOVIESBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\moviesbutton.bmp", .50 * $deskw - 125, $deskh / 2 - 125, 250, 250)
    $GAMESBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\gamesbutton.bmp", .75 * $deskw - 125, $deskh / 2- 125, 250, 250)
    GUISetBkColor(0xF665AB)
    GUISetState()
    WinSetOnTop("Main", "", 1)
    
        While 1
        If WinActive("Main") = 0 Then WinActivate("Main")
        Switch GUIGetMsg()
            Case $TVBUTTON
                WinSetState("Main", "", @SW_HIDE)
                Call ("TVshows")
                WinSetState("Main", "", @SW_SHOW)
            Case $MOVIESBUTTON
                WinSetState("Main", "", @SW_HIDE)
                Call ("Movies")
                WinSetState("Main", "", @SW_SHOW)
            Case $GAMESBUTTON
                WinSetState("Main", "", @SW_HIDE)
                Call ("Games")
                WinSetState("Main", "", @SW_SHOW)
            Case Else
        EndSwitch
    WEnd
EndFunc

Func TVshows()  
    $GUITV = GUICreate("TVshows",$deskw,$deskh)
    GUICtrlCreatePic(@WorkingDir&"\images\tvbanner.bmp",$deskw / 2 - 300,10,600,150)
    $TVEXIT = GUICtrlCreatePic(@WorkingDir&"\images\exit.bmp", $deskw - 100, 0, 100, 100)
    $TVNEXT = GUICtrlCreatePic(@WorkingDir&"\images\next.bmp", 0, 0, 100, 100)
    GUISetBkColor(0x59E817)
    GUISetState()
    WinSetOnTop("TVshows", "", 1)
    
    $BUTTONADD = 1
    $BUTTONWIDTH = 60
    $BUTTONHEIGHT = 170
    For $BUTTONLOOP = 1 to 28
    $N = $BUTTONADD
    $BUTTONNUMBER[$N] = GUICtrlCreatePic(@WorkingDir&"\images\tvbuttons\"&$BUTTONADD&".bmp", $BUTTONWIDTH, $BUTTONHEIGHT, 128, 128)
    $BUTTONADD =  $BUTTONADD + 1
    $BUTTONWIDTH = $BUTTONWIDTH + 149
    if $BUTTONWIDTH > $deskw - 149 Then
        $BUTTONHEIGHT = $BUTTONHEIGHT + 149
        $BUTTONWIDTH = 60
    EndIf
    Next
    
    ;JUST NOTES FOR WHAT GOES TO WHAT
    ;1   Animaniacs
    ;2   Blues Clues
    ;3   Clifford The Big Red Dog
    ;4   Dora the Explorer
    ;5   Doug
    ;6   Duck Tales
    ;7   GO Diego GO
    ;8   Jetsons
    ;9   Hey Arnold
    ;10  Kim Possible
    ;11  Lazy Town
    ;12  Little Einsteins
    ;13  Rockos ModernLife
    ;14  Rugrats
    ;15  Scooby Doo
    ;16  Talespin
    ;17  The Backyardigans
    ;18  The Flintstones
    ;19  The Smurfs
    ;20  The Wiggles
    ;21  Thomas The Train
    ;22  Tiny Toon Adventures
    ;23  Yo Gabba Gabba
    ;24  Inspector Gadget
    ;25  Bill Nye The Science Guy
    ;26  Chip N Dale Rescue Rangers
    ;27  Darkwing Duck
    ;28  ReBoot
    
    While 1
        If WinActive("TVshows") = 0 Then WinActivate("TVshows")
        Switch GUIGetMsg()
            Case $TVEXIT
                GUIDelete($GUITV)
                return 
            Case $TVNEXT
                WinSetState($GUITV, "", @SW_HIDE)
                Call ("TVshows2")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[1]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Animaniacs.m3u"),"","",@SW_MINIMIZE)             
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[2]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Blues Clues.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[3]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Clifford The Big Red Dog.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[4]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Dora the Explorer.m3u"),"","",@SW_MINIMIZE)              
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[5]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Doug.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[6]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Duck Tales.m3u"),"","",@SW_MINIMIZE)             
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[7]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\GO Diego GO.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[8]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Jetsons.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[9]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Hey Arnold.m3u"),"","",@SW_MINIMIZE)             
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[10]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Kim Possible.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[11]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Lazy Town.m3u"),"","",@SW_MINIMIZE)              
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[12]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Little Einsteins.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[13]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Rockos Modern Life.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[14]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Rugrats.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[15]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Scooby-Doo.m3u"),"","",@SW_MINIMIZE)             
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[16]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Talespin.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[17]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\The Backyardigans.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[18]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\The Flintstones.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[19]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\The Smurfs.m3u"),"","",@SW_MINIMIZE)             
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[20]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\The Wiggles.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[21]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Thomas The Train.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton") 
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[22]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Tiny Toon Adventures.m3u"),"","",@SW_MINIMIZE)               
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)   
            Case $BUTTONNUMBER[23]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Yo Gabba Gabba.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[24]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Inspector Gadget.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[25]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Bill Nye The Science Guy.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[26]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Chip N Dale Rescue Rangers.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[27]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\Darkwing Duck.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case $BUTTONNUMBER[28]
                WinSetState($GUITV, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\ReBoot.m3u"),"","",@SW_MINIMIZE)
                Call ("exitbutton")
                WinSetState($GUITV, "", @SW_SHOW)
            Case Else
        EndSwitch
    WEnd
EndFunc

Func TVshows2() 
    $GUITV2 = GUICreate("TVshows2",$deskw,$deskh)
    GUICtrlCreatePic(@WorkingDir&"\images\tvbanner2.bmp",$deskw / 2 - 300,10,600,150)
    $TVEXIT2 = GUICtrlCreatePic(@WorkingDir&"\images\exit.bmp", $deskw - 100, 0, 100, 100)
    GUISetBkColor(0x3BB9FF)
    GUISetState()
    WinSetOnTop("TVshows2", "", 1)
    
    $BUTTONADD = 29
    $BUTTONWIDTH = 60
    $BUTTONHEIGHT = 170
    For $BUTTONLOOP = 1 to 1
    $N = $BUTTONADD
    $BUTTONNUMBER[$N] = GUICtrlCreatePic(@WorkingDir&"\images\tvbuttons\"&$BUTTONADD&".bmp", $BUTTONWIDTH, $BUTTONHEIGHT, 128, 128)
    $BUTTONADD =  $BUTTONADD + 1
    $BUTTONWIDTH = $BUTTONWIDTH + 149
    if $BUTTONWIDTH > $deskw - 149 Then
        $BUTTONHEIGHT = $BUTTONHEIGHT + 149
        $BUTTONWIDTH = 60
    EndIf
    Next
    
    ;JUST NOTES FOR WHAT GOES TO WHAT
    ;1   The Powerpuff Girls

    
    While 1
        If WinActive("TVshows2") = 0 Then WinActivate("TVshows2")
        Switch GUIGetMsg()
            Case $TVEXIT2
                GUIDelete($GUITV2)
                Return
            Case $BUTTONNUMBER[29]
                WinSetState($GUITV2, "", @SW_HIDE)
                ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName(@WorkingDir&"\playlists\The Powerpuff Girls.m3u"),"","",@SW_MINIMIZE)                
                Call ("exitbutton")
                WinSetState($GUITV2, "", @SW_SHOW)
            Case Else
        EndSwitch
    WEnd
EndFunc

Func Movies()

    $GUIMOVIE = GUICreate("movies", $deskw, $deskh)
    $UPARROW = GUICtrlCreatePic(@WorkingDir&"\images\uparrow.bmp", 130 , 10, 64, 64)
    $DOWNARROW = GUICtrlCreatePic(@WorkingDir&"\images\downarrow.bmp", 130 , $deskh - 74 , 64, 64)
    $GOBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\moviebuttons\moviesfront.bmp", 320 , $deskh / 2 - 300, 600, 600)
    $MOVIEEXIT = GUICtrlCreatePic(@WorkingDir&"\images\exit.bmp", $deskw - 100, 0, 100, 100)
    GUISetBkColor(0xC031C7)
    GUISetState()
    WinSetOnTop("movies", "", 1)
    
    $DIRECTORY = "\\192.168.1.200\media\Kids Movies"
    $FILELIST =_FileListToArray($DIRECTORY,'*.*',  1)
    If @Error=1 Then
        ProcessClose("vlc.exe")
        GUIDelete($GUIMOVIE)
        Call("Main")
    EndIf 
    
    $LISTVIEW = GUICtrlCreateListView("", 10, $deskh / 2 - 300 , 300, 600)
    

    $N = 0
    For $N = 1 to UBound($FILELIST)-1
        $File_Name = $FILELIST[$N]
        $ITEM = GUICtrlCreateListViewItem( $File_Name, $LISTVIEW)
    Next

    _GUICtrlListView_RegisterSortCallBack($LISTVIEW)
    _GUICtrlListView_InsertColumn($LISTVIEW, 0, "Movie Name",278)
    _GUICtrlListView_SortItems($LISTVIEW,0)
    
    GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events")
    
    Send("{TAB}")
    
    While 1
        If WinActive("movies") = 0 Then WinActivate("movies")
        Switch GUIGetMsg()
            Case $movieexit
                _GUICtrlListView_UnRegisterSortCallBack($listview)
                GUIDelete($GUIMOVIE)
                Return
            Case $uparrow
                Send("{UP}")
            Case $downarrow
                Send("{DOWN}")
            Case $gobutton
                If $moviepath <> "" Then
                    WinSetState("movies", "", @SW_HIDE)
                    ShellExecute("C:\Program Files\VideoLAN\VLC\vlc.exe", FileGetShortName("\\192.168.1.200\media\Kids Movies\"&$moviepath),"","",@SW_MINIMIZE)
                    Call ("exitbutton")
                    WinSetState("movies", "", @SW_SHOW)
                EndIf
            Case Else
        EndSwitch   
    WEnd
EndFunc

Func Games()
    $GUIGAMES = GUICreate("games",$deskw,$deskh)
    GUICtrlCreatePic(@WorkingDir&"\images\gamesbanner.bmp",$deskw / 2 - 300,10,600,150)
    $GAMESEXIT = GUICtrlCreatePic(@WorkingDir&"\images\exit.bmp", $deskw - 100, 0, 100, 100)
    GUISetBkColor(0xFF8040)
    GUISetState()
    WinSetOnTop("games", "", 1)
    
    $BUTTONADD = 1
    $BUTTONWIDTH = 21
    $BUTTONHEIGHT = 170
    For $BUTTONLOOP = 1 to 6
    $N = $BUTTONADD
    $BUTTONNUMBER[$N] = GUICtrlCreatePic(@WorkingDir&"\images\gamebuttons\"&$BUTTONADD&".bmp", $BUTTONWIDTH, $BUTTONHEIGHT, 128, 128)
    $BUTTONADD =  $BUTTONADD + 1
    $BUTTONWIDTH = $BUTTONWIDTH + 149
        if $BUTTONWIDTH > $deskw - 149 Then
            $BUTTONHEIGHT = $BUTTONHEIGHT + 149
            $BUTTONWIDTH = 21
        EndIf
    Next
    
    ;JUST NOTES FOR WHAT GOES TO WHAT
    ;1   Tuxpaint
    ;2   Smart Phonics 1
    ;3   Smart Phonics 2
    ;4   Smart Phonics 3
    ;5   Smart Phonics 4
    ;6   
    
    While 1
        If WinActive("games") = 0 Then WinActivate("games")
        Switch GUIGetMsg()
            Case $GAMESEXIT
                GUIDelete($GUIGAMES)
                Return
            Case $BUTTONNUMBER[1]
                WinSetState($GUIGAMES, "", @SW_HIDE)
                BlockInput(1)
                ShellExecute(@WorkingDir&"\games\tuxpaint\tuxpaint.exe")
                Sleep(10000)
                BlockInput(0)
                Do
                Sleep(2000)
                Until ProcessExists("tuxpaint.exe") = 0
                WinSetState($GUIGAMES, "", @SW_SHOW)
            Case $BUTTONNUMBER[2]
                WinSetState($GUIGAMES, "", @SW_HIDE)
                BlockInput(1)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
                Sleep(3000)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -mount 0," & Chr(34) & "G:\Kids Game Images\Smart Kids Phonics 1.iso" & Chr(34))
                WinWait("Smartkids")
                Sleep(5000)
                WinSetOnTop("Smartkids", "", 1)
                BlockInput(0)
                Do
                Sleep(2000)
                Until ProcessExists("Smart_Phonics_1.exe") = 0
                WinSetState($GUIGAMES, "", @SW_SHOW)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
            Case $BUTTONNUMBER[3]
                WinSetState($GUIGAMES, "", @SW_HIDE)
                BlockInput(1)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
                Sleep(3000)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -mount 0," & Chr(34) & "G:\Kids Game Images\Smart Kids Phonics 2.iso" & Chr(34))
                WinWait("Smartkids")
                Sleep(5000)
                WinSetOnTop("Smartkids", "", 1)
                BlockInput(0)
                Do
                Sleep(2000) 
                Until ProcessExists("Smart_Phonics_2.exe") = 0
                WinSetState($GUIGAMES, "", @SW_SHOW)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
            Case $BUTTONNUMBER[4]
                WinSetState($GUIGAMES, "", @SW_HIDE)                
                BlockInput(1)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
                Sleep(3000)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -mount 0," & Chr(34) & "G:\Kids Game Images\Smart Kids Phonics 3.iso" & Chr(34))
                WinWait("Smartkids")
                Sleep(5000)
                WinSetOnTop("Smartkids", "", 1)
                BlockInput(0)
                Do
                Sleep(2000) 
                Until ProcessExists("Smart_Phonics_3.exe") = 0
                WinSetState($GUIGAMES, "", @SW_SHOW)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
            Case $BUTTONNUMBER[5]
                WinSetState($GUIGAMES, "", @SW_HIDE)
                BlockInput(1)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
                Sleep(3000)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -mount 0," & Chr(34) & "G:\Kids Game Images\Smart Kids Phonics 4.iso" & Chr(34))
                WinWait("Smartkids")
                Sleep(5000)
                WinSetOnTop("Smartkids", "", 1)
                BlockInput(0)
                Do
                Sleep(2000) 
                Until ProcessExists("Smart_Phonics_4.exe") = 0
                WinSetState($GUIGAMES, "", @SW_SHOW)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
            Case $BUTTONNUMBER[6]
                WinSetState($GUIGAMES, "", @SW_HIDE)
                BlockInput(1)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
                Sleep(3000)
                Run("C:\Program Files\D-Tools\daemon.exe" & " -mount 0," & Chr(34) & "G:\Kids Game Images\JumpStart Phonics.iso" & Chr(34))
                Sleep(3000)
                ProcessClose("AUTORUN.EXE")
                Sleep(3000)
                Run("C:\Program Files\JumpStart\JumpStart Phonics\PHONICS.EXE")
                WinWait("JumpStart Phonics")
                Sleep(5000)
                WinSetOnTop("JumpStart Phonics", "", 1)
                BlockInput(0)
                Do
                Sleep(2000)
                Until ProcessExists("PHONICS.exe") = 0
                BlockInput(1)
                Sleep(5000)
                BlockInput(0)
                WinSetState($GUIGAMES, "", @SW_SHOW)
            Case Else
        EndSwitch
    WEnd    

EndFunc

Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam)


    If ControlGetFocus('movies') Then
        #forceref $hWndGUI, $MsgID, $wParam
        Local $tagNMHDR, $event
        $tagNMHDR = DllStructCreate("int", $lParam);NMHDR (hwndFrom, idFrom, code)
        
        $event = DllStructGetData($tagNMHDR, 3)
        Select
            Case $wParam = $listview

                Select
                        
             Case $LVN_ITEMCHANGED
                $NMLISTVIEW = DllStructCreate($tagNMLISTVIEW, $lParam)
                If BitAND(DllStructGetData($NMLISTVIEW, "Changed"), $LVIF_STATE) = $LVIF_STATE And _
                   DllStructGetData($NMLISTVIEW, "NewState") <> DllStructGetData($NMLISTVIEW, "OldState") Then 
                      $i = _GUICtrlListView_GetNextItem($ListView) ; current selected
                      $seltxt = _GUICtrlListView_GetItemText($ListView,$i)
                      $moviepath = $seltxt
                      $moviename = StringTrimRight($seltxt, 4)
                            GUICtrlSetImage($gobutton, @WorkingDir&"\images\moviebuttons\"&$moviename&".bmp")
                   EndIf
                EndSelect
        EndSelect
        $tagNMHDR = 0
        $event = 0
        $lParam = 0
        Return 
    EndIF
EndFunc

Func ExitButton()
    
    $GUIEXIT = GUICreate("exit",100,200, $deskw - 100, 0, $WS_POPUP)
    GUISetState(@SW_SHOW)
    $EXITBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\exit.bmp", 0, 0, 100, 100)
    $PAUSEBUTTON = GUICtrlCreatePic(@WorkingDir&"\images\pause.bmp", 0, 100, 100, 100)
    
    $GUILOAD = GUICreate("loading", $deskw,$deskh, "", "", $WS_POPUP)
    GUISetState(@SW_SHOW)
    $LOADING = GUICtrlCreateButton("loading", $deskw / 2 - 250, 300, 500, 150, $BS_BITMAP)
    GUICtrlSetImage(-1, @WorkingDir&"\images\loading.bmp")
    GUISetBkColor(0x0000000)
    
    WinSetOnTop("loading", "", 1)
    WinSetOnTop("exit", "", 1)
    
    Do
        _MouseTrap(@DesktopWidth - 100,0, @DesktopWidth, 100)
        WinSetOnTop("loading", "", 1)
        WinSetOnTop("exit", "", 1)
        If ProcessExists("vlc.exe") = 0 Then
            GUIDelete($GUIEXIT)
            ExitLoop
        EndIf
        If GUIGetMsg() = $exitbutton Then
            GUIDelete($GUIEXIT)
            ProcessClose("vlc.exe")
            ExitLoop
        EndIf
        WinWait("[class:VLC DirectX]", "", 1)
    Until WinExists("[class:VLC DirectX]") = 1
    
    GUIDelete($GUILOAD)
    _MouseTrap()
    WinSetOnTop("[class:VLC DirectX]", "", 1)
    
    While 1
    
        _MouseTrap(@DesktopWidth - 100,0, @DesktopWidth, 200)   
        WinSetOnTop("exit", "", 1)
        If ProcessExists("vlc.exe") = 0 Then
            GUIDelete($GUIEXIT)
            ExitLoop
        EndIf
        
        Switch GUIGetMsg()  
            Case $pausebutton
                ControlSend("[class:VLC DirectX]", "", "", "{SPACE}")
                WinActivate("[class:VLC DirectX]")
            Case $exitbutton
                ExitLoop
            Case Else
        EndSwitch
        
    WEnd        

    GUIDelete($GUIEXIT)
    ProcessClose("vlc.exe")
    _MouseTrap()
EndFunc

Func _BlockMouseClicksInput($iOpt=0)
    If $iOpt = 0 Then
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_WHELLUP_EVENT, "__Dummy")
        _MouseSetOnEvent($MOUSE_WHELLDOWN_EVENT , "__Dummy")
    Else
        _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT)
        _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)
        _MouseSetOnEvent($MOUSE_WHELLUP_EVENT)
        _MouseSetOnEvent($MOUSE_WHELLDOWN_EVENT )
    EndIf
EndFunc

Func Terminate()
    _BlockMouseClicksInput(1)
    Run("C:\Program Files\D-Tools\daemon.exe" & " -unmount 0")
    ProcessClose("vlc.exe")
    ProcessClose("SAVER.exe")
    Exit 0
EndFunc
Link to comment
Share on other sites

sooo i figured it out and i can't believe it happend the same day i posted my problem anyway

on line 328 i added $LVS_SORTASCENDING i feel so stupid this has been an issue since i wrote it well thanks anyway if you were looking in to it

$LISTVIEW = GUICtrlCreateListView("", 10, $deskh / 2 - 300 , 300, 600,$LVS_SORTASCENDING)
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...