Just starting out? Need help? Post your questions and find answers here.
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Tue Jan 11, 2005 4:40 pm
how do i embedded a window in other window?
i want to make a litle aplication and i want to make a main window and multy subwindows inside the main window like in many programs i know
if it is possibele please reply and help!!!
Last edited by
porfirio on Thu Apr 28, 2005 1:55 pm, edited 1 time in total.
Forgive-me for my english, i'm portuguese!
Pupil
Enthusiast
Posts: 715 Joined: Fri Apr 25, 2003 3:56 pm
Post
by Pupil » Tue Jan 11, 2005 7:45 pm
You should read up on the MDIGadget()..
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Thu Jan 13, 2005 4:06 pm
Pupil wrote: You should read up on the MDIGadget()..
ok thanks
Forgive-me for my english, i'm portuguese!
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Thu Apr 28, 2005 1:54 pm
OK i get it
but now i want to know if is there a way to get the handle of the window when you run it like
and then embedded it to my window or other things
i have seen some program in internet that with a path to a exe in parameters he run it and send it to systray
i want to do something like that please help me
Forgive-me for my english, i'm portuguese!
goomoo
User
Posts: 42 Joined: Sun Dec 05, 2004 9:25 am
Location: China
Contact:
Post
by goomoo » Fri Apr 29, 2005 6:40 am
Code: Select all
RunProgram("notepad.exe")
hWndNotepad=FindWindow_("Notepad",#Null)
While hWndNotepad=0
Delay(100)
hWndNotepad=FindWindow_("Notepad",#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_Single)
; --> Add #WS_CLIPCHILDREN to the ContainerGadget
SetWindowLong_(hContainer, #GWL_STYLE, GetWindowLong_(hContainer, #GWL_STYLE) | #WS_CLIPCHILDREN)
; --> Add #WS_CHILD to Notepad
SetWindowLong_(hWndNotepad, #GWL_STYLE, GetWindowLong_(hWndNotepad, #GWL_STYLE) | #WS_CHILD ! #WS_POPUP)
; --> Set the ContainerGadget as the parent
; --> Remove WS_POPUP style, Now Notepad's menu available,and works better!
SetParent_(hWndNotepad,hContainer)
; --> Position Notepad
;SetWindowPos_(hWndNotepad, 0, 20, 20, 500, 400, 0)
Repeat
event=WaitWindowEvent()
Until event=#PB_Event_CloseWindow
Hello, Everyone.
Thanks for your help.
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Fri Apr 29, 2005 9:24 am
goomoo wrote: Code: Select all
RunProgram("notepad.exe")
hWndNotepad=FindWindow_("Notepad",#Null)
While hWndNotepad=0
Delay(100)
hWndNotepad=FindWindow_("Notepad",#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_Single)
; --> Add #WS_CLIPCHILDREN to the ContainerGadget
SetWindowLong_(hContainer, #GWL_STYLE, GetWindowLong_(hContainer, #GWL_STYLE) | #WS_CLIPCHILDREN)
; --> Add #WS_CHILD to Notepad
SetWindowLong_(hWndNotepad, #GWL_STYLE, GetWindowLong_(hWndNotepad, #GWL_STYLE) | #WS_CHILD ! #WS_POPUP)
; --> Set the ContainerGadget as the parent
; --> Remove WS_POPUP style, Now Notepad's menu available,and works better!
SetParent_(hWndNotepad,hContainer)
; --> Position Notepad
;SetWindowPos_(hWndNotepad, 0, 20, 20, 500, 400, 0)
Repeat
event=WaitWindowEvent()
Until event=#PB_Event_CloseWindow
Thank's man that work good!
But i dont want only notepad i want to be able to get other's programs, even pb programs
Forgive-me for my english, i'm portuguese!
goomoo
User
Posts: 42 Joined: Sun Dec 05, 2004 9:25 am
Location: China
Contact:
Post
by goomoo » Fri Apr 29, 2005 11:46 am
you can get other app's window handle by it's caption string.
Hello, Everyone.
Thanks for your help.
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Fri Apr 29, 2005 12:27 pm
goomoo wrote: you can get other app's window handle by it's caption string.
yeah i know that ....
but if i dont know the caption it will never work
Forgive-me for my english, i'm portuguese!
ColBoy
Enthusiast
Posts: 143 Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:
Post
by ColBoy » Fri Apr 29, 2005 1:05 pm
Is it possible to get this to work with DOS apps. It would be great to be able to do this, to implement a method of ensuring the single instance of an app, where I no longer have the source.
I tried doing it, but I just get the DOS app launch in it's own window as normal.
Colin
Colin
ColBoy
Enthusiast
Posts: 143 Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:
Post
by ColBoy » Fri Apr 29, 2005 2:17 pm
I know somthing like this can be done, as I've done it using MultiMediaBuilder.
Colin
Colin
GedB
Addict
Posts: 1313 Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:
Post
by GedB » Fri Apr 29, 2005 2:30 pm
Colin,
MMB and PB are very different tools. They do things differently, with different results.
MMB uses Activex for embedding applications.
PB can do embedding, but it has to be done low level, like in this flash example:
viewtopic.php?t=11465&highlight=swf
If you really need to do this easily, then stick with MMB.
ColBoy
Enthusiast
Posts: 143 Joined: Fri Feb 13, 2004 2:37 pm
Location: Ottawa, Canada
Contact:
Post
by ColBoy » Fri Apr 29, 2005 2:32 pm
OK, that's fine. I'm just the eternal tinkerer, I always like to find new ways to do stuff as it helps to further my understanding.
Colin
porfirio
Enthusiast
Posts: 111 Joined: Mon Nov 15, 2004 11:00 pm
Location: portugal
Post
by porfirio » Fri Apr 29, 2005 4:32 pm
Ok thank's you all
I am not talked only in Embebded it in window i am talking in get his handle for do somethings with it like hide the taskbar icon or some other things
please try this code
Code: Select all
win.l=runprogram('notepad.exe')
show_message("",str(win))
( i write the code here so mabe there is some spell errors )
and i get "404" always that and if i run mspaint it give me other thing
that's why i have that idea that it can be done
oh well.....
i am so n0000b
Forgive-me for my english, i'm portuguese!
Pupil
Enthusiast
Posts: 715 Joined: Fri Apr 25, 2003 3:56 pm
Post
by Pupil » Fri Apr 29, 2005 4:56 pm