Child windows

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

I was wondering if PureBasic supports making child windows. (ie. messagebox) I am tring to make an input requester but the examples I found are there own window. I need this so that my latest project.

Thanks

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by merendo.

Hmm... As far as I can remember there is an APi-command to set a window to another windows child. It's something like SetParentWindow_() or so, can't remember exactly. But as I know the command has a little bug...

Cu @ll, merendo
--
I've been hiding - What am I hiding from???
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Is there a way that you can use PB openwindow command to set the parent/child window?
If not is there any more details on how I could set the parent. I am not good at the API stuff yet.

Thanks

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hello Pusztry,

The API guide says :

Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

This means you will do the following in PureBasic (assuming Window1, Window2 are your window numbers ...) :

hWnd1 = OpenWindow(Window1, x1, y1, x2, y2, yourflags, yourtitle)

hWnd2 = OpenWindow(Window2, x1, y1, x2, y2, yourflags, yourtitle)

Result = SetParent_(hWnd2, hWnd1)

...

If Result is non zero the function succeeded, otherwise it failed.

Does this answer to you ?

Rgrds


Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Yes FWeil
thanks so much

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
Post Reply