1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
hEdit=CreateWindowEx(0,_T("Edit"),_T(""),editBox,80, yv,43,20,
vScrollContent,(HMENU)IDE_LA,hIns,0);
fnEditWndProcNum=(WNDPROC)SetWindowLong(hEdit, GWL_WNDPROC,(long)fnEditSubClassNum);
/*******/
long fnEditSubClassNum_OnChar(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
//chkScrollPos(hwnd);//If something is entered, the box should be in view, valid or not.
switch(wParam){
case 8: //[Backspace]
case 48: //0
case 49: //1
case 50: //2
case 51: //3
case 52: //4
case 53: //5
case 54: //6
case 55: //7
case 56: //8
case 57: //9
MessageBox(0,0,0,0);
CallWindowProc(fnEditWndProcNum,hwnd,msg,wParam,lParam);
break;
default: //Discard the key
MessageBeep(0xFFFFFFFF); //Default sound to tell user they did something wrong.
return 0;
}
return 0;
}
|