Sign in to follow this  
Followers 0
mmavipc

Event isnt working

8 posts in this topic

The GUI events are not working.

Here's my code

Local $th1, $ph1, $backmini
    _trayhide()
    $th1 = WinGetClientSize("[CLASS:Shell_TrayWnd]")
    $ph1 = @DesktopHeight - 150
    If IsArray($th1) Then
        If $th1[1] > 30 Then $ph1 = @DesktopHeight - (150 - (30 - $th1[1]))
    Else
        $th1 = 150
    EndIf
    $mini = GUICreate("L|M|TER Media Player v." & $cver & " - Mini Mode", 299, 99, @DesktopWidth - 320, $ph1, $WS_POPUP)
    $bbmini = 0
    GUISetBkColor($GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetDefBkColor($GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetDefColor(0x000000)
    $backmini = GUICtrlCreatePic($bkmini, 0, 0, 299, 99, $WS_CLIPSIBLINGS)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $xit = GUICtrlCreateLabel("X", 280, 5, 10, 15)
    GUICtrlSetOnEvent($xit, "_mclose")
;~ $elapsedtm = GUICtrlCreateLabel("Elapsed :     00:00:00",5,20,250,15)
    $remainingtm = GUICtrlCreateLabel("00:00:00", 20, 40, 100, 30)
    GUICtrlSetFont(-1, 20, 400)
    GUICtrlSetColor(-1, 0x515151)
    If @OSVersion = "WIN_VISTA" Then
        $ar = _GetExtProperty($playlistsong1, 13)
    Else
        $ar = _GetExtProperty($playlistsong1, 16)
    EndIf
    If @OSVersion = "WIN_VISTA" Then
        $ti = _GetExtProperty($playlistsong1, 21)
    Else
        $ti = _GetExtProperty($playlistsong1, 10)
    EndIf
    $scrollmini = GUICtrlCreateLabel($ar & " - " & $ti & "        ", 20, 17, 160, 18)
    GUICtrlSetFont(-1, 11, 500)
    GUICtrlSetColor(-1, 0x516ed7)
    $miniplay = GUICtrlCreatePic("", 220, 16, 50, 50)
    If _SoundStatus($playlistsong) = "playing" Then
        GUICtrlSetImage($miniplay, $mpaimg)
    Else
        GUICtrlSetImage($miniplay, $mplimg)
    EndIf
    GUICtrlSetOnEvent(-1, "miniplay")
    GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")
    $miniprev = GUICtrlCreatePic($mprimg, 197, 30, 20, 20)
    GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")
    GUICtrlSetOnEvent(-1, "previous")
    $mininext = GUICtrlCreatePic($mneimg, 273, 30, 20, 20)
    GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")
    GUICtrlSetOnEvent(-1, "nexts")
    $ministop = GUICtrlCreatePic($mstimg, 205, 52, 20, 20)
    GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")
    GUICtrlSetOnEvent(-1, "stop")
    $minislider = GUICtrlCreateSlider(15, 75, 259, 25, $TBS_NOTICKS)
    GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")
    GUICtrlSetBkColor(-1, 0x1F44D0)

    _GuiRoundCorners($mini, 0, 0, 39, 36)
    GUISetState()
    GUIRegisterMsg($WM_TIMER, "WM_TIMER")
    $iTimer1 = _Timer_SetTimer($mini, 500)
    Dim $1a
    Dim $txt2
    dim $_i = 0
    While 1
        If $bbmini = 1 Then ExitLoop
        GUICtrlSetLimit($minislider, _SoundLength($playlistsong, 2) / 1000)
        GUICtrlSetData($minislider, ($1a / 1000))
        $txt10 = $ar & " - " & $ti & "       "
        If StringLen($txt10) < 30 Then
            Local $spaces, $spaces1
            $spaces = 30 - StringLen($txt10)
            For $i = 1 To $spaces
                $spaces1 &= " "
            Next
            $txt10 = $ar & " - " & $ti & "       " & $spaces1
        EndIf
        $show = $txt10
        $len = StringLen($txt10)
        $show = StringRight($txt10, $len - $_i) & StringLeft($txt10, $_i)
        If $_i = $len Then $_i = 0
        GUICtrlSetData($scrollmini, $show)
        If $txt2 = "00:00:00" Then
            nexts()
        EndIf
        If _SoundStatus($playlistsong) = "playing" Then
            If $fplay = 0 Then $fplay = 1
            $1a = _SoundPos($playlistsong, 2)
            $1b = _SoundLength($playlistsong, 2)
            $1e = _SoundPos($playlistsong)
            $1f = _SoundLength($playlistsong)
            $1c = Round(($1a / $1b) * 100)
            $1d = Round((($1b - $1a) / 1000) / 60)
            $txt7 = StringRight(GUICtrlRead($elapsedt), 8)
            $txt8 = $1e
            $1f1 = $1f
            $1aa = StringSplit($1f1, ":")
            $txt3 = _SoundMsToTime(_SoundTimeToMs($1aa[1], $1aa[2], $1aa[3]) - $1a)
            If $txt3[0] < 10 Then $txt3[0] = "0" & $txt3[0]
            If $txt3[1] < 10 Then $txt3[1] = "0" & $txt3[1]
            If $txt3[2] < 10 Then $txt3[2] = "0" & $txt3[2]
            $txt2 = $txt3[0] & ":" & $txt3[1] & ":" & $txt3[2]
            $txt1 = StringRight(GUICtrlRead($remainingt), 8)
            If $txt8 <> $txt7 And $txt2 <> $txt1 Then
                If _SoundStatus($playlistsong) = "playing" Then
                    GUICtrlSetData($elapsedtm, $txt8)
                    GUICtrlSetData($remainingtm, $txt2)
                EndIf
            EndIf
        EndIf
        If @OSVersion = "WIN_VISTA" Then
            $ar = _GetExtProperty($playlistsong1, 13)
        Else
            $ar = _GetExtProperty($playlistsong1, 16)
        EndIf
        If @OSVersion = "WIN_VISTA" Then
            $ti = _GetExtProperty($playlistsong1, 21)
        Else
            $ti = _GetExtProperty($playlistsong1, 10)
        EndIf
        $cursor = GUIGetCursorInfo($mini)
        If IsArray($cursor) Then
            If $cursor[2] = 1 And $cursor[4] = $minislider Then
                If _IsPressed("01") And WinActive("L|M|TER Media Player v." & $cver & " - Mini Mode") Then
                    While _IsPressed("01")
                        Sleep(100)
                        _TicksToTime(GUICtrlRead($minislider) / ($1b / 1000) * $1b, $hour, $min, $sec)
                        $s = StringFormat("%i:%02i:%02i", $hour, $min, $sec)
                        ToolTip($s)
                    WEnd
                    ToolTip('')
                    _SoundSeek($playlistsong, $hour, $min, $sec)
                    _SoundPlay($playlistsong)
                EndIf
            EndIf
        EndIf
        $_i += 1
        Sleep(10)
    WEnd

Help please

Thanks in advanced


[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites



You need to tell it to use eventmode:

Opt("GUIOnEventMode", 1)
It is.

That was only a snip of the code


[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It is.

That was only a snip of the code

Better post a (none) working script that has all in it what is needed when you want to receive proper help. :) Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

what the hell. I try and post the whole 2926 script and i gwet left with a blank post b0.o

heres a pastebin(making the pastebin link will come soon)

here you go

http://autoit.pastebin.com/m1a1dcf6d

Edited by mmavipc

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

what the hell. I try and post the whole 2926 script and i gwet left with a blank post b0.o

heres a pastebin(making the pastebin link will come soon)

here you go

http://autoit.pastebin.com/m1a1dcf6d

You better attach the file as your link doesn't work for me.

jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You better attach the file as your link doesn't work for me.

jos

It's too Big to be attached

http://www.sendspace.com/file/usbtoy

http://www.mediafire.com/?sharekey=4f456be...2db6fb9a8902bda

Hopefully one of those 2 links works for you


[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

Share this post


Link to post
Share on other sites

It's too Big to be attached

http://www.sendspace.com/file/usbtoy

http://www.mediafire.com/?sharekey=4f456be...2db6fb9a8902bda

Hopefully one of those 2 links works for you

I am not going to debug that one, much to complex to debug as is.

Just take a copy of the whole thing and start stripping it to exclude as much code as possible and still have the problem.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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