hi, I try to write a plug-in to change nick per minute,
here is the code..
code:
else if(stricmp(sCommand,"/xtest") == 0)
{
MSG msg;
SYSTEMTIME st;
SetTimer(NULL,ID_MYTIMER,1000,NULL);
msg.message=WM_TIMER;
bool flag=true;
msg.lParam=(LPARAM)true;
static char szTime[64];
while(msg.message != WM_QUIT)
{
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if(msg.message==WM_TIMER && msg.lParam==ID_MYTIMER)
{
GetLocalTime(&st);
wsprintf(szTime,"%02d:%02d:%02d",st.wHour,st.wMinute,st.wSecond);
SetNewName(szTime);
}
Sleep(1);
}
but it doesn't work.....
What's wrong with my program? Thanks!!