Page 2 of 2

Posted: Sun Feb 10, 2008 12:41 am
by SFSxOI
I've yet to get it to work the first time. I give up on it. Nice idea tho. Thanks

Posted: Sun Feb 10, 2008 12:43 am
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.

Posted: Sun Feb 10, 2008 1:26 am
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. ;)

Posted: Sun Feb 10, 2008 1:39 am
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