Click to See Complete Forum and Search --> : Where should be the code relating to repetetive action be writtern in Win32 SDK


kirantoday
February 24th, 2007, 08:54 AM
i am developing an application in Microsoft Visual Studio 2005 in Win32 Smart Device Project.

In this I want an animated image to be run on the dialog, from the time dialog is displayed till the dialog is end externally by clicking exit from Menu.

Now where will i have to write the respective Code.
When i wrote it in "WM_INITDIALOG", the animation is being displayed but the menu is not displayed.

SO in a Win 32 SDK application for any action that should happen repeatedly
where should it be writtern

i have writtern as follow

WM_INITDIALOG
CheckRadioButton(hwndDlg, IDC_DWM, IDC_TWM, IDC_DWM);
SetMenu(hwndDlg, IDR_MENU_AVSTUDIO, &g_hWndMenuBar);

MyRegisterClass(g_hInst, L"DisplayWnd1", DisplayWndProc1, 2);
g_hDisplayWnd1 = CreateWindow(L"DisplayWnd1", NULL, WS_VISIBLE | WS_CHILD, 20, 10, 400, 800, hwndDlg, NULL, g_hInst, NULL);
ShowWindow(g_hDisplayWnd1, SW_SHOW);
UpdateWindow(g_hDisplayWnd1);
break;

The method DisplayWndProc1 has the animated code.
Can any one please help me

Regards
Kiran

ovidiucucu
February 25th, 2007, 08:57 AM
Create a timer by a SetTimer function call.
Handle WM_TIMER message and call Invalidate.
Handle WM_PAINT and draw each animation's frame.

An easier alternative is to use a Windows common animation control for "playing" AVIs (if supported in Win32 Smart Device...).

[ Redirected thread ]

kirantoday
February 26th, 2007, 07:57 AM
Thank you so much, i got it and was able to do it

Regards
Kiran