1. Windows RED button

Anyone know how to trap a click on the red kill button?

new topic     » topic index » view message » categorize

2. Re: Windows RED button

> 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

new topic     » goto parent     » topic index » view message » categorize

3. Re: Windows RED button

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
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu