SHOW:
|
|
- or go back to the newest paste.
1 | #include <GUIConstants.au3> | |
2 | #include <SendMessage.au3> | |
3 | ||
4 | $hWnd = GUICreate("LIstView Button Navigation", 300, 410) | |
5 | $cList = GUICtrlCreateListView("Test A|TestB", 5, 5, 290, 340) | |
6 | $cButton_Up = GUICtrlCreateButton("Up", 5, 350, 80, 25) | |
7 | $cButton_Down = GUICtrlCreateButton("Down", 5, 380, 80, 25) | |
8 | GUISetState() | |
9 | ||
10 | $hWnd_ListView = GUICtrlGetHandle($cList) | |
11 | ||
12 | For $i = 1 To 20 | |
13 | GUICtrlCreateListViewItem($i & "|" & Random(), $cList) | |
14 | Next | |
15 | ||
16 | While True | |
17 | Switch GUIGetMsg() | |
18 | Case $GUI_EVENT_CLOSE | |
19 | Exit | |
20 | Case $cButton_Up | |
21 | _SendMessage($hWnd_ListView, $WM_KEYDOWN, 0x26, 0) | |
22 | Sleep(100) | |
23 | _SendMessage($hWnd_ListView, $WM_KEYUP, 0x26, 0) | |
24 | ControlFocus($hWnd, "", $cList) | |
25 | Case $cButton_Down | |
26 | _SendMessage($hWnd_ListView, $WM_KEYDOWN, 0x28, 0) | |
27 | Sleep(100) | |
28 | _SendMessage($hWnd_ListView, $WM_KEYUP, 0x28, 0) | |
29 | ControlFocus($hWnd, "", $cList) | |
30 | EndSwitch | |
31 | WEnd |