Re: [AD] winXP ALT+key beep problem.

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


the URL

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardaccelerators/keyboardacceleratorreference/keyboardacceleratormessages/wm_menuchar.asp

documents the WM_MENUCHAR allegro is sent when the user presses the ALT+key.

from the MSDN doc, it says if we return MNC_CLOSE in the hi word and the key in the lower word, it will not issue the beep.

i added this to the /allegro4.1.18/src/win/wwnd.c
func  directx_wnd_proc()
case WM_MENUCHAR :
	return (MNC_CLOSE<<16)|(wparam&0xffff);

which prevents the beep.


aj.



AJ wrote:
i offer a solution in:
http://www.allegro.cc/forums/view_thread.php?_id=465241&#target

before i make a patch, can anyone comment on the need for the WS_SYSMENU
flag in the CreateWindowEx() call.



Well, MSDN says the following:

WS_SYSMENU - Creates a window that has a Close (X) button in the non-client
area.

So I guess that we need it if we want the close button. Can you confirm
that this is the case?


that is true.
if you remove WS_SYSMENU from the CreateWindowEx() you do not get the close button (and no minimize either).

lets put it back in.

i also found out that you can return a value in the win_msg_proc that will prevent the beep. its in the MSDN docs for the WM_? msg that is sent when the user presses ALT+key.

(haven't time right now to check, got to go to work..)

aj.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/