Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
solve the conflict between double keys
#13
In the code below,  How to add two events to the Enter key, for example:
1. Enter directly in the edit box, the first item in the list will be executed.
2. If there is already an item selected in the list, press Enter in the edit box to execute the selected item.

In addition, the following code, there is a problem, the Enter key can not be used in the window after execution
Huh

 
Code:
Copy      Help
#sub EditSubclassProc
function# hWnd message wParam lParam
int cid=GetDlgCtrlID(hWnd)
int Phwnd= GetParent(hWnd)
;OutWinMsg message wParam lParam
sel message
,case WM_DESTROY
,case WM_GETDLGCODE
,sel(wParam) case [VK_RETURN] ret DLGC_WANTALLKEYS
,case [WM_KEYDOWN,WM_KEYUP]
,sel wParam ;;virtual key code
,,case VK_RETURN
,,;on enter in the edit box select the item in the list box
,,sel cid
,,,case 3
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(4 Phwnd)) id(4 Phwnd)
,,,case 7
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(10 Phwnd)) id(10 Phwnd)
,,,case 8
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(11 Phwnd)) id(11 Phwnd)
,,ret
,,case [VK_DOWN,VK_UP,VK_PRIOR,VK_NEXT]
,,;relay these keys to the listbox and not to the edit box
,,sel cid
,,,case 3
,,,SendMessage id(4 Phwnd) message wParam lParam
,,,case 7
,,,SendMessage id(10 Phwnd) message wParam lParam
,,,case 8
,,,SendMessage id(11 Phwnd) message wParam lParam
,,ret

int wndproc=GetProp(hWnd "wndproc"); if(!wndproc) ret
ret CallWindowProcW(wndproc hWnd message wParam lParam)


Messages In This Thread
solve the conflict between double keys - by win - 04-25-2019, 02:58 AM
RE: solve the conflict between double keys - by win - 04-26-2019, 02:37 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)