- //***********************************
- //Source resource.h
- //***********************************
- #define IDC_ANIME 1000
- #define IDD_DIALOGUE 1
-
- //***********************************
- //Source animeDlg.cpp
- //***********************************
- #include <windows.h>
- #include <commctrl.h>// pour le contrôle ANIMATE
- //ainsi que le link avec comctl32.lib
- #include "resource.h"
-
-
- BOOL CALLBACK maDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) ;
-
- int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- InitCommonControls();// pour le contrôle ANIMATE
-
- if (!DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOGUE), 0,(DLGPROC)maDlgProc))
- {MessageBox(0,"raté","dialogue",MB_OK); return 1;}
-
- MSG msg;
-
- while (GetMessage(&msg, NULL, NULL, NULL)) DispatchMessage(&msg);
-
- return msg.wParam;
- }
-
-
- BOOL CALLBACK maDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message)
- {
-
- case WM_INITDIALOG:
- Animate_Open(GetDlgItem(hwndDlg, IDC_ANIME), "clock.AVI");
- Animate_Play(GetDlgItem(hwndDlg, IDC_ANIME),0, -1, -1);
- return true;
- break;
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
- PostQuitMessage(1);
- EndDialog(hwndDlg, 0);
- return true;
- }
- }
- return false;
- }
-
- //***********************************
- //Source dlg.rc
- //***********************************
- #include <windows.h>
- #include "resource.h"
-
- IDD_DIALOGUE DIALOG DISCARDABLE 0, 0, 280, 220
- STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
- CAPTION "une Vidéo"
- FONT 8, "MS Sans Serif"
- BEGIN
- DEFPUSHBUTTON "OK",IDOK,220,20,50,50,WS_GROUP
- CONTROL "Animate",IDC_ANIME,"SysAnimate32",WS_BORDER |
- WS_TABSTOP,0,0,200,250
- END
//***********************************
//Source resource.h
//***********************************
#define IDC_ANIME 1000
#define IDD_DIALOGUE 1
//***********************************
//Source animeDlg.cpp
//***********************************
#include <windows.h>
#include <commctrl.h>// pour le contrôle ANIMATE
//ainsi que le link avec comctl32.lib
#include "resource.h"
BOOL CALLBACK maDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) ;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
InitCommonControls();// pour le contrôle ANIMATE
if (!DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOGUE), 0,(DLGPROC)maDlgProc))
{MessageBox(0,"raté","dialogue",MB_OK); return 1;}
MSG msg;
while (GetMessage(&msg, NULL, NULL, NULL)) DispatchMessage(&msg);
return msg.wParam;
}
BOOL CALLBACK maDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
Animate_Open(GetDlgItem(hwndDlg, IDC_ANIME), "clock.AVI");
Animate_Play(GetDlgItem(hwndDlg, IDC_ANIME),0, -1, -1);
return true;
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
PostQuitMessage(1);
EndDialog(hwndDlg, 0);
return true;
}
}
return false;
}
//***********************************
//Source dlg.rc
//***********************************
#include <windows.h>
#include "resource.h"
IDD_DIALOGUE DIALOG DISCARDABLE 0, 0, 280, 220
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION
CAPTION "une Vidéo"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,220,20,50,50,WS_GROUP
CONTROL "Animate",IDC_ANIME,"SysAnimate32",WS_BORDER |
WS_TABSTOP,0,0,200,250
END