The new flag does not let me create a child window but only set an owner base window.
How can i create a childwindow with PB syntax only?
(WS_CHILD/DS_CONTROL/WS_EX_CONTROLPARENT)
How to create a child window with PB syntax?
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Re: How to create a child window with PB syntax?
Try this:Edwin Knoppert wrote:The new flag does not let me create a child window but only set an owner base window.
How can i create a childwindow with PB syntax only?
(WS_CHILD/DS_CONTROL/WS_EX_CONTROLPARENT)
Code: Select all
OpenWindow( 1,0,0,640,480,#PB_Window_SystemMenu," PureBasic" )
Child = OpenWindow( 2,0,0,320,240,#PB_Window_SystemMenu | #PB_Window_WindowCentered |#WS_CHILD | #DS_CONTROL," CLIENT: NO BUTTON IN TASKBAR ",WindowID(1) )
CreateGadgetList(WindowID(2))
ButtonGadget(1,10,10,100,25,"Test")
Repeat
Event.l = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
MessageRequester("Event","Gadget #: " + Str(EventGadgetID()),0)
Case #PB_Event_CloseWindow
If EventWindowID() > 1 : CloseWindow(EventWindowID()) : EndIf
EndSelect
Until Event = #PB_Event_CloseWindow And EventWindowID() = 1
End
But the Gadgets on it work (as you can see)
8O
I am to provide the public with beneficial shocks.
Alfred Hitshock
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
-
VPureBasic
- User

- Posts: 59
- Joined: Fri Apr 25, 2003 6:09 pm
- Location: Quebec - Canada
Hi Edwin,
Did you already try the library I wrote about it? WindowEx...
You can find this library in Paul's Resources site.
Roger
Did you already try the library I wrote about it? WindowEx...
Code: Select all
; ------------------------------------
;
; WindowEx Library Test
; Written by Roger Beausoleil
; Forum Nick VPureBasic
; visionfx@satelcom.qc.ca
;
; ------------------------------------
; CHANGE AND READ WINDOW STYLES | EXSTYLES
#MouseLeftClick = 513
OpenWindow( 0,0,0,640,480,#PB_Window_SystemMenu," VisionFX" )
CreateGadgetList( WindowID(0) )
OpenWindow( 1,100,100,100,100,#PB_Window_Invisible,"" )
SetWindowStyles( 1,#WS_DLGFRAME|#WS_CLIPSIBLINGS|#WS_CLIPCHILDREN|#WS_VISIBLE|#WS_CHILD, 0 )
SetWindowParent( 1,0 )
TextGadget ( 0,10,10,200,20,"Here's your new window info:" )
StringGadget( 1,10,30,200,20,Str( WindowStyles ( 1 ) ) )
StringGadget( 2,10,50,200,20,Str( WindowExStyles( 1 ) ) )
Repeat
Until WaitWindowEvent() = #MouseLeftClick
End
Roger
Everything is possible with PureBASIC... All you're missing is imagination!
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
Thanks,
I'm well aware of windows api tricks but i don't know the inside of the PB windows, therefore my asking.
Still wonders me how it is possible that PB let us allow to use winapi styles with his own.
To me that's very unclear and would like to see more info regarding this.
Maybe PB can spread his original window code how it uses their windows and controls.
Then we can adapt.
At the end it's the compiler what makes it important.
I'm well aware of windows api tricks but i don't know the inside of the PB windows, therefore my asking.
Still wonders me how it is possible that PB let us allow to use winapi styles with his own.
To me that's very unclear and would like to see more info regarding this.
Maybe PB can spread his original window code how it uses their windows and controls.
Then we can adapt.
At the end it's the compiler what makes it important.
-
Num3
- PureBasic Expert

- Posts: 2812
- Joined: Fri Apr 25, 2003 4:51 pm
- Location: Portugal, Lisbon
- Contact:
Fred has included over 600 api calls into purebasic, so many are present just by typing the variable. Other like for instance Flat Button flag can be easly imported.Edwin Knoppert wrote:Thanks,
Still wonders me how it is possible that PB let us allow to use winapi styles with his own.
To me that's very unclear and would like to see more info regarding this.
-
Edwin Knoppert
- Addict

- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact: