1. Windows RED button
- Posted by George Walters <gwalters at sc.rr.com> Feb 02, 2005
- 390 views
- Last edited Feb 03, 2005
Anyone know how to trap a click on the red kill button?
2. Re: Windows RED button
- Posted by Mario Steele <eumario at trilake.net> Feb 02, 2005
- 419 views
- Last edited Feb 03, 2005
> Anyone know how to trap a click on the red kill button? Okay, the Windows RED button, is actually called the Close Button. Depending on the library you are using, you can trap the Close Event in 2 ways. Win32lib:
procedure onClose_window(integer id, integer event, sequence param) if message_box("Are you sure you want to quit?","Quit",MB_ICONQUESTION+MB_YESNO) = IDNO then returnValue(-1) end if end procedure setHandler(window,w32HClose,routine_id("onClose_window"))
Windows API:
function WndProc(atom hWnd, atom iMsg, atom wParam, atom lParam) if iMsg = WM_CLOSE and hWnd = window then if message_box("Are you sure you want to quit?","Quit",MB_ICONQUESTION+MB_YESNO) = IDNO then return -1 end if end if return c_func(xDefWndProc,{hWnd,iMsg,wParam,lParam}) end function
Hope this helps you out. EuMario
3. Re: Windows RED button
- Posted by George Walters <gwalters at sc.rr.com> Feb 03, 2005
- 392 views
great, thanks Mario... george Mario Steele wrote: > > > posted by: Mario Steele <eumario at trilake.net> > >>Anyone know how to trap a click on the red kill button? > > > Okay, the Windows RED button, is actually called the Close Button. > Depending on the library you are using, you can trap the Close Event in 2 > ways. > > Win32lib: > > }}} <eucode> > procedure onClose_window(integer id, integer event, sequence param) > if message_box("Are you sure you want to > quit?","Quit",MB_ICONQUESTION+MB_YESNO) = IDNO then > returnValue(-1) > end if > end procedure > setHandler(window,w32HClose,routine_id("onClose_window")) > </eucode> {{{ > > Windows API: > > }}} <eucode> > function WndProc(atom hWnd, atom iMsg, atom wParam, atom lParam) > if iMsg = WM_CLOSE and hWnd = window then > if message_box("Are you sure you want to > quit?","Quit",MB_ICONQUESTION+MB_YESNO) = IDNO then > return -1 > end if > end if > return c_func(xDefWndProc,{hWnd,iMsg,wParam,lParam}) > end function > </eucode> {{{ > > Hope this helps you out. > > EuMario > > > >