Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Wisielec


matiszon

Rekomendowane odpowiedzi

Opublikowano

Przykładowy skrypt gry w "wisielca".

 

Źródełko. Tylko kod, reszta jest w linku poniżej.

 

 

 

#include <string.au3>
#include <array.au3>
#include <misc.au3>

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $dbgmode = 0, $dane[2], $i, $szanse = 12, $probowane = ""

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=Form2.kxf
$Form2 = GUICreate("Wisielec ", 486, 226, 208, 209)
GUISetBkColor(0xFFFFFF)
$Button1 = GUICtrlCreateButton("Wylosuj słowo", 304, 8, 83, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("", 228, 40, 232, 17, $SS_CENTER)
$Label2 = GUICtrlCreateLabel("Wciskaj na klawiaturze znaki które chcesz wstawić.", 216, 196, 249, 17)
$Label3 = GUICtrlCreateLabel("Podpowiedź:", 312, 68, 65, 17)
$Label4 = GUICtrlCreateLabel("", 208, 88, 260, 97, $SS_CENTER)
$Pic10 = GUICtrlCreatePic("images\lreka.jpg", 113, 108, 30, 20, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic9 = GUICtrlCreatePic("images\rreka.jpg", 149, 106, 34, 20, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic8 = GUICtrlCreatePic("images\tolow.jpg", 143, 90, 6, 59, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic12 = GUICtrlCreatePic("images\lstopa.jpg", 108, 139, 36, 36, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic11 = GUICtrlCreatePic("images\rstopa.jpg", 147, 137, 34, 38, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic7 = GUICtrlCreatePic("images\glowa.jpg", 123, 50, 46, 42, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic6 = GUICtrlCreatePic("images\lina.jpg", 143, 18, 6, 32, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic5 = GUICtrlCreatePic("images\podpora.jpg", 51, 24, 38, 36, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic4 = GUICtrlCreatePic("images\ppal.jpg", 43, 18, 106, 6, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic3 = GUICtrlCreatePic("images\pal.jpg", 43, 19, 8, 168, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic2 = GUICtrlCreatePic("images\rkij.jpg", 47, 171, 30, 32, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
$Pic1 = GUICtrlCreatePic("images\lkij.jpg", 19, 170, 26, 34, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUISetOnEvent($GUI_EVENT_CLOSE, "end")
GUICtrlSetOnEvent($Button1, "randomuj_slowo_")

Global $max_page = get_max_page()
randomuj_slowo_()

While 1
   _IsMyPress()
WEnd

Func _IsMyPress()
   If WinActive($Form2) Then
       For $i = 32 To 255
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(65, 2)) Then
               check("ą")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(69, 2)) Then
               check("ę")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(67, 2)) Then
               check("ć")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(83, 2)) Then
               check("ś")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(78, 2)) Then
               check("ń")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(88, 2)) Then
               check("ź")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(90, 2)) Then
               check("ż")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(76, 2)) Then
               check("ł")
               ExitLoop
           EndIf
           If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(79, 2)) Then
               check("ó")
               ExitLoop
           EndIf
           If _IsPressed(Hex($i, 2)) Then
               If $i <> 162 And $i <> 164 And $i <> 165 Then
                   check(Chr($i))
                   ExitLoop
               EndIf
           EndIf
           ;TrayTip("", $probowane, 1)
       Next
   EndIf
EndFunc   ;==>_IsMyPress

Func check($i)
   If Not StringInStr($dane[0], $i) Then
       odejmij_szanse($i)
   Else
       dodaj($i)
   EndIf
EndFunc   ;==>check

Func game_over_win()
   SoundPlay("sound\tada.wav")
   MsgBox(0, "", "Noo, zajebiście udało ci się!")
   randomuj_slowo_()
EndFunc   ;==>game_over_win

Func game_over_lose()
   SoundPlay("sound\ir_inter.wav")
   set_slowo($dane[0], 1)
   MsgBox(0, "", "Ale chujnia jesteś w to za słaby, przegrałeś!!!")
   randomuj_slowo_()
EndFunc   ;==>game_over_lose

Func dodaj($i)
   If Not StringInStr($probowane, $i) Then
       $probowane &= $i
       set_slowo($dane[0])
       If Not StringInStr(GUICtrlRead($Label1), "_") Then game_over_win()
   EndIf
EndFunc   ;==>dodaj

Func odejmij_szanse($i)
   If Not StringInStr($probowane, $i) Then
       $probowane &= $i
       $szanse -= 1
       Switch $szanse
           Case 11
               GUICtrlSetState($Pic1, $GUI_SHOW)
           Case 10
               GUICtrlSetState($Pic2, $GUI_SHOW)
           Case 9
               GUICtrlSetState($Pic3, $GUI_SHOW)
           Case 8
               GUICtrlSetState($Pic4, $GUI_SHOW)
           Case 7
               GUICtrlSetState($Pic5, $GUI_SHOW)
           Case 6
               GUICtrlSetState($Pic6, $GUI_SHOW)
           Case 5
               GUICtrlSetState($Pic7, $GUI_SHOW)
           Case 4
               GUICtrlSetState($Pic8, $GUI_SHOW)
           Case 3
               GUICtrlSetState($Pic9, $GUI_SHOW)
           Case 2
               GUICtrlSetState($Pic10, $GUI_SHOW)
           Case 1
               GUICtrlSetState($Pic11, $GUI_SHOW)
           Case 0
               GUICtrlSetState($Pic12, $GUI_SHOW)
       EndSwitch

       If $szanse = 0 Then game_over_lose()

   EndIf
EndFunc   ;==>odejmij_szanse

Func randomuj_slowo_()
   hide()
   $probowane = ""
   $szanse = 12
   GUICtrlSetData($Button1, "Losuje...")
   GUICtrlSetState($Button1, $GUI_DISABLE)
   $dane = random_word()
   If $dbgmode = 1 Then $dane[0] = "slowo"
   If $dbgmode = 1 Then $dane[1] = "slowo"
   If $dane <> False Then
       set_slowo($dane[0])
       GUICtrlSetData($Label4, $dane[1])
   EndIf
   GUICtrlSetData($Button1, "Wylosuj słowo")
   GUICtrlSetState($Button1, $GUI_ENABLE)
EndFunc   ;==>randomuj_slowo_

Func set_slowo($slowo, $show = 0)
   $sp = StringSplit($slowo, "")
   $datx = ""
   For $i = 1 To $sp[0]
       If StringInStr($probowane, $sp[$i]) Or $show = 1 Then
           $datx &= " " & $sp[$i] & " "
       Else
           $datx &= " _ "
       EndIf
   Next
   GUICtrlSetData($Label1, $datx)
EndFunc   ;==>set_slowo

Func random_word()
   Local $return[2]
   $html = get("http://www.sjp.pl/slownik/lp.phtml?page=" & Random(0, $max_page, 1))
   $word = _StringBetween($html, '<tr><td><a href="/', '">')
   If $dbgmode = 1 Then _ArrayDisplay($word)
   $html = get("http://www.sjp.pl/co/" & $word[Random(0, UBound($word) - 1, 1)])
   $word = _StringBetween($html, 'sans-serif;">', '</h1>')
   $znaczenie = _StringBetween($html, 'valign="top">znaczenie:</th><td>', '<br />' & @LF)
   If $dbgmode = 1 Then _ArrayDisplay($word)
   If $dbgmode = 1 Then _ArrayDisplay($znaczenie)
   If Not @error Then
       $return[0] = $word[0]
       If Not StringInStr($znaczenie[0], "brak") Then
           $return[1] = $znaczenie[0]
       Else
           $return[1] = "Brak podpowiedzi."
       EndIf
       Return $return
   Else
       Return False
   EndIf
EndFunc   ;==>random_word

Func get_max_page()
   $html = get("http://www.sjp.pl/slownik/lp.phtml")
   $beetwen = _StringBetween($html, '... ' & @LF & '<a href="/slownik/lp.phtml?page=', '">')
   If $dbgmode = 1 Then _ArrayDisplay($beetwen)
   Return $beetwen[0]
EndFunc   ;==>get_max_page

Func hide()
   GUICtrlSetState($Pic1, $GUI_HIDE)
   GUICtrlSetState($Pic2, $GUI_HIDE)
   GUICtrlSetState($Pic3, $GUI_HIDE)
   GUICtrlSetState($Pic4, $GUI_HIDE)
   GUICtrlSetState($Pic5, $GUI_HIDE)
   GUICtrlSetState($Pic6, $GUI_HIDE)
   GUICtrlSetState($Pic7, $GUI_HIDE)
   GUICtrlSetState($Pic8, $GUI_HIDE)
   GUICtrlSetState($Pic9, $GUI_HIDE)
   GUICtrlSetState($Pic10, $GUI_HIDE)
   GUICtrlSetState($Pic11, $GUI_HIDE)
   GUICtrlSetState($Pic12, $GUI_HIDE)
EndFunc   ;==>hide

Func get($page)
   If Not StringInStr($page, "http://") Then $page = "http://" & $page
   $WinHttp = ObjCreate("winhttp.winhttprequest.5.1")

   ;$WinHttp.SetTimeouts(120000, 120000, 120000, 120000);

   $WinHttp.Open("GET", $page);


   $WinHttp.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10")
   $WinHttp.SetRequestHeader("Connection", "keep-alive")
   $WinHttp.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")

   $WinHttp.Send("")

   $return = $WinHttp.ResponseText

   $return = StringReplace($return, ChrW(182), "ś")
   $return = StringReplace($return, ChrW(230), "ć")
   $return = StringReplace($return, ChrW(179), "ł")
   $return = StringReplace($return, ChrW(191), "ż")
   $return = StringReplace($return, ChrW(177), "ą")
   $return = StringReplace($return, ChrW(234), "ę")
   $return = StringReplace($return, ChrW(241), "ń")
   $return = StringReplace($return, ChrW(188), "ź")
   $return = StringReplace($return, "quot;", '"')

   Return $return
EndFunc   ;==>get

Func end()
   Exit
EndFunc   ;==>end
 

 

 

Dodatkowe materiały (projekt GUI do programu koda, grafika, dźwięki)

[link usunięty przez moderatora] 

Opublikowano

'Ale chujnia, jesteś w to za słaby' to o twoich umiejętnościach w autoicie można powiedzieć.

 

90% procka i jeszcze się zacina. Co to za idiotyczny pomysł robić to _Ispressed?

 

Pomyśl.

Ta sygnatura jest pusta.

Opublikowano

Po h..... się tak pierdolić ? HotKeySet na każdy klawisz i wydajnośc niesamowita i nie będzie się cieło.... pomyśl.... Albo gui gdzie wpisywało by się literke i wciskało sprawdź.... cokolwiek ale nie w While -.-

Opublikowano

Przepraszam wszystkich , ale mi na kompie tego wisielca nie muli :)

Bardzo fajna gra matiszon :)

Dzięki za wstawke :)

+

userbarwb.png

Zawsze promocje na sygnatury ^^

Opublikowano

hmm, no tak na początek to

w funkcji _IsMyPress()

For $i = 32 To 255 przenieś z 47 do 84 linii, wtedy wydajność powinna wzrosnąć 3-4 krotne

 

jest kilka innych metod poza _IsPressed

choć by rejestracja zdarzeń za pomocą GUIRegisterMsg przedstawiona w tym przykładzie z helpa

 

 

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

Global $hListView

_Main()

Func _Main()

Local $GUI, $hImage
$GUI = GUICreate("(UDF Created) ListView Create", 400, 300)

$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)

; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc   ;==>_Main

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
;~ 	Local $tBuffer
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)

$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
	Case $hWndListView
		Switch $iCode
;~ 				Case $LVN_BEGINDRAG ; A drag-and-drop operation involving the left mouse button is being initiated
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_BEGINLABELEDIT ; Start of label editing for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					Return False ; Allow the user to edit the label
;~ 					;Return True  ; Prevent the user from editing the label
;~ 				Case $LVN_BEGINRDRAG ; A drag-and-drop operation involving the right mouse button is being initiated
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINRDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_BEGINSCROLL ; A scrolling operation starts, Minium OS WinXP
;~ 					$tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~ 							"-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~ 					; No return value
			Case $LVN_COLUMNCLICK ; A column was clicked
				$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
				_DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
				; No return value
;~ 				Case $LVN_DELETEALLITEMS ; All items in the control are about to be deleted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_DELETEALLITEMS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return True ; To suppress subsequent $LVN_DELETEITEM messages
;~ 					;Return False ; To receive subsequent $LVN_DELETEITEM messages
;~ 				Case $LVN_DELETEITEM ; An item is about to be deleted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_DELETEITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ENDLABELEDIT ; The end of label editing for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_ENDLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; If Text is not empty, return True to set the item's label to the edited text, return false to reject it
;~ 					; If Text is empty the return value is ignored
;~ 					Return True
;~ 				Case $LVN_ENDSCROLL ; A scrolling operation ends, Minium OS WinXP
;~ 					$tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~ 					_DebugPrint("$LVN_ENDSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~ 							"-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~ 					; No return value
;~ 				Case $LVN_GETDISPINFO ; Provide information needed to display or sort a list-view item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_GETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; No return value
;~ 				Case $LVN_GETINFOTIP ; Sent by a large icon view list-view control that has the $LVS_EX_INFOTIP extended style
;~ 					$tInfo = DllStructCreate($tagNMLVGETINFOTIP, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_GETINFOTIP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam"))
;~ 					; No return value
;~ 				Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_HOTTRACK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return 0 ; allow the list view to perform its normal track select processing.
;~ 					;Return 1 ; the item will not be selected.
;~ 				Case $LVN_INSERTITEM ; A new item was inserted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_INSERTITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ITEMACTIVATE ; Sent by a list-view control when the user activates an item
;~ 					$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMACTIVATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~ 							"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~ 					Return 0
;~ 				Case $LVN_ITEMCHANGED ; An item has changed
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMCHANGED" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ITEMCHANGING ; An item is changing
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMCHANGING" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return True ; prevent the change
;~ 					;Return False ; allow the change
			Case $LVN_KEYDOWN ; A key has been pressed
				$tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam)
				_DebugPrint("$LVN_KEYDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @LF & _
						"-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags"))
				; No return value
;~ 				Case $LVN_MARQUEEBEGIN ; A bounding box (marquee) selection has begun
;~ 					_DebugPrint("$LVN_MARQUEEBEGIN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode)
;~ 					Return 0 ; accept the message
;~ 					;Return 1 ; quit the bounding box selection
;~ 				Case $LVN_SETDISPINFO ; Update the information it maintains for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_SETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; No return value
			Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
			Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
;~ 				Case $NM_HOVER ; Sent by a list-view control when the mouse hovers over an item
;~ 					_DebugPrint("$NM_HOVER" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode)
;~ 					Return 0 ; process the hover normally
;~ 					;Return 1 ; prevent the hover from being processed
			Case $NM_KILLFOCUS ; The control has lost the input focus
				_DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
			Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				;Return 1 ; not to allow the default processing
				Return 0 ; allow the default processing
			Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
			Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key
				_DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
			Case $NM_SETFOCUS ; The control has received the input focus
				_DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
		EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
		"!===========================================================" & @LF & _
		"+======================================================" & @LF & _
		"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
		"+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

 

 

samo guiregistermsg jest pochodną innej bardziej skutecznej funkcji której tu jednak nie przytoczę, no niestety za dużo trolii pałęta sie tu za metodami na keylogery.

wiec po co sobie życie samemu komplikować (?)

 

 

tak pozatym bardzo fajny patęcik zamiast standardowego ie.au3... może się to to nawet przydać ;)

Opublikowano
A jak chcesz załatwić to inaczej niż ispressed ? Specjalnie nie dawałem sleep bo nie wychwytywało by wszystkich klawiszy.

 

Patrz i płacz, amatorze! ;)

 

GUICreate('Literki w konsoli', 200, 200)
GUICtrlSetFont(-1, 12)
GUIRegisterMsg(0x0100, 'keypress')
GUISetState()
ConsoleWrite(@crlf & @CRLF)
Do
Until GuiGetMsg() = -3
ConsoleWrite(@crlf & @CRLF)
Func keypress($q, $w, $e, $r)
ConsoleWrite(Chr(Dec(Hex($e))))
EndFunc

 

Proszę, do usług :] - w pięć minut, najprostsze co może być.

Ta sygnatura jest pusta.

Opublikowano

tam zdaje się brak jest zakończenia tej funkcji

o ile sie nie mylę na samym końcu powinno zwracać:

 

Return $GUI_RUNDEFMSG  ; lub odrazu: 'GUI_RUNDEFMSG'

 

 

Func keypress($q, $w, $e, $r)
#forceref $q, $w, $e, $r
ConsoleWrite(Chr(Dec(Hex($e))))
Return 'GUI_RUNDEFMSG'
EndFunc

Opublikowano

hmm, no tak na początek to

w funkcji _IsMyPress()

For $i = 32 To 255 przenieś z 47 do 84 linii, wtedy wydajność powinna wzrosnąć 3-4 krotne

 

jest kilka innych metod poza _IsPressed

choć by rejestracja zdarzeń za pomocą GUIRegisterMsg przedstawiona w tym przykładzie z helpa

 

 

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

$Debug_LV = False ; Check ClassName being passed to ListView functions, set to True and use a handle to another control to see it work

Global $hListView

_Main()

Func _Main()

Local $GUI, $hImage
$GUI = GUICreate("(UDF Created) ListView Create", 400, 300)

$hListView = _GUICtrlListView_Create($GUI, "", 2, 2, 394, 268)
_GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES))
GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

; Load images
$hImage = _GUIImageList_Create()
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0xFF0000, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x00FF00, 16, 16))
_GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($hListView, 0x0000FF, 16, 16))
_GUICtrlListView_SetImageList($hListView, $hImage, 1)

; Add columns
_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100)

; Add items
_GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1)
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_AddItem($hListView, "Row 3: Col 1", 2)

; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc   ;==>_Main

Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
;~ 	Local $tBuffer
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)

$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
	Case $hWndListView
		Switch $iCode
;~ 				Case $LVN_BEGINDRAG ; A drag-and-drop operation involving the left mouse button is being initiated
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_BEGINLABELEDIT ; Start of label editing for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					Return False ; Allow the user to edit the label
;~ 					;Return True  ; Prevent the user from editing the label
;~ 				Case $LVN_BEGINRDRAG ; A drag-and-drop operation involving the right mouse button is being initiated
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINRDRAG" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_BEGINSCROLL ; A scrolling operation starts, Minium OS WinXP
;~ 					$tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~ 					_DebugPrint("$LVN_BEGINSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~ 							"-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~ 					; No return value
			Case $LVN_COLUMNCLICK ; A column was clicked
				$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
				_DebugPrint("$LVN_COLUMNCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
				; No return value
;~ 				Case $LVN_DELETEALLITEMS ; All items in the control are about to be deleted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_DELETEALLITEMS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return True ; To suppress subsequent $LVN_DELETEITEM messages
;~ 					;Return False ; To receive subsequent $LVN_DELETEITEM messages
;~ 				Case $LVN_DELETEITEM ; An item is about to be deleted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_DELETEITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ENDLABELEDIT ; The end of label editing for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_ENDLABELEDIT" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; If Text is not empty, return True to set the item's label to the edited text, return false to reject it
;~ 					; If Text is empty the return value is ignored
;~ 					Return True
;~ 				Case $LVN_ENDSCROLL ; A scrolling operation ends, Minium OS WinXP
;~ 					$tInfo = DllStructCreate($tagNMLVSCROLL, $ilParam)
;~ 					_DebugPrint("$LVN_ENDSCROLL" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->DX:" & @TAB & DllStructGetData($tInfo, "DX") & @LF & _
;~ 							"-->DY:" & @TAB & DllStructGetData($tInfo, "DY"))
;~ 					; No return value
;~ 				Case $LVN_GETDISPINFO ; Provide information needed to display or sort a list-view item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_GETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; No return value
;~ 				Case $LVN_GETINFOTIP ; Sent by a large icon view list-view control that has the $LVS_EX_INFOTIP extended style
;~ 					$tInfo = DllStructCreate($tagNMLVGETINFOTIP, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_GETINFOTIP" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam"))
;~ 					; No return value
;~ 				Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_HOTTRACK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return 0 ; allow the list view to perform its normal track select processing.
;~ 					;Return 1 ; the item will not be selected.
;~ 				Case $LVN_INSERTITEM ; A new item was inserted
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_INSERTITEM" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ITEMACTIVATE ; Sent by a list-view control when the user activates an item
;~ 					$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMACTIVATE" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
;~ 							"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
;~ 					Return 0
;~ 				Case $LVN_ITEMCHANGED ; An item has changed
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMCHANGED" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					; No return value
;~ 				Case $LVN_ITEMCHANGING ; An item is changing
;~ 					$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
;~ 					_DebugPrint("$LVN_ITEMCHANGING" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
;~ 							"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
;~ 							"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
;~ 							"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
;~ 							"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
;~ 					Return True ; prevent the change
;~ 					;Return False ; allow the change
			Case $LVN_KEYDOWN ; A key has been pressed
				$tInfo = DllStructCreate($tagNMLVKEYDOWN, $ilParam)
				_DebugPrint("$LVN_KEYDOWN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->VKey:" & @TAB & DllStructGetData($tInfo, "VKey") & @LF & _
						"-->Flags:" & @TAB & DllStructGetData($tInfo, "Flags"))
				; No return value
;~ 				Case $LVN_MARQUEEBEGIN ; A bounding box (marquee) selection has begun
;~ 					_DebugPrint("$LVN_MARQUEEBEGIN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode)
;~ 					Return 0 ; accept the message
;~ 					;Return 1 ; quit the bounding box selection
;~ 				Case $LVN_SETDISPINFO ; Update the information it maintains for an item
;~ 					$tInfo = DllStructCreate($tagNMLVDISPINFO, $ilParam)
;~ 					$tBuffer = DllStructCreate("char Text[" & DllStructGetData($tInfo, "TextMax") & "]", DllStructGetData($tInfo, "Text"))
;~ 					_DebugPrint("$LVN_SETDISPINFO" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode & @LF & _
;~ 							"-->Mask:" & @TAB & DllStructGetData($tInfo, "Mask") & @LF & _
;~ 							"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
;~ 							"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
;~ 							"-->State:" & @TAB & DllStructGetData($tInfo, "State") & @LF & _
;~ 							"-->StateMask:" & @TAB & DllStructGetData($tInfo, "StateMask") & @LF & _
;~ 							"-->Text:" & @TAB & DllStructGetData($tBuffer, "Text") & @LF & _
;~ 							"-->TextMax:" & @TAB & DllStructGetData($tInfo, "TextMax") & @LF & _
;~ 							"-->Image:" & @TAB & DllStructGetData($tInfo, "Image") & @LF & _
;~ 							"-->Param:" & @TAB & DllStructGetData($tInfo, "Param") & @LF & _
;~ 							"-->Indent:" & @TAB & DllStructGetData($tInfo, "Indent") & @LF & _
;~ 							"-->GroupID:" & @TAB & DllStructGetData($tInfo, "GroupID") & @LF & _
;~ 							"-->Columns:" & @TAB & DllStructGetData($tInfo, "Columns") & @LF & _
;~ 							"-->pColumns:" & @TAB & DllStructGetData($tInfo, "pColumns"))
;~ 					; No return value
			Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_CLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
			Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_DBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
;~ 				Case $NM_HOVER ; Sent by a list-view control when the mouse hovers over an item
;~ 					_DebugPrint("$NM_HOVER" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
;~ 							"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
;~ 							"-->Code:" & @TAB & $iCode)
;~ 					Return 0 ; process the hover normally
;~ 					;Return 1 ; prevent the hover from being processed
			Case $NM_KILLFOCUS ; The control has lost the input focus
				_DebugPrint("$NM_KILLFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
			Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_RCLICK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				;Return 1 ; not to allow the default processing
				Return 0 ; allow the default processing
			Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button
				$tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam)
				_DebugPrint("$NM_RDBLCLK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode & @LF & _
						"-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _
						"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
						"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
						"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
						"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
						"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
						"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
						"-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _
						"-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
				; No return value
			Case $NM_RETURN ; The control has the input focus and that the user has pressed the ENTER key
				_DebugPrint("$NM_RETURN" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
			Case $NM_SETFOCUS ; The control has received the input focus
				_DebugPrint("$NM_SETFOCUS" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
						"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
						"-->Code:" & @TAB & $iCode)
				; No return value
		EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
		"!===========================================================" & @LF & _
		"+======================================================" & @LF & _
		"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
		"+======================================================" & @LF)
EndFunc   ;==>_DebugPrint

 

 

samo guiregistermsg jest pochodną innej bardziej skutecznej funkcji której tu jednak nie przytoczę, no niestety za dużo trolii pałęta sie tu za metodami na keylogery.

wiec po co sobie życie samemu komplikować (?)

 

 

tak pozatym bardzo fajny patęcik zamiast standardowego ie.au3... może się to to nawet przydać ;)

 

Gdy bym wyją to przed pętle jak mówisz to by mi wstawiało do zmiennej np najpierw ą a później A. Exitloopy temu zapobiegają.

 

Myślałem żeby wychwytywać klawisze za pomocą gui ale nie wiedziałem jak to zrobić.

 

juri_gag nie mogłem użyć hotkeyów ponieważ np gdy bym się przełączył na inną aplikacje to by i tak wisielec wychwytywał klawisze.

Opublikowano

Mi niestety to strasznie muli:( i wiesza sie program, nawet jak dalem

sleep(10)

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Opublikowano

Patrz i płacz, amatorze! ;)

 

GUICreate('Literki w konsoli', 200, 200)
GUICtrlSetFont(-1, 12)
GUIRegisterMsg(0x0100, 'keypress')
GUISetState()
ConsoleWrite(@crlf & @CRLF)
Do
Until GuiGetMsg() = -3
ConsoleWrite(@crlf & @CRLF)
Func keypress($q, $w, $e, $r)
ConsoleWrite(Chr(Dec(Hex($e))))
EndFunc

 

Proszę, do usług :] - w pięć minut, najprostsze co może być.

 

Skoro jestem amatorem dla czego moje aplikacje się dobrze sprzedają, a ty jeszcze nic nie napisałaś.

Opublikowano

_ispressed to nie jest wcale taka zła funkcja

tyle ze teraz u ciebie w jednym cyklu wykonuje 4237 sprawdzenia wciśniętych klawiszy (między powiedzmy "a" a kolejnym sprawdzeniem "a")

żre przez to proca jak smok a itak zamula

a starczy zrobić tak

 

Func _IsMyPress()
If WinActive($Form2) Then
	For $i = 65 To 90
		If _IsPressed(Hex(165, 2)) Then
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(65, 2)) Then check("ą")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(69, 2)) Then check("ę")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(67, 2)) Then check("ć")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(83, 2)) Then check("ś")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(78, 2)) Then check("ń")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(88, 2)) Then check("ź")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(90, 2)) Then check("ż")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(76, 2)) Then check("ł")
			If _IsPressed(Hex(165, 2)) And _IsPressed(Hex(79, 2)) Then check("ó")
		Else
			If _IsPressed(Hex($i, 2)) Then check(Chr($i))
		EndIf
	Next
	TrayTip("", $probowane, 1)
	Sleep(20)
EndIf
EndFunc

 

i jest dokładnie 84 razy szybciej (jeden cykl = 50), wiec można sleepy powciskać

 

 

lub tak:

 

Func _IsMyPress()
If WinActive($Form2) Then
	Local $i
	For $i = 65 To 90
		If _IsPressed(Hex($i, 2)) Then
			If Not _IsPressed(Hex(165, 2)) Then
				check(Chr($i))
			Else
				Local $ar[9][2] = [[65, "ą"],[69, "ę"],[67, "ć"],[83, "ś"],[78, "ń"],[88, "ź"],[90, "ż"],[76, "ł"],[79, "ó"]]
				Local $idx
				For $idx = 0 To 8
					If ($ar[$idx][0] = $i) Then check($ar[$idx][1])
				Next
			EndIf
		EndIf
	Next
	TrayTip("", $probowane, 1)
	Sleep(20)
EndIf
EndFunc   ;==>_IsMyPress

 

169 razy szybciej (cykl =25)

Opublikowano

a tu z innej bajki gra w kolko i krzyzyk

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $x, $x_o
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 273, 119, 192, 124)
$Button1 = GUICtrlCreateButton("", 16, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("", 96, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button2Click")
$Button3 = GUICtrlCreateButton("", 176, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button3Click")
$Button4 = GUICtrlCreateButton("", 16, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button4Click")
$Button5 = GUICtrlCreateButton("", 96, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button5Click")
$Button6 = GUICtrlCreateButton("", 176, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button6Click")
$Button7 = GUICtrlCreateButton("", 16, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button7Click")
$Button8 = GUICtrlCreateButton("", 96, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button8Click")
$Button9 = GUICtrlCreateButton("", 176, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button9Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$x = 1
While 1
Sleep(100)

If $x = 1 Then
	$x_o = "x"
ElseIf $x = 2 Then
	$x_o = "o"
ElseIf $x = 3 Then
	$x_o = "x"
ElseIf $x = 4 Then
	$x_o = "o"
ElseIf $x = 5 Then
	$x_o = "x"
ElseIf $x = 6 Then
	$x_o = "o"
ElseIf $x = 7 Then
	$x_o = "x"
ElseIf $x = 8 Then
	$x_o = "o"
ElseIf $x = 9 Then
	$x_o = "x"
EndIf
WEnd

Func Button1Click()
GUICtrlSetData($Button1, $x_o)
klik()
EndFunc   ;==>Button1Click
Func Button2Click()
GUICtrlSetData($Button2, $x_o)
klik()
EndFunc   ;==>Button2Click
Func Button3Click()
GUICtrlSetData($Button3, $x_o)
klik()
EndFunc   ;==>Button3Click
Func Button4Click()
GUICtrlSetData($Button4, $x_o)
klik()
EndFunc   ;==>Button4Click
Func Button5Click()
GUICtrlSetData($Button5, $x_o)
klik()
EndFunc   ;==>Button5Click
Func Button6Click()
GUICtrlSetData($Button6, $x_o)
klik()
EndFunc   ;==>Button6Click
Func Button7Click()
GUICtrlSetData($Button7, $x_o)
klik()
EndFunc   ;==>Button7Click
Func Button8Click()
GUICtrlSetData($Button8, $x_o)
klik()
EndFunc   ;==>Button8Click
Func Button9Click()
GUICtrlSetData($Button9, $x_o)
klik()
EndFunc   ;==>Button9Click
Func klik()
$x = $x + 1
EndFunc   ;==>klik

 

 

 

ps. nie cisnac mnie!! jeszcze nie skonczone, mysle jak zrobic zeby pojawial sie komunikat kto wygral :D

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Opublikowano

@UP

Może żeby po każdym kliknięciu sprawdzał texty wszystkich buttonów i sprawdzał czy są 3 x albo 3 o.

Masz chyba taki błąd, że jak klikniesz 2 raz na button to się zmienia z "x" na "o".

Opublikowano

Tak dokladnie ale jesli ktos bedzie chcial oszukac(kliknie na jeden bduton 2 razy ) to zostanie jeden buton bez ruchu:)

a jak sprawdzic tekst z butona? guictrlsetdata??

 

 

[edit]@ up juz nie ma pytania wszystki jasne :D guictrlread($button1):D znalazlem:)

 

 

 

 

[edit2] eleganckie kolko i krzyrzyk wersja wypas z wynikiem :D

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $x, $x_o
$Form1 = GUICreate("kolko i krzyzyk ", 273, 119, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "exi")
$Button1 = GUICtrlCreateButton("", 16, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("", 96, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button2Click")
$Button3 = GUICtrlCreateButton("", 176, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button3Click")
$Button4 = GUICtrlCreateButton("", 16, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button4Click")
$Button5 = GUICtrlCreateButton("", 96, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button5Click")
$Button6 = GUICtrlCreateButton("", 176, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button6Click")
$Button7 = GUICtrlCreateButton("", 16, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button7Click")
$Button8 = GUICtrlCreateButton("", 96, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button8Click")
$Button9 = GUICtrlCreateButton("", 176, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button9Click")
GUISetState(@SW_SHOW)
$x = 1

While 1
Sleep(100)
If $x = 1 Then
	$x_o = "+"
ElseIf $x = 2 Then
	$x_o = "o"
ElseIf $x = 3 Then
	$x_o = "+"
ElseIf $x = 4 Then
	$x_o = "o"
ElseIf $x = 5 Then
	$x_o = "+"
ElseIf $x = 6 Then
	$x_o = "o"
ElseIf $x = 7 Then
	$x_o = "+"
ElseIf $x = 8 Then
	$x_o = "o"
ElseIf $x = 9 Then
	$x_o = "+"
EndIf
$e1 = GUICtrlRead($Button1)
$e2 = GUICtrlRead($Button2)
$e3 = GUICtrlRead($Button3)
$e4 = GUICtrlRead($Button4)
$e5 = GUICtrlRead($Button5)
$e6 = GUICtrlRead($Button6)
$e7 = GUICtrlRead($Button7)
$e8 = GUICtrlRead($Button8)
$e9 = GUICtrlRead($Button9)
;Sprawdza "+"
If $e1 = "+" And $e2 = "+" And $e3 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e1 = "+" And $e5 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e3 = "+" And $e5 = "+" And $e7 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e1 = "+" And $e4 = "+" And $e7 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +")
	Exit
EndIf
If $e2 = "+" And $e5 = "+" And $e8 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e3 = "+" And $e6 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e4 = "+" And $e5 = "+" And $e6 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e7 = "+" And $e8 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
;Sprawdza "o"
If $e1 + "o" And $e2 = "o" And $e3 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
	If $e1 + "o" And $e5 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e3 = "o" And $e5 = "o" And $e7 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e1 = "o" And $e4 = "o" And $e7 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e2 = "o" And $e5 = "o" And $e8 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e3 = "o" And $e6 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e4 = "o" And $e5 = "o" And $e6 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e7 = "o" And $e8 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
WEnd

Func Button1Click()
GUICtrlSetData($Button1, $x_o)
klik()
EndFunc   ;==>Button1Click
Func Button2Click()
GUICtrlSetData($Button2, $x_o)
klik()
EndFunc   ;==>Button2Click
Func Button3Click()
GUICtrlSetData($Button3, $x_o)
klik()
EndFunc   ;==>Button3Click
Func Button4Click()
GUICtrlSetData($Button4, $x_o)
klik()
EndFunc   ;==>Button4Click
Func Button5Click()
GUICtrlSetData($Button5, $x_o)
klik()
EndFunc   ;==>Button5Click
Func Button6Click()
GUICtrlSetData($Button6, $x_o)
klik()
EndFunc   ;==>Button6Click
Func Button7Click()
GUICtrlSetData($Button7, $x_o)
klik()
EndFunc   ;==>Button7Click
Func Button8Click()
GUICtrlSetData($Button8, $x_o)
klik()
EndFunc   ;==>Button8Click
Func Button9Click()
GUICtrlSetData($Button9, $x_o)
klik()
EndFunc   ;==>Button9Click
Func klik()
$x = $x + 1
EndFunc   ;==>klik
Func exi()
Exit
EndFunc   ;==>exi

 

 

 

[edit3] a tu wersja(nie skonczona bo to mnie przerasta) :( ktora miala z nami grac ale zrobienie tego jak juz wspomnialem jest jak narazie za trudna dla mnie wiec moze ktos bedzie mial ochote zrobic kod ktory bedzie grac z nami:D

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $x, $x_o
$Form1 = GUICreate("kolko i krzyzyk ", 273, 119, 192, 124)
GUISetOnEvent($GUI_EVENT_CLOSE, "exi")
$chbox1 = GUICtrlCreateCheckbox("gra z kompem:>", 1, 3, 100, 12)
$Button1 = GUICtrlCreateButton("", 16, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("", 96, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button2Click")
$Button3 = GUICtrlCreateButton("", 176, 16, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button3Click")
$Button4 = GUICtrlCreateButton("", 16, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button4Click")
$Button5 = GUICtrlCreateButton("", 96, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button5Click")
$Button6 = GUICtrlCreateButton("", 176, 48, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button6Click")
$Button7 = GUICtrlCreateButton("", 16, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button7Click")
$Button8 = GUICtrlCreateButton("", 96, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button8Click")
$Button9 = GUICtrlCreateButton("", 176, 80, 75, 25, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Button9Click")
GUISetState(@SW_SHOW)
$x = 1

While 1
Sleep(100)
If GUICtrlRead($chbox1) = 1 Then komputer()
If $x = 1 Then
	$x_o = "+"
ElseIf $x = 2 Then
	$x_o = "o"
ElseIf $x = 3 Then
	$x_o = "+"
ElseIf $x = 4 Then
	$x_o = "o"
ElseIf $x = 5 Then
	$x_o = "+"
ElseIf $x = 6 Then
	$x_o = "o"
ElseIf $x = 7 Then
	$x_o = "+"
ElseIf $x = 8 Then
	$x_o = "o"
ElseIf $x = 9 Then
	$x_o = "+"
EndIf
$e1 = GUICtrlRead($Button1)
$e2 = GUICtrlRead($Button2)
$e3 = GUICtrlRead($Button3)
$e4 = GUICtrlRead($Button4)
$e5 = GUICtrlRead($Button5)
$e6 = GUICtrlRead($Button6)
$e7 = GUICtrlRead($Button7)
$e8 = GUICtrlRead($Button8)
$e9 = GUICtrlRead($Button9)
wynik()
WEnd
Func wynik()
;Sprawdza "+"
If $e1 = "+" And $e2 = "+" And $e3 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e1 = "+" And $e5 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e3 = "+" And $e5 = "+" And $e7 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e1 = "+" And $e4 = "+" And $e7 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +")
	Exit
EndIf
If $e2 = "+" And $e5 = "+" And $e8 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e3 = "+" And $e6 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e4 = "+" And $e5 = "+" And $e6 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
If $e7 = "+" And $e8 = "+" And $e9 = "+" Then
	MsgBox(0, "Koniec", "Wygrywa: +!")
	Exit
EndIf
;Sprawdza "o"
If $e1 + "o" And $e2 = "o" And $e3 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e1 + "o" And $e5 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e3 = "o" And $e5 = "o" And $e7 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e1 = "o" And $e4 = "o" And $e7 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e2 = "o" And $e5 = "o" And $e8 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e3 = "o" And $e6 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e4 = "o" And $e5 = "o" And $e6 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
If $e7 = "o" And $e8 = "o" And $e9 = "o" Then
	MsgBox(0, "Koniec", "Wygrywa: o!")
	Exit
EndIf
EndFunc   ;==>wynik

Func Button1Click()
GUICtrlSetData($Button1, $x_o)
klik()
EndFunc   ;==>Button1Click
Func Button2Click()
GUICtrlSetData($Button2, $x_o)
klik()
EndFunc   ;==>Button2Click
Func Button3Click()
GUICtrlSetData($Button3, $x_o)
klik()
EndFunc   ;==>Button3Click
Func Button4Click()
GUICtrlSetData($Button4, $x_o)
klik()
EndFunc   ;==>Button4Click
Func Button5Click()
GUICtrlSetData($Button5, $x_o)
klik()
EndFunc   ;==>Button5Click
Func Button6Click()
GUICtrlSetData($Button6, $x_o)
klik()
EndFunc   ;==>Button6Click
Func Button7Click()
GUICtrlSetData($Button7, $x_o)
klik()
EndFunc   ;==>Button7Click
Func Button8Click()
GUICtrlSetData($Button8, $x_o)
klik()
EndFunc   ;==>Button8Click
Func Button9Click()
GUICtrlSetData($Button9, $x_o)
klik()
EndFunc   ;==>Button9Click
Func klik()
$x = $x + 1
EndFunc   ;==>klik
Func exi()
Exit
EndFunc   ;==>exi

Func komputer()
wynik()
GUICtrlSetData($Button1, "o")

If $e1 = "o" Then
	If $e5 = "+" Then
		GUICtrlSetData($Button2, "o")
		klik()
	EndIf

	If $e3 = "+" Then
		GUICtrlSetData($Button7, "o")
		klik()
	EndIf
	If $e4 = "+" Then
		GUICtrlSetData($Button6, "o")
		klik()
	EndIf
	If $e8 = "+" Then
		GUICtrlSetData($Button9, "o")
		klik()
	EndIf
elseif $e1="o" Then
	if $e7="o" Then
			GUICtrlSetData($Button8, "o")
		klik()
	EndIf
	if $e5='o' then
			GUICtrlSetData($Button2, "o")
		klik()
	EndIf
EndIf
EndFunc   ;==>komputer

 

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Opublikowano

Nudziło mi się to napisałem swoją wersję kółka i krzyżyka :P

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Dim $Button[9]
Global $win, $kolej, $side, $pelne

$Options = GUICreate("Opcje", 100, 90)
$Side_O = GUICtrlCreateRadio("Kółko (O)", 5, 5, 50)
$Side_X = GUICtrlCreateRadio("Krzyzyk (X)", 5, 25, 50)
GUICtrlSetState(-1, 1)
$Play = GUICtrlCreateButton("Graj", 10, 50, 80, 30)
GUISetState(@SW_SHOW, $Options)

$Game = GUICreate("Kółko i Krzyzyk - Gra by hfaua", 110, 110)
$Button[0] = GUICtrlCreateButton("", 5, 5, 30, 30)
$Button[1] = GUICtrlCreateButton("", 5, 40, 30, 30)
$Button[2] = GUICtrlCreateButton("", 5, 75, 30, 30)
$Button[3] = GUICtrlCreateButton("", 40, 5, 30, 30)
$Button[4] = GUICtrlCreateButton("", 40, 40, 30, 30)
$Button[5] = GUICtrlCreateButton("", 40, 75, 30, 30)
$Button[6] = GUICtrlCreateButton("", 75, 5, 30, 30)
$Button[7] = GUICtrlCreateButton("", 75, 40, 30, 30)
$Button[8] = GUICtrlCreateButton("", 75, 75, 30, 30)
GUISetState(@SW_HIDE, $Game)

While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
	Exit
Case $Play
	play()
EndSwitch
For $i = 0 to 8
	Select
	Case $msg = $Button[$i]
		check($i)
	EndSelect
Next
WEnd

Func check($id)
If GUICtrlRead($Button[$id]) = "x" Or GUICtrlRead($Button[$id]) = "o" Then
	ToolTip("Nie mozesz zmienić wartosci tego pola...")
Else
	If $kolej Then
		kolko($id)
	Else
		krzyzyk($id)
	EndIf
	$kolej = Not $kolej
EndIf
winner()
EndFunc

Func winner()
;========= PIONOWO =========;
For $i = 0 to 6 Step +3
	If (GUICtrlRead($Button[$i]) = "x" And GUICtrlRead($Button[$i+1]) = "x" And GUICtrlRead($Button[$i+2]) = "x") Then
		$win = 1
	ElseIf (GUICtrlRead($Button[$i]) = "o" And GUICtrlRead($Button[$i+1]) = "o" And GUICtrlRead($Button[$i+2]) = "o") Then
		$win = 2
	EndIf
Next

;========= POZIOMO =========;
For $i = 0 to 2 Step +1
	If (GUICtrlRead($Button[$i]) = "x" And GUICtrlRead($Button[$i+3]) = "x" And GUICtrlRead($Button[$i+6]) = "x") Then
		$win = 1
	ElseIf (GUICtrlRead($Button[$i]) = "o" And GUICtrlRead($Button[$i+3]) = "o" And GUICtrlRead($Button[$i+6]) = "o") Then
		$win = 2
	EndIf
Next

;========= SKOŚNIE =========;
If GUICtrlRead($Button[0]) = "x" And GUICtrlRead($Button[4]) = "x" And GUICtrlRead($Button[8]) = "x" Then
	$win = 1
ElseIf GUICtrlRead($Button[2]) = "o" And GUICtrlRead($Button[4]) = "o" And GUICtrlRead($Button[6]) = "o" Then
	$win = 2
EndIf

;========= CZY WYGRAŁ =========;
If ($win = 1 And $side = 1) Or ($win = 2 And $side = 0) Then
	MsgBox(64, "Wygrałeś!", "Gratulujemy! Wygrałeś w kółko i krzyzyk!")
	game_over()
ElseIf ($win = 1 And $side = 0) Or ($win = 2 And $side = 1) Then
	MsgBox(64, "Przegrałeś!", "Przykro nam, następnym razem będzie lepiej ")
	game_over()
EndIf

;========= CZY PEŁNE =========;
$pelne = 0
For $i = 0 to 8
	If Not GUICtrlRead($Button[$i]) = "" Then
		$pelne += 1
	EndIf
Next
If $pelne = 9 Then game_over()
EndFunc

Func game_over()
If $pelne = 9 Then
	MsgBox(64, "Koniec Gry!", "Gra zakończona remisem.")
EndIf
For $i = 0 to 8
	GUICtrlSetData($Button[$i], "")
Next
GUISetState(@SW_HIDE, $Game)
GUISetState(@SW_SHOW, $Options)
EndFunc

Func kolko($id)
GUICtrlSetData($Button[$id], "o")
EndFunc

Func krzyzyk($id)
GUICtrlSetData($Button[$id], "x")
EndFunc

Func play()
If GUICtrlRead($Side_X) = 1 Then
	$side = 1
Else
	$side = 0
EndIf
GUISetState(@SW_HIDE, $Options)
GUISetState(@SW_SHOW, $Game)
$win = 0
$kolej = 0
$pelne = 0
EndFunc

 

Można wybrać stronę itd. ;)

Chyba dorobię możliwość grania z komputerem :D

Opublikowano

Wlasnie tylko komputera mi brakuje:d ale zabardzo nie rozumiem dzialania tablicy wiec lipa:D

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

  • 3 tygodnie później...
  • 2 miesiące temu...
Opublikowano

Patrz i płacz, amatorze! ;)

 

GUICreate('Literki w konsoli', 200, 200)
GUICtrlSetFont(-1, 12)
GUIRegisterMsg(0x0100, 'keypress')
GUISetState()
ConsoleWrite(@crlf & @CRLF)
Do
Until GuiGetMsg() = -3
ConsoleWrite(@crlf & @CRLF)
Func keypress($q, $w, $e, $r)
ConsoleWrite(Chr(Dec(Hex($e))))
EndFunc

 

Proszę, do usług :] - w pięć minut, najprostsze co może być.

 

wiesz co? nie każdy jest PR0 3l0 programer w autoit a to forum ma pomagać ;) a nie teksty typu: "Patrz i płacz, amatorze!" albo tego typu... ty też nie jesteś jakiś pro w programowaniu... nie jeden z tego forum by Cię rozwalił jakby tylko chciał. Więc nie kozacz tak... takich userów to ja bym banował.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...