Not quite sure how to do this one
Hi,
I've been writing an app that plays music from youtube in a sort of itunes style (ie from a user genorated library of songs). This is all fine. My problem, however, is that i would like an easier way to add a song found on youtube to the library (currently, you have to copy the youtube code from the address bar, and paste it into a song entry form).
I'm aiming to have some sort of key combo, that when pressed (hopefully regardless of whether the app is focused or not), the app automatically grabs the current address in the browser (firefox) and saves it to a file.
It's the non-focused key combo && API stuff to grab the address that im struggling with. Cheers guys.
Frank
Re: Not quite sure how to do this one
This looks like it might be what you're after for the key combo stuff:
http://www.pinvoke.net/default.aspx/...terHotKey.html
If not, some good keywords are global keyboard hook
Re. getting the address, you'll probably have to do something with the FindWindow(Ex) APIs although this sort of thing could be tricky as you'd have to determine what browser the user is using.
It would be MUCH easier to just read the clipboard (for example) and use that rather than working out where the URL was.
Re: Not quite sure how to do this one
It would be easier but that's pretty much the way im doing it now. But i do have a new question though.
This is the way the app is set out:
Quote:
Main Form
----------
This has the menus and controls (ie play, stop etc). A listbox contains all the songs in your library. When you double click a song or hit play, a hidden form is opened (HiddenForm).
HiddenForm
-----------
This simply contains a webbrowser control which navigates to your chosen song. Hitting stop on the mainform navigates to google (therefore stopping the song).
Im having some trouble with pause. I originally thought i would just send the required number of tabs and then a return with sendkeys but this failed. any other suggestions?