Hallo Community,
ich bin schon seit längerem mit AutoIt aktiv, und programmiere damit sehr gerne.
Ich habe jetzt aber ein Problem für das ich auch im Forum nichts passendes gefunden habe.
Hier mein Testscript.
C
#Region - Timestamp
; 21.07.2016 20:10:30
#EndRegion
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <WindowsConstants.au3>
#include <PrgInfo_UDF.au3>
#include <GuiStatusBar.au3>
#include <GuiListView.au3>
#include <GuiComboBox.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=X:\Dropbox\AutoIT\Picture Manager\TestForum.kxf
Global $hGui = GUICreate("hGui", 603, 401, -1, -1)
Global $hInp = GUICtrlCreateInput("", 8, 16, 273, 21)
Global $hLv = GUICtrlCreateListView("Titel|Status", 304, 16, 281, 369)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
GUIRegisterMsg($WM_NOTIFY, "LV_NOTIFY")
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
_GUICtrlListView_AddItem($hLv, "Titel 1", 0)
_GUICtrlListView_AddSubItem($hLv, 0, "OK", 1)
_GUICtrlListView_AddItem($hLv, "Titel 2", 1)
_GUICtrlListView_AddSubItem($hLv, 1, "Fehler", 1)
_GUICtrlListView_AddItem($hLv, "Titel 3", 2)
_GUICtrlListView_AddSubItem($hLv, 2, "OK", 1)
_GUICtrlListView_AddItem($hLv, "Titel 4", 3)
_GUICtrlListView_AddSubItem($hLv, 3, "OK", 1)
_GUICtrlListView_AddItem($hLv, "Titel 5", 4)
_GUICtrlListView_AddSubItem($hLv, 4, "OK", 1)
While 1
Sleep(100)
WEnd
Func _Exit()
GUIDelete()
Exit
EndFunc ;==>_Exit
Func LV_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg, $wParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = GUICtrlGetHandle($hLv)
If Not IsHWnd(GUICtrlGetHandle($hLv)) Then $hWndListView = GUICtrlGetHandle(GUICtrlGetHandle($hLv))
$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case GUICtrlGetHandle($hLv)
Switch $iCode
Case $NM_CLICK
GUICtrlSetData($hInp, _GUICtrlListView_GetItemText($hLv, Int(_GUICtrlListView_GetSelectedIndices($hLv))))
Case $LVN_KEYDOWN
$tInfo = DllStructCreate($tagNMLVKEYDOWN, $lParam)
Switch DllStructGetData($tInfo, "VKey")
Case 38; Hoch
_GUICtrlListView_ClickItem($hLv, Int(_GUICtrlListView_GetSelectedIndices($hLv)) - 1)
Case 40; Runter
_GUICtrlListView_ClickItem($hLv, Int(_GUICtrlListView_GetSelectedIndices($hLv)) + 1)
Case 35; End
_GUICtrlListView_ClickItem($hLv, _GUICtrlListView_GetItemCount($hLv) - 1)
case 36; Home
_GUICtrlListView_ClickItem($hLv, 0)
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
Alles anzeigen
Das ganze funktioniert einwandfrei, solange ich es unter 32bit (#AutoIt3Wrapper_UseX64=n) laufen lasse. Kompiliere ich es aber im 64bit (#AutoIt3Wrapper_UseX64=y) Modus erkennt er die Tasten nicht mehr.
Ich hoffe ihr könnt mir weiterhelfen.
Gruß Falke