intptr_t SetTimer(int interval, timerCallback callback, void *data)
{
+ HWND hwnd = GetActiveWindow();
+ if (!hwnd)
+ {
+ hwnd = FindWindow(DALI_WINDOW_CLASS_NAME.c_str(), nullptr);
+ }
+
+ if (!hwnd)
+ {
+ return -1;
+ }
+
TTimerCallbackInfo *callbackInfo = new TTimerCallbackInfo;
callbackInfo->data = data;
callbackInfo->callback = callback;
- callbackInfo->hWnd = ::GetActiveWindow();
+ callbackInfo->hWnd = hwnd;
INT_PTR timerID = (INT_PTR)callbackInfo;
- ::SetTimer( callbackInfo->hWnd, timerID, interval, TimerProc );
+ ::SetTimer( hwnd, timerID, interval, TimerProc );
return timerID;
}
delete info;
}
-const char* GetKeyName( int keyCode )
+std::string GetKeyName( int keyCode )
{
switch( keyCode )
{
}
default:
{
+ if (keyCode > 0 && keyCode < 128)
+ {
+ return std::string(1u, static_cast<char>(keyCode));
+ }
break;
}
}