In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

TForm:Show() - how to stay focused...?

Xailer professional forum in English
Cerrado
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

TForm:Show() - how to stay focused...?

Mensaje por Hurricane »

Hi,

In a message-only form(not modal), how to keep focus? prevent clicks on other controls (menus in other windows...). Can something inside the FormShowModal function help me?
I have messageRun( bAction, cMsg ) which works perfectly. Naturally it doesn't use :show() and I have to use {||SomeProcess()}.

Código: Seleccionar todo

METHOD BtnProcessoClick( oSender ) CLASS TFrmEstoque
  // self / this form is modal.
   messageStart( 'Atualização de estoque' ) // this form is not modal
   Sleep(3*1000)
   Process('lendo...') // ProcessMessages()
   Sleep(3*1000)
   Process('lendo 2...')
   Sleep(3*1000)
   messageEnd()
   return nil

function messageStart( cMsg )
   ...
   // osDlg:OnDeactivate :={|o| o:setFocus()}   // SetForegroundWindow // it doesn't help
   // osDlg:OnChangeFocus:={|o| o:setFocus()}  // it doesn't help  
   osDlg:show()
   return nil
regards,
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: TForm:Show() - how to stay focused...?

Mensaje por ignacio »

Plus simple:

Código: Seleccionar todo

SetWindowPos( oForm:Handle, HWND_TOPMOST,,,,, nOr( SWP_NOMOVE, SWP_NOSIZE, SWP_NOSENDCHANGING ) )
Regards

Note: Is not exactly what you required, but I guess is what you need. In case not, simply forget it.
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: TForm:Show() - how to stay focused...?

Mensaje por Hurricane »

Hi,
Did not work :cry:
but we tried, thank you very much
Cerrado