HelloWorld Salut tout le monde! | Y'a la classe ANIMATE_CLASS en win32 mais bon t'as pas le son ... et c'est vraiment le truc de base.
Apres y'a aussi les truc mmedia.
Tiens, copier coller du code donné en exemple (mmedia.hlp)
Code :
- The following example shows how to use the MCI_OPEN command to set a parent window and create a child of that window.
- MCI_DGV_OPEN_PARMS mciOpen;
- mciOpen.lpstrElementName = lpstrFile; // Set the filename.
- mciOpen.dwStyle = WS_CHILD; // Set the style.
- mciOpen.hWndParent = hWnd; // Give a window handle.
- if (mciSendCommand(0, MCI_OPEN,
- (DWORD)(MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_DGV_OPEN),
- (DWORD)(LPSTR)&mciOpen) == 0)
- {
- // Open operation is successful. Continue.
- }
- The following example finds the dimensions needed to play an AVI file, creates a window corresponding to that size, and plays the file in the window by using the MCIAVI driver.
- HWND hwnd;
- MCI_DGV_RECT_PARMS mciRect;
- // Get the movie dimensions with MCI_WHERE.
- mciSendCommand(wDeviceID, MCI_WHERE, MCI_DGV_WHERE_SOURCE,
- (DWORD)(LPSTR)&mciRect);
- // Create the playback window. Make it bigger for the border.
- // Note that the right and bottom members of RECT structures in MCI
- // are unusual; rc.right is set to the rectangle's width, and
- // rc.bottom is set to the rectangle's height.
- hwndMovie = CreateWindow("mywindow", "Playback",
- WS_CHILD|WS_BORDER, 0,0,
- mciRect.rc.right+(2*GetSystemMetric(SM_CXBORDER)),
- mciRect.rc.bottom+(2*GetSystemMetric(SM_CYBORDER)),
- hwndParent, hInstApp, NULL);
- if (hwndMovie){
- // Window created OK; make it the playback window.
- MCI_DGV_WINDOW_PARMS mciWindow;
- mciWindow.hWnd = hwndMovie;
- mciSendCommand(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_HWND,
- (DWORD)(LPSTR)&mciWindow);
- }
- Before using the mciSendCommand function to send the MCI_PLAY command, your application allocates the memory for the structure, initializes the members it will use, and sets the flags corresponding to the members used in the structure. (If your application does not set a flag for a structure member, MCI drivers ignore the member.) For example, the following example plays a movie from the starting position specified by dwFrom to the ending position specified by dwTo. (If either position is zero, the example is written so that the position is not used.)
- DWORD PlayMovie(WORD wDevID, DWORD dwFrom, DWORD dwTo)
- {
- MCI_DGV_PLAY_PARMS mciPlay; // play parameters
- DWORD dwFlags = 0;
- // Check dwFrom. If it is != 0 then set parameters and flags.
- if (dwFrom){
- mciPlay.dwFrom = dwFrom; // set parameter
- dwFlags |= MCI_FROM; // set flag to validate member
- }
- // Check dwTo. If it is != 0 then set parameters and flags.
- if (dwTo){
- mciPlay.dwTo = dwTo; // set parameter
- dwFlags |= MCI_TO; // set flag to validate member
- }
- // Send the MCI_PLAY command and return the result.
- return mciSendCommand(wDevID, MCI_PLAY, dwFlags,
- (DWORD)(LPVOID)&mciPlay);
- }
|
Ca semble bien plus complet ...
la suite sur www.google.com ---------------
FAQ fclc++ - FAQ C++ - C++ FAQ Lite
|