win32 - the accelator key

we have controls(like buttons) and we can use the prefix '&'. how can i activate the accelerator key?
Windows will do that automatically. Just hold the Alt key and press whatever the underlined key is.
but when i change the window text with '&', the click seems not working :(
see these code:
1
2
3
4
5
6
7
8
9
10
11
12
case WM_CREATE:

            //RegisterHotKey( hwnd, Hotkey_Message, MOD_CONTROL, 'A' | VK_UP );
            //create the button
            hButton=CreateWindowEx (WS_EX_TRANSPARENT,"button", "H&ello my mother",
            WS_CHILD | WS_VISIBLE |  BS_TEXT | BS_NOTIFY,
            100, 100,100, 50,hwnd,NULL,hInstance, 0) ;

            return 0;
case WM_COMMAND:
            SetWindowText(hButton,"hi");
            return 0;

when i click on button, the text is changed. but when i do Alt+e, the click isn't activated :(
Hrm... does the parent window have focus when you press Alt+e?
yes
Topic archived. No new replies allowed.