Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Play Avi during wait process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PBWin Play Avi during wait process

    A simple test of using the SysAnimate32 control to play Avi file during a wait process. Code, compiled exe and 2 example avi files in attached file. Unzip/unpack it all to same folder.
    Eventual discussion at https://forum.powerbasic.com/forum/u...ess-discussion

    Click image for larger version  Name:	AviTest.jpg Views:	0 Size:	2.6 KB ID:	789864
    Code:
    #COMPILE EXE  'AviTest.bas
    #DIM ALL
    '--------------------------------------------------------------------
    #INCLUDE "WIN32API.INC"
    #INCLUDE "COMMCTRL.INC"
    '--------------------------------------------------------------------
    %IDC_ANIMATE16  = 230
    %IDC_ANIMATE32  = 231
    
    '====================================================================
    FUNCTION PBMAIN () AS LONG
      LOCAL hDlg AS DWORD
    
      DIALOG NEW PIXELS, 0, "Avi test",,, 140, 50, %WS_CAPTION OR %WS_SYSMENU, 0 TO hDlg
      '------------------------------------------------------------------
      InitCommonControls
      CONTROL ADD "SysAnimate32", hDlg, %IDC_ANIMATE16, "", 5, 5, 18, 18, _
                %WS_CHILD OR %WS_VISIBLE OR %ACS_TRANSPARENT OR %ACS_CENTER OR %ACS_AUTOPLAY
      CONTROL ADD "SysAnimate32", hDlg, %IDC_ANIMATE32, "", 28, 5, 32, 32, _
                %WS_CHILD OR %WS_VISIBLE OR %ACS_TRANSPARENT OR %ACS_CENTER OR %ACS_AUTOPLAY
      ' %ACS_AUTOPLAY - avi files starts playing when Animate_Open is called
      '-------------------------------------------------------------------
      DIALOG SHOW MODAL hDlg, CALL DlgProc
    
    END FUNCTION
    
    '======================================================================
    CALLBACK FUNCTION DlgProc() AS LONG
    
      SELECT CASE CB.MSG
      CASE %WM_INITDIALOG
          STATIC hAnim16, hAnim32 AS DWORD
          CONTROL HANDLE CB.HNDL, %IDC_ANIMATE16 TO hAnim16
          CONTROL HANDLE CB.HNDL, %IDC_ANIMATE32 TO hAnim32
          Animate_Open(hAnim16, "Circle16.avi") ' if file is in same folder
          Animate_Open(hAnim32, "HourGlass32.avi")
          ' see also Animate_Play and Animate_Stop to control action
          ' SysAnimate32 can be shown/hidden with CONTROL SHOW STATE..
          ' Avi file can also be embedded as resource, but don't know
          ' how to do that with PB #RESOURCE statements.
    
      CASE %WM_DESTROY
          Animate_Close(hAnim16)
          Animate_Close(hAnim32)
      END SELECT
    
    END FUNCTION
    Attached Files

  • #2
    Where can one find or male avi files

    Comment


    • #3
      From top of page in yellow/orange and bold.
      This forum is for finished source code that is working properly.
      If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
      Dale

      Comment

      Working...
      X