PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Custom Toast Display
[WD20] Custom Toast Display
Iniciado por guest, 15,jun. 2016 17:37 - 4 respuestas
Publicado el 15,junio 2016 - 17:37
I created my own window and procedure for a cleaner looking Toast. It works great, but in a couple places I need my window to behave more like the system ToastDisplay in that I need it to not steal the focus from the calling window.

Right now I use OpenChild(WIN_MyToast,sMessage,nColor,nDisplayLength,hPos,vPos). I have tried all of the Open functions with no success. Every time I open my Toast window it steals the focus from the calling window which is still trying to read and parse input data.

Is there a way to open a window that does not get the focus?
Publicado el 15,junio 2016 - 17:51
Hi Curtis,

I haven't tested, but did you try to:

1. Just after the openchild, do a setstatus of your current window?

2. Do your openChild from within an invisible window started first? I'm using this technique for complex UI: all windows opening and closing are done from the first and invisible window, and it knows to do it from a message (postmessage) sent to it by whoever needs it...

Best regards
Publicado el 15,junio 2016 - 19:34
1. This won't work for me. What I am doing is scanning a driver's license barcode and filling a form with the parsed information. So I want to scan and start reading in data and then show the Toast without taking focus off of the control that is reading in the data.

2. Still need to try this way.
Publicado el 15,junio 2016 - 23:07
Hi Curtis,

I think that a simple returntocapture after your openchild should do the trick...

at least, with the information you gave me, I don't see why it wouldn't

Best regards
Publicado el 16,junio 2016 - 17:26
My problem is that I have the user focus on an edit control, then scan the barcode. It begins reading in all the data separated by "|". Once it begins reading in the data I can't open my custom Toast window because it steals the focus and the edit control does not get all of the data from the license.

It looks like I've got it working with a variation of your second idea. When the edit field gains focus I open my custom Toast window, but I make it invisible. Then once the scan begins I make it visible. This way the focus stays on the edit control and all the data is parsed correctly.

Thanks!