Restored from previous forum. Originally posted by teachco.
Parameter 'modal' in openWindow? Is this possible und useful?
Not so important, but nice to have. There exist a solution with Win API.
Edited by - teachco on 26 June 2002 14:22:41
Parameter 'modal' in openWindow
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
> Parameter 'modal' in openWindow? Is this possible und useful?
To do what? Stop all other apps from getting the focus? I don't think it's
possible in a multitasking environment like Windows. But if you want to keep
your app's window on top of all others, just do this after creating it:
And, to stop this behaviour again:
PB - Registered PureBasic Coder
> Parameter 'modal' in openWindow? Is this possible und useful?
To do what? Stop all other apps from getting the focus? I don't think it's
possible in a multitasking environment like Windows. But if you want to keep
your app's window on top of all others, just do this after creating it:
Code: Select all
SetWindowPos_(WindowID(),#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE) ; On top.
Code: Select all
SetWindowPos_(WindowID(),#HWND_NOTOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE) ; Not on top.
PB - Registered PureBasic Coder
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
>To do what? Stop all other apps from getting the focus?
Not other applications, but other Windows in the same
Application.
When you open 3 Windows, the user can switch between this
3 Windows like he wants.
Now you open Window 4 as "modal", and the user cant use
the other 3 Windows anymore until the modal Window is
closed.
I think this worked with the "PopUpWindow" addon Library,
but i´m not sure about this.
cya,
...Danilo
(registered PureBasic user)
>To do what? Stop all other apps from getting the focus?
Not other applications, but other Windows in the same
Application.
When you open 3 Windows, the user can switch between this
3 Windows like he wants.
Now you open Window 4 as "modal", and the user cant use
the other 3 Windows anymore until the modal Window is
closed.
I think this worked with the "PopUpWindow" addon Library,
but i´m not sure about this.
cya,
...Danilo
(registered PureBasic user)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
calling window... it's how vis2pure does it in v0.30 when calling another
window.
PB - Registered PureBasic Coder
Ah, I see. I'd just use EnableWindow_(WindowID(),#FALSE) to disable theWhen you open 3 Windows, the user can switch between this
3 Windows like he wants.
Now you open Window 4 as "modal", and the user cant use
the other 3 Windows anymore until the modal Window is
closed.
calling window... it's how vis2pure does it in v0.30 when calling another
window.
PB - Registered PureBasic Coder
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by teachco.
Thank you for the tip.
You find the complete solution under BEGINNERS "MODAL Window: A solution with Windows API."
But I think it would be useful and easier for the programmer to have a further parameter in the openWindow-statement to generate modal windows. In this case it is necessary to modify the closeWindow-routines to handle the modal functionality correctly (reactivating the calling window). Thank you.
Edited by - teachco on 17 June 2002 11:36:54
EnableWindow_(WindowID(),#FALSE) is working fineAh, I see. I'd just use EnableWindow_(WindowID(),#FALSE) to disable theWhen you open 3 Windows, the user can switch between this
3 Windows like he wants.
Now you open Window 4 as "modal", and the user cant use
the other 3 Windows anymore until the modal Window is
closed.
calling window... it's how vis2pure does it in v0.30 when calling another
window.
PB - Registered PureBasic Coder
Thank you for the tip.
You find the complete solution under BEGINNERS "MODAL Window: A solution with Windows API."
But I think it would be useful and easier for the programmer to have a further parameter in the openWindow-statement to generate modal windows. In this case it is necessary to modify the closeWindow-routines to handle the modal functionality correctly (reactivating the calling window). Thank you.
Edited by - teachco on 17 June 2002 11:36:54