Maffe811 Posted May 23, 2011 Posted May 23, 2011 expandcollapse popup#NoTrayIcon #Include <Constants.au3> #include <GUIConstants.au3> #include <IE.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayOnEventMode",1) Opt("TrayMenuMode",1) Global $Height = 600 Global $Widht = 1200 TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"SpecialEvent") $exititem = TrayCreateItem("Exit") Global $PanTask = _IECreateEmbedded() GUICreate("Grooveshark Player", $Widht, $Height, 0, 0, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $PanGUI = GUICtrlCreateObj($PanTask, 0, 0, $Widht+180, $Height) GuiSetState() _IENavigate ($PanTask, "http://grooveshark.com", 0) ;TraySetIcon("C:\Users\mola\Desktop\Grooveshark Player\Grooveshark_image.ico") TraySetState(2) While 1 $msg = GuiGetMsg() Select ;Case $msg = $GUI_EVENT_MINIMIZE ; GuiSetState(@SW_HIDE) ; TraySetState(1) ; show ;TraySetToolTip ("Grooveshark Player") Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect ;$GUI = TrayGetMsg() ;If $GUI = $exititem Then Exit WEnd Func SpecialEvent() GuiSetState(@SW_Show) TraySetState(2) ; hide EndFunc Can some one help me adding a hotkey for {MEDIA_PLAY_PAUSE} to make it affect the play/pause button in the window, without bringing the window up from the tray ? Im totaly new to this, and i havent found an example wich can help... [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
Realm Posted May 23, 2011 Posted May 23, 2011 Hello Maffe881, Welcome to AutoIt. Have you tried _IELinkClickByIndex(), _IELinkClickByText(), or _IEImgClick()? I have never needed the window to be in view for these functions to click there needed links. Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.
AdmiralAlkex Posted May 23, 2011 Posted May 23, 2011 Can some one help me adding a hotkey for {MEDIA_PLAY_PAUSE}That's HotKeySet(), see helpfile .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Maffe811 Posted May 23, 2011 Author Posted May 23, 2011 I read the helpfile as much as i can! But ill get to that later Mr. Admiral sir! My problem now is that i dont understand what $o_object does... Object variable of an InternetExplorer.Application, Window or Frame objectWHAT DOES THAT MEAN ??? _IEImgClick ( ByRef $o_object, $s_linkText [, $s_mode = "src" [, $i_index = 0 [, $f_wait = 1]]] ) What do i put in there ? :/ The site where i want it to work ? Im not sure $oIE = _IE_Example ("basic") _IEImgClick ($oIE, "http://static.a.gs-cdn.net/webincludes/css/images/skeleton/nav.png", "src", 1) [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
Maffe811 Posted May 23, 2011 Author Posted May 23, 2011 No one to help me ? I found a workaround:HotKeySet("{MEDIA_PLAY_PAUSE}", "MediaPlayPause") Func MediaPlayPause() WinActivate ($GUIName) MouseClick("main", 31, 609) EndFuncthe $GUIName is a variable i use for wherever i need to put in the name of the GUI But i really need something that will play/pause, without bringing the window up. [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
Maffe811 Posted May 23, 2011 Author Posted May 23, 2011 expandcollapse popup#NoTrayIcon #Include <Constants.au3> #include <GUIConstants.au3> #include <IE.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> ;Tray settings Opt("TrayOnEventMode",1) Opt("TrayMenuMode",3) ;TraySetIcon("C:\Users\mola\Desktop\Grooveshark Player\Grooveshark_image.ico") TraySetState(1); 1 is hidden, 2 is shown ;Tray menu $info = TrayCreateItem("Program created by Maffe811") TrayCreateItem ("") $trayplaypause = TrayCreateItem("Play/Pause") TrayCreateItem ("") TrayItemSetState($info, 128) $exititem = TrayCreateItem("Exit") ;What to do when the tray is clicked TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "TrayClick") ;The function to show the GUI when you click on the tray icon Func TrayClick() GuiSetState(@SW_Show) TraySetState(2) ;Hide the tray icon when it the GUI is restored. EndFunc ;GUI widht and height Global $Height = 600 Global $Widht = 1200 ;The gui and program itself Global $GUIName = "Grooveshark Player by Maffe811" Global $PanTask = _IECreateEmbedded() GUICreate($GUIName, $Widht, $Height, 0, 0, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $PanGUI = GUICtrlCreateObj($PanTask, 0, 0, $Widht+180, $Height) GuiSetState() _IENavigate ($PanTask, "http://grooveshark.com", 0) ;Hotkeys HotKeySet("{MEDIA_PLAY_PAUSE}", "MediaPlayPause") ;Hotekey functions Func MediaPlayPause() WinActivate ($GUIName) MouseClick("main", 31, 609, 1, 0) EndFunc While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE) TraySetState(1) ; show TraySetToolTip ("Grooveshark Player") Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect $GUI = TrayGetMsg() If $GUI = $exititem Then Exit EndIf ;If $GUI = $trayplaypause Then ; Call ("MediaPlayPause") ; Sleep (500) ; TrayItemSetState($trayplaypause, 4) ; MsgBox (0,"","Test") ;EndIf WEnd Okay, right now if i minimize the program, it disapears into the tray icon. Good! Then if i left click the tray menu comes up. Bad! Its supposed to un-minimize it from the tray, but instead the menu comes up and then when you click away from the menu it un-mininmizes it... Idk what to do... Do i make a TraySetOnEvent($TRAY_EVENT_SECONDARYUP, "TrayRightClick") Func TrayRightClick() ShowTrayMenu EndFunc ? I have no idea what to do to fix... [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
somdcomputerguy Posted May 23, 2011 Posted May 23, 2011 Utilize the API, Grooveshark Help, and you can write your own GUI around it. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Maffe811 Posted May 23, 2011 Author Posted May 23, 2011 Ive never touched an API... ... So... how do i use it... ? Second, it wouldnt be easier to tell me what $o_object is ? [font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]
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