Jump to content

Embedded PaC man...


Gerome
 Share

Recommended Posts

Hello,

Have you ever dreamed about embedding some COM control to a classical winform in order to be able to play with some flash animations ?

Yes it is possible... just have a look to the code below...

'// ----------------------------------------
'// ATL control
'// Purpose : using a Flash animation
'// Author  : Gerome GUILLEMIN
'// Date    : 05/12/2005
'// ----------------------------------------
Dim %oFlash, %hWnd

If Not STANDALONE Then
    Fbsl2Exe( Command(1) )
    ExitProgram(1)
End If

Sub Form_Load()
   Apicall( "AtlAxWinInit", "ATL" )
   Dim $WinName = "{D27CDB6E-AE6D-11CF-96B8-444553540000}"
   hWnd = FBSL_Control("AtlAxWin", Me, WinName, 0, 0, 15, 620, 460, WS_Child + WS_Visible, WS_Ex_ClientEdge)
   Apicall( "AtlAxGetControl", "ATL", hWnd, @oFlash )
   PutValue( oFlash, ".Movie=%s", "http://www.80smusiclyrics.com/games/pacman/pacman.swf" )
End Sub

Sub RefreshAfxControl()
Dim %Lefti, %Topi, %Righti, %Bottomi
   GetClientRect( Me, Lefti, Topi, Righti, Bottomi )
   ReSize(hWnd, 0, 30, Righti - 15, Bottomi - 60)
   Refresh(hWnd)
End Sub

Sub Main()
   Fbsl_SetText( Me, "PaC-man..." )
   Resize(Me, 0, 0, 640, 480 )
   Center(Me): Show(Me): Form_Load()
   Begin Events
      If CBMsg = WM_CLOSE Then
          ReleaseObject( oFlash ): ExitProgram(0)
      End If
      If CBMSG = WM_SIZE Then RefreshAfxControl()
   End Events
End Sub

Enjoy :P

Yours,(¯`·._.·[Gerome GUILLEMIN] [Freestyle Basic Script Language Author]·._.·´¯):: Full SETUP w. HELP ::FBSL official web siteA keyboard is infinitely better as a programming tool than a toaster...

Link to comment
Share on other sites

Hello,

Have you ever dreamed about embedding some COM control to a classical winform in order to be able to play with some flash animations ?

Yes it is possible... just have a look to the code below...

'// ----------------------------------------
'// ATL control
'// Purpose : using a Flash animation
'// Author  : Gerome GUILLEMIN
'// Date    : 05/12/2005
'// ----------------------------------------
Dim %oFlash, %hWnd

If Not STANDALONE Then
    Fbsl2Exe( Command(1) )
    ExitProgram(1)
End If

Sub Form_Load()
   Apicall( "AtlAxWinInit", "ATL" )
   Dim $WinName = "{D27CDB6E-AE6D-11CF-96B8-444553540000}"
   hWnd = FBSL_Control("AtlAxWin", Me, WinName, 0, 0, 15, 620, 460, WS_Child + WS_Visible, WS_Ex_ClientEdge)
   Apicall( "AtlAxGetControl", "ATL", hWnd, @oFlash )
   PutValue( oFlash, ".Movie=%s", "http://www.80smusiclyrics.com/games/pacman/pacman.swf" )
End Sub

Sub RefreshAfxControl()
Dim %Lefti, %Topi, %Righti, %Bottomi
   GetClientRect( Me, Lefti, Topi, Righti, Bottomi )
   ReSize(hWnd, 0, 30, Righti - 15, Bottomi - 60)
   Refresh(hWnd)
End Sub

Sub Main()
   Fbsl_SetText( Me, "PaC-man..." )
   Resize(Me, 0, 0, 640, 480 )
   Center(Me): Show(Me): Form_Load()
   Begin Events
      If CBMsg = WM_CLOSE Then
          ReleaseObject( oFlash ): ExitProgram(0)
      End If
      If CBMSG = WM_SIZE Then RefreshAfxControl()
   End Events
End Sub

Enjoy :P

Would be even more impressive if this code was in autoit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Would be even more impressive if this code was in autoit

Yeah, if you need help to convert it post it in the support forum.

If you just want to post it this is a AutoIt forum.

But when you still post it (what isnt right) please add to your post that it is not a AutoIt script but a (...) script. :P

Sorry for my English, I'm Dutch... =DMedia UDFINet Adv UDF
Link to comment
Share on other sites

Hi,

Yeah, if you need help to convert it post it in the support forum.

If you just want to post it this is a AutoIt forum.

But when you still post it (what isnt right) please add to your post that it is not a AutoIt script but a (...) script. :P

Yeah, i can uderstand :lmao:

BTW, i really dunno if AutoIt is able to manage ATL and pointers, so i've posted the sample using my own script language, may be someone can help to port it to Autoit if he wants to...

Yours,(¯`·._.·[Gerome GUILLEMIN] [Freestyle Basic Script Language Author]·._.·´¯):: Full SETUP w. HELP ::FBSL official web siteA keyboard is infinitely better as a programming tool than a toaster...

Link to comment
Share on other sites

If you search the forums you maybe found this... :P

#include <GUIConstants.au3>
$oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1")
GUICreate ("PacMan", 820, 600, -1, -1)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580)

With $oRP; Object tag pool
    .bgcolor = "#000000"; change background color to white FFFFFF
    .Movie = 'http://www.80smusiclyrics.com/games/pacman/pacman.swf'; the wave file from inet / could be on disk
    .ScaleMode = 2
    .Loop = True
    .wmode = "Opaque"; Opaque / transparent
;.Stop / .Play
EndWith

GUISetState ();Show GUI

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

$oRP = 0; FREE THE OBJECT
GUIDelete ()
Exit

The idea is from Kjactive

Edited by Mosquitos

Sapiente vince, rex, noli vincere ferro!

Link to comment
Share on other sites

Hello,

If you search the forums you maybe found this... :P

...

The idea is from Kjactive

Thanks :lmao:

I've taken the idea from the RapidQ e-group forum :(

So this sample idea has made a tour around the World :)

Happy to see it in AutoIt :)

Yours,(¯`·._.·[Gerome GUILLEMIN] [Freestyle Basic Script Language Author]·._.·´¯):: Full SETUP w. HELP ::FBSL official web siteA keyboard is infinitely better as a programming tool than a toaster...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...