Hi there,
I used CWnd::CreateEx() to create a window and later on I want to setup a timer to this window. Since CWnd::CreateEx() returns a BOOL value while SetTimer() needs the window handle to setup a timer.
I then think of GetSafeWnd() to have a window handle of the created window in order to use it in SetTimer(). But it seems doesn't work.
How can I obtain the window handle? The code I wrote simplified here:
UINT Result=CWnd:CreateEx(...);
HWND hwnd=GetSafeWnd();
SetTimer(hwnd,1000,(call back function));
I used CWnd::CreateEx() to create a window and later on I want to setup a timer to this window. Since CWnd::CreateEx() returns a BOOL value while SetTimer() needs the window handle to setup a timer.
I then think of GetSafeWnd() to have a window handle of the created window in order to use it in SetTimer(). But it seems doesn't work.
How can I obtain the window handle? The code I wrote simplified here:
UINT Result=CWnd:CreateEx(...);
HWND hwnd=GetSafeWnd();
SetTimer(hwnd,1000,(call back function));