head 1.2; access; symbols; locks; strict; comment @// @; 1.2 date 2002.10.30.20.33.41; author steven; state Exp; branches; next 1.1; 1.1 date 2002.10.29.18.05.14; author steven; state Exp; branches; next ; desc @@ 1.2 log @More changes all around. Added a 'path_to_winamp' option for the client so that winamp can automatically be started if it's not already. Also added more winamputil functions to open_winamp. @ text @#include #include "winamp.h" HWND get_winamp_handle( void ) { return FindWindow("Winamp v1.x",NULL); } void start_playing_winamp( HWND hwin_amp ) { SendMessage(hwin_amp,WM_WA_IPC,0,IPC_STARTPLAY); } int get_output_time( HWND hwin_amp ) { return SendMessage(hwin_amp,WM_WA_IPC,0,IPC_GETOUTPUTTIME); } void jump_to_time( HWND hwin_amp, int msec_pos ) { SendMessage(hwin_amp,WM_WA_IPC,msec_pos,IPC_JUMPTOTIME); } void set_playlist_position( HWND hwin_amp, int pos ) { SendMessage( hwin_amp, WM_WA_IPC, pos, IPC_SETPLAYLISTPOS ); } int get_playlist_position( HWND hwin_amp ) { return SendMessage( hwin_amp, WM_WA_IPC, 0, IPC_GETLISTPOS ); } void set_playlist_to_beginning( HWND hwin_amp ) { SendMessage(hwin_amp, WM_COMMAND,WINAMP_BUTTON1_CTRL,0); } int open_winamp( void ) { extern char *path_to_winamp; int res; STARTUPINFO suInfo; PROCESS_INFORMATION procInfo; memset (&suInfo, 0, sizeof(suInfo)); suInfo.cb = sizeof(suInfo); res = ::CreateProcess(path_to_winamp, NULL, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &suInfo, &procInfo); return res; //0 is failure } @ 1.1 log @Added winamputil files to abstract some of the ugliness of SendMessage away. Added a -? option to print the usage and program name. Also made sure that if the user uses some incorrect options the show_usage() is called. Also made various cleanups. @ text @d24 3 d30 45 a74 1 }@