Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
solve the conflict between double keys
#44
Still can't output characters, why Huh

Macro Macro8
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 256 154 "Dialog" "4"
;3 Edit 0x54030080 0x200 24 12 96 13 ""
;4 ListBox 0x54230101 0x200 24 28 96 93 ""
;5 Edit 0x54030080 0x200 136 12 96 13 ""
;6 ListBox 0x54230101 0x200 136 28 96 93 ""
;1 Button 0x54030001 0x4 72 132 48 14 "OK"
;2 Button 0x54030000 0x4 136 132 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040801 "*" "" "" ""

str controls = "3 4 5 6"
str e3 lb4 e5 lb6
lb4="one[]two[]three"
lb6="four[]five[]six"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc v
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 10 0
,int he3=id(3 hDlg)
,SetProp he3 "wndproc" SubclassWindow(he3 &sub.EditSubclassProc3)
,
,SetTimer hDlg 2 10 0
,int he5=id(5 hDlg)
,SetProp he5 "wndproc" SubclassWindow(he5 &sub.EditSubclassProc5)
,
,case WM_TIMER
,sel wParam
,,case 1
,,KillTimer hDlg wParam
,,goto e3text
,,case 2
,,KillTimer hDlg wParam
,,goto e5text
,,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_CHANGE<<16|3
,SetTimer hDlg 1 100 0
,case EN_CHANGE<<16|5
,SetTimer hDlg 2 100 0
,
,case LBN_DBLCLK<<16|4
,LB_SelectedItem(lParam _s)
,mes F"selected {_s}"
,
,case LBN_DBLCLK<<16|6
,int i6=LB_SelectedItem(lParam)
,mes F"selected {i6+1}"
,case IDOK
,case IDCANCEL
ret 1

;e3text
int hlb4=id(4 hDlg)
SendMessage hlb4 LB_RESETCONTENT 0 0
str s3 sEdit3.getwintext(id(3 hDlg))
foreach s3 lb4
,if(sEdit3.len and find(s3 sEdit3 0 1)<0) continue
,LB_Add hlb4 s3
ret

;e5text
int hlb6=id(6 hDlg)
SendMessage hlb6 LB_RESETCONTENT 0 0
str s5 sEdit5.getwintext(id(5 hDlg))
foreach s5 lb6
,if(sEdit5.len and find(s5 sEdit5 0 1)<0) continue
,LB_Add hlb6 s5
ret

#sub EditSubclassProc3
function# hWnd message wParam lParam

;OutWinMsg message wParam lParam
sel message
,case WM_DESTROY
,
,case WM_GETDLGCODE
,sel(wParam)
,,case [VK_RETURN,VK_SPACE]
,,ret DLGC_WANTALLKEYS

,case [WM_KEYDOWN,WM_KEYUP]
,sel wParam
,,case [VK_DOWN,VK_UP,VK_PRIOR,VK_NEXT]
,,SendMessage id(4 GetParent(hWnd)) message wParam lParam
,,ret
,,case [VK_RETURN,VK_SPACE]
,,SendMessage GetParent(hWnd) WM_COMMAND LBN_DBLCLK<<16|4 hWnd
,,ret

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


#sub EditSubclassProc5
function# hWnd message wParam lParam

;OutWinMsg message wParam lParam
sel message
,case WM_DESTROY
,
,case WM_GETDLGCODE
,sel(wParam)
,,case [VK_RETURN,VK_SPACE]
,,ret DLGC_WANTALLKEYS

,case [WM_KEYDOWN,WM_KEYUP]
,sel wParam
,,case [VK_DOWN,VK_UP,VK_PRIOR,VK_NEXT]
,,SendMessage id(6 GetParent(hWnd)) message wParam lParam
,,ret
,,case [VK_RETURN,VK_SPACE]
,,SendMessage GetParent(hWnd) WM_COMMAND LBN_DBLCLK<<16|6 hWnd
,,ret

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


Attached Files Image(s)
   


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-27-2019, 11:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)