User only able on one window
User only able on one window
Hi all. How is it possible to let a specified window always (until the programmer decide when) be open? Just like a OpenFileRequester. When you hit outside the OpenFileRequester window the action doesn't take place. How can I do that on my window? Is it only on windows or is this also possible on Mac + Linux? Thank you very much.
- Kaeru Gaman
- Addict

- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: User only able on one window
this is called modal.
the app does only accept input in the modal requester.
there are codes around the forums...
in short:
- open your modal Window
- Disable your main window
- perform your input
- enable your main window again
- close your modal window
this is app-modal. other apps accept input, but the one app only accepts input in the modal window.
... there is also system-modal, no input at all except in the modal window is accepted.
it's a bit more complicated, but there maybe code around for this, too.
the app does only accept input in the modal requester.
there are codes around the forums...
in short:
- open your modal Window
- Disable your main window
- perform your input
- enable your main window again
- close your modal window
this is app-modal. other apps accept input, but the one app only accepts input in the modal window.
... there is also system-modal, no input at all except in the modal window is accepted.
it's a bit more complicated, but there maybe code around for this, too.
oh... and have a nice day.
Re: User only able on one window
Example:
Code: Select all
Procedure OpenDialog()
OpenWindow(1, 0, 0, 320, 240, "Dialog", #PB_Window_SystemMenu|#PB_Window_WindowCentered, WindowID(0)); <-important ParentID
DisableWindow(0, #True); <- disable main after creation of modal window!
ButtonGadget(1, 100, 180, 100, 30, "close")
EndProcedure
OpenWindow(0, #PB_Ignore, #PB_Ignore, 640, 480, "main", #PB_Window_SystemMenu)
ButtonGadget(0, 270, 420, 100, 30, "Open Dialog")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Select EventWindow()
Case 0
Break
Default
DisableWindow(0, #False); <- enable main window before destroy dialogwindow
CloseWindow(EventWindow())
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case 0
OpenDialog()
Case 1
DisableWindow(0, #False); <- enable main window before destroy dialogwindow
CloseWindow(1)
EndSelect
EndSelect
ForEver Re: User only able on one window
Oh ok I see. But I wanted the System Modal. I searched for the System Modal in MSDN. I found SetSysModalwindow, but this is not a function (API), but there is a way to use it, but I dont know how.
Re: User only able on one window
SetSysModalwindow is a api for win3.11
This api does nothing on your system and is useless
This api does nothing on your system and is useless
Re: User only able on one window
Oh ok. But so how can you make your Window a System-modal? Can't find nothing on MSDN or forum (that works)?

