Kreatorul Posted October 6, 2006 Share Posted October 6, 2006 What's wrong in here? I am trying to make a simple program to show a little popup window with the name of the current song when the winamp song changes...but i donno what's wrong :"> #include <GUIConstants.au3> Opt('WinTitleMatchMode', 4) $cur=StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '') RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", $cur) $reg=RegRead("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong") $gui=GUICreate("Winamp Current Song", 1300, 35, 0, 0,$WS_POPUP) $label=GuiCtrlCreateLabel($cur, 2, 2, 1300, 50, $SS_CENTER) GuiCtrlSetFont($label, 22) GUISetState() WinSetTrans($gui ,"", 150) WinSetOnTop($gui, "", 1) While 1 $msg=GuiGetMsg() RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) If StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')<>$reg Then GuiSetState() GuiCtrlSetData($label, StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) Sleep(3000) GuiSetState(@SW_HIDE) Else GuiSetState(@SW_HIDE) EndIf WEnd Link to comment Share on other sites More sharing options...
FuryCell Posted October 6, 2006 Share Posted October 6, 2006 What's wrong in here? I am trying to make a simple program to show a little popup window with the name of the current song when the winamp song changes...but i donno what's wrong :"> #include <GUIConstants.au3> Opt('WinTitleMatchMode', 4) $cur=StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '') RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", $cur) $reg=RegRead("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong") $gui=GUICreate("Winamp Current Song", 1300, 35, 0, 0,$WS_POPUP) $label=GuiCtrlCreateLabel($cur, 2, 2, 1300, 50, $SS_CENTER) GuiCtrlSetFont($label, 22) GUISetState() WinSetTrans($gui ,"", 150) WinSetOnTop($gui, "", 1) While 1 $msg=GuiGetMsg() RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) If StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')<>$reg Then GuiSetState() GuiCtrlSetData($label, StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) Sleep(3000) GuiSetState(@SW_HIDE) Else GuiSetState(@SW_HIDE) EndIf WEnd Don't use winamp so I can't test your script. However take a look at this topic. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted October 6, 2006 Moderators Share Posted October 6, 2006 Yep, that could be done very easily with my Winamp.au3 library. Link to comment Share on other sites More sharing options...
Kreatorul Posted October 6, 2006 Author Share Posted October 6, 2006 But I have to install ActiveWinamp and I want to do this without that...what am I doing wrong in there? Link to comment Share on other sites More sharing options...
FuryCell Posted October 7, 2006 Share Posted October 7, 2006 (edited) Maybe you should show the GUI after you assign data to it. #include <GUIConstants.au3> Opt('WinTitleMatchMode', 4) $cur = StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '') RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", $cur) $reg = RegRead("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong") $gui = GUICreate("Winamp Current Song", 1300, 35, 0, 0, $WS_POPUP) $label = GUICtrlCreateLabel($cur, 2, 2, 1300, 50, $SS_CENTER) GUICtrlSetFont($label, 22) GUISetState() WinSetTrans($gui, "", 150) WinSetOnTop($gui, "", 1) While 1 $msg = GUIGetMsg() RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) If StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '') <> $reg Then GUISetState() GUICtrlSetData($label, StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) RegWrite("HKEY_LOCAL_MACHINE\Software\WinampCurSong", "CurSong", "REG_SZ", StringReplace(WinGetTitle('Classname=Winamp v1.x'), '- Winamp', '')) Sleep(3000) GUISetState(@SW_SHOW) Else GUISetState(@SW_HIDE) EndIf WEnd Not sure though as I don't have WinAmp to test the script with. Edited October 7, 2006 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted October 7, 2006 Moderators Share Posted October 7, 2006 But I have to install ActiveWinamp and I want to do this without that...what am I doing wrong in there? But I have to install AutoIt and I want to run .au3 scripts without it. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 7, 2006 Share Posted October 7, 2006 (edited) Here you go #include <Array.au3> $WinampTitle = WinampGetTitle() If not @error Then _ArrayDisplay($WinampTitle,"") Else MsgBox(0, "", "No songs are being played or Winamp is not being run") EndIf Func WinampGetTitle() Local $Return[2] Opt("WinTitleMatchMode", 2) $Title = WinGetTitle(" - Winamp") If $Title Then $Split = StringSplit($Title,".-") $Return[0] = $Split[2] $Return[1] = $Split[3] Return $Return Else SetError(1) Return EndIf EndFunc Edited October 7, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now