Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

data dialog

172 views
Skip to first unread message

aurora baccio

unread,
May 24, 2022, 10:10:09 AM5/24/22
to
I have a requirement that a datadialog always be in the foreground.
SetModal(true/false) doesn't work for me
any advice ?
thanks
aurora kiss

D.J.W. van Kooten

unread,
May 24, 2022, 2:36:55 PM5/24/22
to
Replying on message of Tue, 24 May 2022 07:10:08 -0700 (PDT) from
aurora baccio:


Hello aurora baccio,

>I have a requirement that a datadialog always be in the foreground.
>SetModal(true/false) doesn't work for me

You can try:

SetForegroundWindow(SELF:Handle())

We use this in a method called when someone clicks the trayicon we
associated with that window so the window is opened to the foreground.
For more permanent foreground positions you could use an Expose
method.

Dick

Gerhard Bunzel

unread,
Jun 24, 2022, 6:04:44 AM6/24/22
to
Hello aurora baccio,

you can give your windows an order to show one of them always on top:
SetWindowLong(MyWindow:Handle(), GWL_EXSTYLE, _OR(GetWindowLong(MyWindow:Handle(), GWL_EXSTYLE), WS_EX_TOPMOST))

https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles


or with SetWindowPos()
https://docs.microsoft.com/de-DE/windows/win32/api/winuser/nf-winuser-setwindowpos


HTH
Gerhard

aurora baccio

unread,
Jul 12, 2022, 10:06:05 AM7/12/22
to
Good morning,
sounds like the ideal command
but if I type setwindowpos(HWND_TOP) I get an error like the parameters are wrong.
Is it possible to have an example.
It was placed in the postinit method
thanks
aurora baccio

Jamal

unread,
Jul 13, 2022, 12:12:25 PM7/13/22
to
Did you read really the syntax for SetWindowPos() and what parameters
are required?

Franz Rachbauer

unread,
Jul 14, 2022, 8:48:03 AM7/14/22
to
SetWindowPos(SELF:Handle(),HWND_TOPMOST,0,0,0,0,SWP_NOMOVE+SWP_NOSIZE)
should do this
Regards

Alessandro Vacchiano

unread,
Jul 15, 2022, 12:12:27 PM7/15/22
to
Ti rispondo in italiano così è più semplice. Crei una tua classe per esempio:

CLASS MiaDialog INHERIT DataDialog


METHOD Init(oOwner,oSource,nResourceID) CLASS MiaDialog

IF SysObject():SettoModale // qualsiasi altra variabile o metodo per partire la finestra come dialog o window
SELF:SymTipoClasse := #DATADIALOG
ELSE
SELF:SymTipoClasse := #DATAWINDOW
ENDIF
return self

Poi crei il metodo activate:

METHOD Activate(oE) CLASS MiaDialog

IF SELF:SymTipoClasse == #DATADIALOG
SUPER:Activate(oE)
ELSE
SendClass(SELF,#ACTIVATE,#DATAWINDOW,oE)
ENDIF
return nil

In sostanza nelle init devi dirgli in qualche modo che la finestra si deve aprire modale.
Puoi anche gestirti un campo personalizzato da passare come per es:

METHOD Init(oOwner,oSource,nResourceID,Partomodale) CLASS MiaDialog

aurora baccio

unread,
Jul 23, 2022, 9:47:52 AM7/23/22
to
Il giorno giovedì 14 luglio 2022 alle 14:48:03 UTC+2 Franz Rachbauer ha scritto:
Thank you,
I would now like the possibility to disable setwindowpos because theq screen gets stuck and the application does not go on.
aurora baccio
0 new messages