AutoHotkey Community

It is currently May 27th, 2012, 1:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Postmessage in Winamp
PostPosted: September 10th, 2005, 12:14 am 
Offline

Joined: April 16th, 2005, 1:05 am
Posts: 28
Does anyone know how to get the position of the scroll bar that controls where in the song you are?

i have been looking and looking though all of Postmessage scripts and i can't seem to figure out how it works.

i think that i need to use
0x00E1 const long SBM_GETPOS //gets the pos of scrollbox in scrollbar
0x00E3 const long SBM_GETRANGE //gets range of scrollbar

i looked on msdn.microsoft.com and it says the getpos wParam and lParam should be 0 and for the getrange the wParam and lParam are (WPARAM) (LPINT) lpnMinPos and (LPARAM) (LPINT) lpnMaxPos.

where lpnMinPos is aLong pointer to a value that receives the minimum scrolling position and lpnMaxPos is a Long pointer to a value that receives the maximum scrolling position.

thanks for the help

_________________
cstone


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 10th, 2005, 3:39 am 
The following code will accomplish what you ask:

Code:
; -- Windows message --
WM_USER            = 0x0400

; -- Winamp IPC message --
WM_WA_IPC         := WM_USER
IPC_GETOUTPUTTIME   = 105


; mode =   0 - return position of current track in milliseconds
;         1 - track length in seconds
; returns, -1 if error or not playing
mode = 0

SendMessage, WM_USER, mode, IPC_GETOUTPUTTIME,, ahk_class Winamp v1.x

if ( ErrorLevel = "FAIL" or ErrorLevel = 0xFFFFFFFF )
   MsgBox, "error or not playing"
else if ( mode = 0 )
   MsgBox, % "current position = ". ErrorLevel
else if ( mode = 1 )
   MsgBox, % "track length = ". ErrorLevel
return


For further information, refer to the Winamp SDK. In particular, review the header file "winamp\wa_ipc.h" and "gen_tray\WINAMPCMD.h" for further information identifying control and status retrieval from external processes.


Report this post
Top
  
Reply with quote  
 Post subject: Thanks
PostPosted: September 10th, 2005, 6:51 pm 
Offline

Joined: April 16th, 2005, 1:05 am
Posts: 28
Thank you very much, it works like a charm and it was very easy to convert the millseconds to seconds and remove the floating.

thanks again.

_________________
cstone


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2005, 7:57 pm 
how to make for songname? same example like post above?
(just started AHK, and read manual but helping here will make me progress :))

#define IPC_GETMODULENAME 109
#define IPC_EX_ISRIGHTEXE 666
/* usually shouldnt bother using these, but here goes:
** send a WM_COPYDATA with IPC_GETMODULENAME, and an internal
** flag gets set, which if you send a normal WM_WA_IPC message with
** IPC_EX_ISRIGHTEXE, it returns whether or not that filename
** matches. lame, I know.
*/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 11th, 2005, 8:52 pm 
Offline

Joined: September 25th, 2005, 4:31 pm
Posts: 610
Check this post which demonstrates retrieving the title of the currently selected track.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, WillTroll, Yahoo [Bot] and 30 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group