Playing a Flash movie from memory (no temporary files)

Share your advanced PureBasic knowledge/code with the community.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

I've yet to get it to work the first time. I give up on it. Nice idea tho. Thanks
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Post by SFSxOI »

bingo wrote:in vista easier with SHCreateMemStream ... 8)

http://msdn2.microsoft.com/en-us/librar ... S.85).aspx
Aside from the lack of flexability in use, the fact that it does not allow direct access to the stream contents, and its not thread safe yeah, SHCreateMemStream is eaisier. On the other hand CreateStreamOnHGlobal doesn't have these limitations.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

SFSxOI wrote:I've yet to get it to work the first time. I give up on it. Nice idea tho. Thanks
Are you still having the problem with the "FreeMemory" line? If so, delete it. The memory seems to free just fine after closing the window. ;)
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

This also works the same. Just make sure the html file has a white background or change the rgb in the code. Like I said, not perfect. ;) (I used a 320x240 flash file or you'll get scroll bars on the webgadget.)

Code: Select all

If OpenWindow(0, 0, 0, 320, 240, "", #PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Invisible)
 SetWindowLong_(WindowID(0),#GWL_EXSTYLE,GetWindowLong_(WindowID(0),#GWL_EXSTYLE)|#WS_EX_LAYERED) 
  SetLayeredWindowAttributes_(WindowID(0),RGB(255,255,255),0,#LWA_COLORKEY)

   CreateGadgetList(WindowID(0))

If WebGadget(0, 0, 0, 340, 260, "file://C:\flash.html") = 0
  MessageRequester("Error", "ATL.dll not found", 0)
 End
EndIf

HideWindow(0,0)

Repeat
  Event = WaitWindowEvent()
    
    If Event = #WM_LBUTTONDOWN
       SendMessage_(WindowID(0) ,#WM_NCLBUTTONDOWN, #HTCAPTION, 0)
    EndIf
    
  Until GetAsyncKeyState_(#VK_ESCAPE)
   
EndIf
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
Post Reply