Posted: Fri Apr 29, 2005 5:15 pm
Just curious but why do you say to forget the whole thing? I mean I think it is intresting that you can embed another application in yours.Edwin Knoppert wrote:forget the whole thing
http://www.purebasic.com
https://www.purebasic.fr/english/
Just curious but why do you say to forget the whole thing? I mean I think it is intresting that you can embed another application in yours.Edwin Knoppert wrote:forget the whole thing
yes your rightTruth_Seeker wrote:Just curious but why do you say to forget the whole thing? I mean I think it is intresting that you can embed another application in yours.Edwin Knoppert wrote:forget the whole thing
it depends of the aplication you want to use i think....Truth_Seeker wrote:By the way is it legal to sell an application that embeds another?
Code: Select all
RunProgram("c:\Program Files\Windows Media Player\wmplayer.exe")
hWndApp=FindWindow_("WMPlayerApp" , #Null)
While hWndApp=0
Delay(100)
hWndApp=FindWindow_("WMPlayerApp" , #Null)
Wend
hwndMain=OpenWindow(1,0,0,640,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"Containt Notepad")
If hwndMain=0
End
EndIf
CreateGadgetList(hwndMain)
hContainer=ContainerGadget(1,3,3,636,470,#PB_Container_BorderLess)
; --> Add #WS_CLIPCHILDREN to the ContainerGadget
SetWindowLong_(hContainer, #GWL_STYLE, GetWindowLong_(hContainer, #GWL_STYLE) | #WS_CLIPCHILDREN)
; --> Add #WS_CHILD to the APP
SetWindowLong_(hWndApp, #GWL_STYLE, GetWindowLong_(hWndApp, #GWL_STYLE) | #WS_CHILD ! #WS_POPUP)
; --> Set the ContainerGadget as the parent
; --> Remove WS_POPUP style, Now App's menu available,and works better!
SetParent_(hWndApp,hContainer)
; --> Position Notepad
;SetWindowPos_(hWndApp, 0, 20, 20, 500, 400, 0)
ShowWindow_(hWndApp,#SW_SHOWMAXIMIZED)
Repeat
event=WindowEvent()
Delay(10)
Until event=#PB_Event_CloseWindow
SendMessage_(hWndApp, #WM_CLOSE, #Null, #Null)
End
It work but i was talking in mdi....Truth_Seeker wrote:This code:
Works for me as long as I do not minimize and restore the window. Movie shows just like normal even if you move the window around. Maybe I am not understanding or something...Code: Select all
RunProgram("c:\Program Files\Windows Media Player\wmplayer.exe") hWndApp=FindWindow_("WMPlayerApp" , #Null) While hWndApp=0 Delay(100) hWndApp=FindWindow_("WMPlayerApp" , #Null) Wend hwndMain=OpenWindow(1,0,0,640,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"Containt Notepad") If hwndMain=0 End EndIf CreateGadgetList(hwndMain) hContainer=ContainerGadget(1,3,3,636,470,#PB_Container_BorderLess) ; --> Add #WS_CLIPCHILDREN to the ContainerGadget SetWindowLong_(hContainer, #GWL_STYLE, GetWindowLong_(hContainer, #GWL_STYLE) | #WS_CLIPCHILDREN) ; --> Add #WS_CHILD to the APP SetWindowLong_(hWndApp, #GWL_STYLE, GetWindowLong_(hWndApp, #GWL_STYLE) | #WS_CHILD ! #WS_POPUP) ; --> Set the ContainerGadget as the parent ; --> Remove WS_POPUP style, Now App's menu available,and works better! SetParent_(hWndApp,hContainer) ; --> Position Notepad ;SetWindowPos_(hWndApp, 0, 20, 20, 500, 400, 0) ShowWindow_(hWndApp,#SW_SHOWMAXIMIZED) Repeat event=WindowEvent() Delay(10) Until event=#PB_Event_CloseWindow SendMessage_(hWndApp, #WM_CLOSE, #Null, #Null) End
ok no problemTruth_Seeker wrote:@Porfirio: sorry I was trying to see what Edwin was talking about.
ok .....Truth_Seeker wrote:I do get a refresh problem and other problems when trying it inside a MDI, it probably could be fixed if you knew how to repaint the child window and the embed application. But I dont know enough winapi.
There is some way to see only the video? (Without menu, without list of reproduction. ..)Truth_Seeker wrote:This code:
Works for me as long as I do not minimize and restore the window. Movie shows just like normal even if you move the window around. Maybe I am not understanding or something...Code: Select all
RunProgram("c:\Program Files\Windows Media Player\wmplayer.exe") hWndApp=FindWindow_("WMPlayerApp" , #Null) While hWndApp=0 Delay(100) hWndApp=FindWindow_("WMPlayerApp" , #Null) Wend hwndMain=OpenWindow(1,0,0,640,480,#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_MaximizeGadget,"Containt Notepad") If hwndMain=0 End EndIf CreateGadgetList(hwndMain) hContainer=ContainerGadget(1,3,3,636,470,#PB_Container_BorderLess) ; --> Add #WS_CLIPCHILDREN to the ContainerGadget SetWindowLong_(hContainer, #GWL_STYLE, GetWindowLong_(hContainer, #GWL_STYLE) | #WS_CLIPCHILDREN) ; --> Add #WS_CHILD to the APP SetWindowLong_(hWndApp, #GWL_STYLE, GetWindowLong_(hWndApp, #GWL_STYLE) | #WS_CHILD ! #WS_POPUP) ; --> Set the ContainerGadget as the parent ; --> Remove WS_POPUP style, Now App's menu available,and works better! SetParent_(hWndApp,hContainer) ; --> Position Notepad ;SetWindowPos_(hWndApp, 0, 20, 20, 500, 400, 0) ShowWindow_(hWndApp,#SW_SHOWMAXIMIZED) Repeat event=WindowEvent() Delay(10) Until event=#PB_Event_CloseWindow SendMessage_(hWndApp, #WM_CLOSE, #Null, #Null) End