PDA

View Full Version : How to prevent Dialog from closing before confirmation?



Michael Hartlef
03-10-2008, 14:55
Hi folks,

if someone closes a dialog via the red X-Button in the topright corner, I would like to ask the use if he/she wants to and if pressed NO, then don't close the dialog. How do I do this?

Michael

ErosOlmi
03-10-2008, 15:06
Add the following to dialog callback:



CASE %WM_SYSCOMMAND
IF (CBWPARAM AND &HFFF0) = %SC_CLOSE THEN
FUNCTION = %TRUE
END IF


The above prevent closing with [X] button. Just add your code to test user response and return FUNCTION=%TRUE to prevent closing or FUCNTION=%FALSE to let it close.

Ciao
Eros

Michael Hartlef
03-10-2008, 15:09
Thanks man! :)