Handle WM_SYSCOMMAND -- don't beep on alpha keys

release
Doug Coleman 2007-12-09 17:45:49 -06:00
parent 85be4fbf3e
commit 7b10e2941f
1 changed files with 5 additions and 1 deletions

View File

@ -210,6 +210,9 @@ SYMBOL: hWnd
hWnd get window-focus send-gesture
drop ;
: handle-wm-syscommand ( hWnd uMsg wParam lParam -- n )
dup alpha? [ 3drop drop 0 ] [ DefWindowProc ] if ;
: cleanup-window ( handle -- )
dup win-title [ free ] when*
dup win-hRC wglDeleteContext win32-error=0/f
@ -305,7 +308,7 @@ M: windows-ui-backend (close-window)
: ui-wndproc ( -- object )
"uint" { "void*" "uint" "long" "long" } "stdcall" [
[
pick
pick ! global [ dup windows-message-name . ] bind
{
{ [ dup WM_CLOSE = ] [ drop handle-wm-close 0 ] }
{ [ dup WM_PAINT = ]
@ -320,6 +323,7 @@ M: windows-ui-backend (close-window)
{ [ dup WM_KEYUP = over WM_SYSKEYUP = or ]
[ drop 4dup handle-wm-keyup DefWindowProc ] }
{ [ dup WM_SYSCOMMAND = ] [ drop handle-wm-syscommand ] }
{ [ dup WM_SETFOCUS = ] [ drop handle-wm-set-focus 0 ] }
{ [ dup WM_KILLFOCUS = ] [ drop handle-wm-kill-focus 0 ] }