Click here to Skip to main content
12,998,875 members (67,901 online)
Rate this:
Please Sign up or sign in to vote.
See more:
static LRESULT CALLBACK ComboBox_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
case WM_CHAR:
    if(VK_BACK ==wParam)//让回退正常处理
        return CallWindowProc((WNDPROC)GetProp(hwnd, TEXT("Wprc")), hwnd, msg, wParam, lParam);

when I purely pressed VK_BACK the if clause will work; wParam is 0x00000008.
But When I pressed VK_BACK with Ctrl-pressed,wParam is 0x0000007f.
I just don't understand it, why the wParam get so? Is some rule here?

In the mean time,If I sometimes need to deal with different Key_Down ,and may with some some Ctrl_Key pressed,Ctrl or Alt or Shift,How Can I deal with it ?


In above sample.GetKeyState() is not applicable!
Becuse the wParam's value changed!
Posted 17-Dec-12 22:09pm
Jochen Arndt 18-Dec-12 5:29am
Voted this question with a 5 which I'm doing very seldom. The returned WM_CHAR key value for Ctrl+BS is indeed 0x7F. A Google research found only one useful hit (see my answer).
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

// Is some rule here?

I think, the coded char "want" to be unique in this case :)

(Maybe, the WM_KEYDOWN will be more effective for you)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The code 0x7F is the ASCII DEL character. Maybe someone at MS decided to return this code upon Ctrl+BackSpace because it is not returned by any other key.

See also this Blog post: What's broken in the WM_KEYDOWN/WM_CHAR input model?[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 18 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100