View Single Post
Old 2nd December 2010, 20:14   #9
Stuvning
Junior Member
 
Join Date: May 2010
Posts: 37
That sounds like a good idea but I haven't been able to implement a proper timer. Right now I'm doing it this way which is obviously a bad idea. How would I go about doing it the proper way?
PHP Code:
// Global Variable that keeps original window procedure for Winamp.
WNDPROC lpWndProcOld NULL


LRESULT CALLBACK MainWndProc(HWND hwndUINT messageWPARAM wParamLPARAM lParam)
{

    
int pos;
    
int marker [5]= { 510101520 };


    if (
message==WM_TIMER)
    {
        
int playstatus SendMessage(hwnd,WM_WA_IPC,0,IPC_ISPLAYING);

        if(
playstatus==1){    

            
int length SendMessage(hwnd,WM_WA_IPC,0,IPC_GETLISTLENGTH);


            
pos=SendMessage(plugin.hwndParentWM_WA_IPC0IPC_GETOUTPUTTIME)/1000;
            

            for(
int i=0;i<sizeof(marker)/sizeof(int);i++) {
                if (
pos == marker[i]) {

                
                    
SendMessage(plugin.hwndParent,WM_WA_IPC,i,IPC_SETPLAYLISTPOS);
                    
SendMessage(plugin.hwndParent,WM_COMMAND,MAKEWPARAM(WINAMP_BUTTON2,0),0); 

                }
            }

        }

    }
    return 
CallWindowProc(lpWndProcOld,hwnd,message,wParam,lParam);

Stuvning is offline   Reply With Quote