I'm writing a plugin for the musicplayer named MusicBee. The plugin is for the Logitech G keyboards LCD. Now I will look at buttons activity every 30ms so everyting is fast when pressing on it. I will use the setTimer function of windows.h but I can't get it to work in my dll file. Can someone help me with this little problem??
The code I have is (TimerProc function is a static function):
Logitech * Logitech::LogitechObject;
Logitech::Logitech(): stopthread(false), firstTime(true), position(0), duration(0)
{
LogitechObject = this;
SetTimer(NULL, 1, 30, &Logitech::TimerProc);
}
Logitech::~Logitech()
{
stopthread = true;
this->state = StatePlay::Undefined;
timerThread.detach();
}
VOID CALLBACK Logitech::TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
LogitechObject->time = 0;
LogitechObject->m_lcd.SetProgressBarPosition(LogitechObject->progressbar, static_cast<FLOAT>(100));
LogitechObject->m_lcd.Update();
SetTimer(NULL, 1, 30, &Logitech::TimerProc);
}