Sign in to follow this  
Followers 0
rasim

Find Image

12 posts in this topic

#1 ·  Posted (edited)

Hello All! Allow to present your attentions is little game - Find Image. :)

Please, if somebody found free time, see source code and message me about errors and bugs. In the same way, if somebody have any offer for improvement code, message me. ;)

#include <GUIConstantsEx.au3>
#include <GuiToolBar.au3>
#include <GuiImageList.au3>
#include <GuiToolTip.au3>
#include <Array.au3>
#include <Date.au3>
#include <BassMod.au3>

Opt("GuiOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

HotKeySet("^h", "HideProgram")

Global $pTimerProc, $uiTimer, $Button1, $Button2, $Flag, $Count

Global $ButtonArray[25]
$ButtonArray[0] = 24

Global $iItem
Dim Enum $ID_Start = 1000, $ID_Options, $Id_Hide, $Id_About, $ID_Exit
Dim $ToolBar_Strings[5]

Global $sTimer, $hour, $min, $sec, $begin, $time, $State, $check
Global $cross, $score, $Bk_Pic = @TempDir & "\back.jpg"

FileInstall("C:\Game\cover.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\1.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\2.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\3.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\4.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\5.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\6.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\7.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\8.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\9.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\10.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\11.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\12.bmp", @TempDir & "\", 1)
FileInstall("C:\Game\back.jpg", @TempDir & "\", 1)
FileInstall("C:\Game\car.jpg", @TempDir & "\", 1)
FileInstall("C:\Game\Nature.jpg", @TempDir & "\", 1)
FileInstall("C:\Game\Abe.jpg", @TempDir & "\", 1)
FileInstall("C:\Game\bassmod.dll", @TempDir & "\", 1)
FileInstall("C:\Game\sound.mod", @TempDir & "\", 1)
FileInstall("C:\Game\exit.ico", @TempDir & "\", 1)
FileInstall("C:\Game\options.ico", @TempDir & "\", 1)
FileInstall("C:\Game\start.ico", @TempDir & "\", 1)
FileInstall("C:\Game\hide.ico", @TempDir & "\", 1)
FileInstall("C:\Game\help.ico", @TempDir & "\", 1)
FileInstall("c:\Game\tada.mp3", @TempDir & "\", 1)

;Main GUI
;====================================================================================================================
$hGui = GUICreate("Find Image!", 600, 450, -1, -1, $WS_BORDER, $WS_EX_CLIENTEDGE+$WS_EX_TOOLWINDOW+$WS_EX_APPWINDOW)
$pic = GUICtrlCreatePic($Bk_Pic, 0, 31, 600, 370)
GUICtrlSetState(-1, $GUI_DISABLE)

$hToolbar = _GUICtrlToolbar_Create($hGui, BitOR($BTNS_BUTTON, $TBSTYLE_LIST), $TBSTYLE_EX_DRAWDDARROWS)

$hToolTip = _GUIToolTip_Create($hToolbar, $TTS_ALWAYSTIP)

$hImage = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($hImage, @TempDir & "\start.ico")
_GUIImageList_AddIcon($hImage, @TempDir & "\options.ico")
_GUIImageList_AddIcon($hImage, @TempDir & "\hide.ico")
_GUIImageList_AddIcon($hImage, @TempDir & "\help.ico")
_GUIImageList_AddIcon($hImage, @TempDir & "\exit.ico")

_GUICtrlToolbar_SetToolTips($hToolbar, $hToolTip)
_GUICtrlToolbar_SetImageList($hToolbar, $hImage)

$ToolBar_Strings[0] = _GUICtrlToolbar_AddString($hToolbar, "Start")
$ToolBar_Strings[1] = _GUICtrlToolbar_AddString($hToolbar, "Options")
$ToolBar_Strings[2] = _GUICtrlToolbar_AddString($hToolbar, "Hide")
$ToolBar_Strings[3] = _GUICtrlToolbar_AddString($hToolbar, "About")
$ToolBar_Strings[4] = _GUICtrlToolbar_AddString($hToolbar, "Exit")

_GUICtrlToolbar_AddButtonSep($hToolbar, 10)
_GUICtrlToolbar_AddButton($hToolbar, $ID_Start, 0, $ToolBar_Strings[0])
_GUICtrlToolbar_AddButtonSep($hToolbar, 10)
_GUICtrlToolbar_AddButton($hToolbar, $ID_Options, 1, $ToolBar_Strings[1])
_GUICtrlToolbar_AddButtonSep($hToolbar, 10)
_GUICtrlToolbar_AddButton($hToolbar, $Id_Hide, 2, $ToolBar_Strings[2])
_GUICtrlToolbar_AddButtonSep($hToolbar, 10)
_GUICtrlToolbar_AddButton($hToolbar, $Id_About, 3, $ToolBar_Strings[3])
_GUICtrlToolbar_AddButtonSep($hToolbar, 10)
_GUICtrlToolbar_AddButton($hToolbar, $Id_Exit, 4, $ToolBar_Strings[4])

_GUICtrlToolbar_SetStyleFlat($hToolBar, True)

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

$Border_Label = GUICtrlCreateLabel("-", 0, 400, 600, 3, $SS_SUNKEN)
$Sep_Label1 = GUICtrlCreateLabel("", 207, 406, 1, 20, $SS_SUNKEN)
$Sep_Label1 = GUICtrlCreateLabel("", 386, 406, 1, 20, $SS_SUNKEN)

$labelTime = GUICtrlCreateLabel("Time elapsed: 00:00:00", 36, 410, 115, 16)
GUICtrlSetColor(-1, 0x800000)
$labelCross = GUICtrlCreateLabel("Card crossovered: 0", 250, 410, 115, 16)
GUICtrlSetColor(-1, 0x800000)
$labelScore = GUICtrlCreateLabel("Game score: 0", 490, 410, 115, 16)
GUICtrlSetColor(-1, 0x800000)

$Tray_Restore = TrayCreateItem("Restore")
TrayItemSetOnEvent(-1, "TrayEvent")
TrayCreateItem("")
$Tray_Exit = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1, "TrayEvent")

TraySetClick(16)

;Child GUI
;=============================================================================================================
$child = GUICreate("Options", 315, 452, -1, -1, $WS_POPUPWINDOW, -1, $hGui)

$Pic1 = GUICtrlCreatePic(@TempDir & "\Car.jpg", 150, 30, 150, 110, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetState(-1, $GUI_DISABLE)

$Pic2 = GUICtrlCreatePic(@TempDir & "\Nature.jpg", 150, 158, 150, 110, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetState(-1, $GUI_DISABLE)

$Pic3 = GUICtrlCreatePic(@TempDir & "\Abe.jpg", 150, 285, 150, 110, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetState(-1, $GUI_DISABLE)

$Group1 = GUICtrlCreateGroup("Select pictures", 8, 8, 300, 400)

$Radio1 = GUICtrlCreateRadio("Car", 20, 64, 105, 33)
GUICtrlSetCursor (-1, 0)

$Radio2 = GUICtrlCreateRadio("Nature", 20, 200, 105, 25)
GUICtrlSetCursor (-1, 0)

$Radio3 = GUICtrlCreateRadio("Abe", 20, 340, 105, 17)
GUICtrlSetCursor (-1, 0)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUICtrlCreateLabel("Select difficulty", 20, 410, 100, 15)
$combo = GUICtrlCreateCombo("Easy", 20, 425, 100, 20, $CBS_DROPDOWNLIST)
GUICtrlSetCursor(-1, 0)
GUICtrlSetData(-1, "Normal|Hard")

$optBtn = GUICtrlCreateButton("Ok", 260, 424, 50, 25)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "OptionEvent")

$chkBox = GUICtrlCreateCheckbox("Mute music", 150, 426, 100, 20)
;=============================================================================================================

GUISetState(@SW_SHOW, $hGui)

_BassMod(@TempDir & "\bassmod.dll", @TempDir & "\sound.mod", BitOR($BASS_MUSIC_SURROUND, $BASS_MUSIC_LOOP))

While 1
    Dis_En_Tray_Item()
    Sleep(100)
WEnd


;Functions
;==============================================================================================================
Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
    Local $tNMTOOLBAR, $hwndFrom, $iCode, $iItem, $tInfo
    
    $tNMTOOLBAR = DllStructCreate($tagNMTOOLBAR, $lParam)
    $hwndFrom = DllStructGetData($tNMTOOLBAR, "hWndFrom")
    $iCode = DllStructGetData($tNMTOOLBAR, "Code")
    $iItem = DllStructGetData($tNMTOOLBAR ,"iItem")
    
    $tInfo = DllStructCreate($tagNMTTDISPINFO, $lParam)
    
    Switch $hwndFrom
    Case $hToolbar
        Switch $iCode
        Case $NM_LDOWN
            Switch $iItem
            Case $ID_Start
                SetImg()
                Return
            Case $ID_Options
                GUISetState(@SW_DISABLE, $hGui)
                GUISetState(@SW_SHOW, $child)
            Case $Id_Hide
                HideProgram()
                Return
            Case $Id_About
                About()
                Return
            Case $ID_Exit
                Exit
            EndSwitch
        EndSwitch
    
    Case $hToolTip
        Switch $iCode
        Case $TTN_GETDISPINFO
            $iID = DllStructGetData($tInfo, "IDFrom")
            Switch $iID
            Case $ID_Start
                DllStructSetData($tInfo, "aText", "Start new game")
            Case $ID_Options
                DllStructSetData($tInfo, "aText", "Change game options")
            Case $Id_Hide
                DllStructSetData($tInfo, "aText", "Hide game in tray, Ctrl + H")
            Case $Id_About
                DllStructSetData($tInfo, "aText", "About program")
            Case $ID_Exit
                DllStructSetData($tInfo, "aText", "Close game")
            EndSwitch
        EndSwitch
    EndSwitch
    
    Return $GUI_RUNDEFMSG
EndFunc

Func SetImg()
    GUISwitch($hGui)
    Global $Temp_Array1[12]
    Global $Temp_Array2[12]
    
    $Temp_Array1 = RandomArray()
    $Temp_Array2 = RandomArray()
    
    Global $Img_Array[1]
    $Img_Array[0] = 24
    For $i = 0 To 11
        _ArrayAdd($Img_Array, @TempDir &"\"& $Temp_Array1[$i] & ".bmp")
        _ArrayAdd($Img_Array, @TempDir &"\"& $Temp_Array2[$i] & ".bmp")
    Next
    
    Local $level = GUICtrlRead($combo), $i
    Local $delay, $i
    
    Switch $level
    Case "normal"
        $delay = 60
    Case "hard"
        $delay = 30
    Case Else
        $delay = 90
    EndSwitch
    
    Local $btnXcoord = -55, $btnYcoord = 40
    
    $score = 0
    $cross = 0
    $begin = TimerInit()
    
    If CheckEnd() Then
        For $i = 1 To $ButtonArray[0]
            GUICtrlDelete($ButtonArray[$i])
        Next
    EndIf
    
    For $i = 1 To $ButtonArray[0]
        Switch $i
        Case 7
            $btnXcoord = -55
            $btnYcoord += 90
        Case 13
            $btnXcoord = -55
            $btnYcoord += 90
        Case 19
            $btnXcoord = -55
            $btnYcoord += 90
        EndSwitch
        
        $btnXcoord += 90
        $ButtonArray[$i] = GUICtrlCreateCheckbox("", $btnXcoord, $btnYcoord, 75, 75, BitOR($BS_BITMAP, $BS_PUSHLIKE, $BS_FLAT), $WS_EX_DLGMODALFRAME)
        GUICtrlSetCursor(-1, 0)
        GUICtrlSetOnEvent(-1, "CheckBtn")
        GUICtrlSetImage(-1, @TempDir & "\cover.bmp")
    Next
    $check = True
    
    GUICtrlSetData($labelTime, "Time elapsed 00:00:00")
    GUICtrlSetData($labelCross, "Card crossovered: 0")
    GUICtrlSetData($labelScore, "Game score: 0")
    
    WinSetState($hGui, "", @SW_DISABLE)
    TraySetState(2)

    For $i = 1 To $ButtonArray[0]
        GUICtrlSetImage($ButtonArray[$i], $Img_Array[$i])
        GUICtrlSetData($ButtonArray[$i], $Img_Array[$i])
        Sleep($delay)
    Next
        
    For $i = 1 To $ButtonArray[0]
        GUICtrlSetImage($ButtonArray[$i], @TempDir & "\cover.bmp")
        Sleep($delay)
    Next
    
    WinSetState($hGui, "", @SW_ENABLE)
    TraySetState(1)
    AdlibEnable("SetTime", 500)
EndFunc

Func CheckBtn()
    If $uiTimer Then
        If BitAND(GUICtrlRead(@GUI_CtrlId), $GUI_CHECKED) Then GUICtrlSetState(@GUI_CtrlId, $GUI_UNCHECKED)
            Return
        EndIf
            
    Local $Check_Array[1], $i
    $cross += 1
    
    GUICtrlSetData($labelCross, "Card crossovered: " & $cross)
    GUICtrlSetData($labelScore, "Game score: " & $score)
    
    If BitAND(GUICtrlRead(@GUI_CtrlId), $GUI_UNCHECKED) Then
        For $i = 1 To $ButtonArray[0]
            If BitAND(GUICtrlRead($ButtonArray[$i]), $GUI_CHECKED) And $ButtonArray[$i] <> @GUI_CtrlId Then _
                GUICtrlSetImage($ButtonArray[$i], @TempDir & "\cover.bmp")
                GUICtrlSetState($ButtonArray[$i], $GUI_UNCHECKED)
                GUICtrlSetState(@GUI_CtrlId, $GUI_CHECKED)
            Next
            Return
        EndIf
    
    For $i = 1 To $ButtonArray[0]
        If BitAND(GUICtrlRead($ButtonArray[$i]), $GUI_CHECKED) Then
            GUICtrlSetImage($ButtonArray[$i], GUICtrlRead($ButtonArray[$i], 1))
            _ArrayAdd($Check_Array, $ButtonArray[$i])
        EndIf
    Next
    
    Switch UBound($Check_Array) -1
    Case 2
        If GUICtrlRead($Check_Array[1], 1) = GUICtrlRead($Check_Array[2], 1) Then
            GUISetState(@SW_DISABLE, $hGui)
            $Count = 0
            $Button1 = $Check_Array[1]
            $Button2 = $Check_Array[2]
            
            For $i = 1 To UBound($Check_Array) -1
                GUICtrlSetState($Check_Array[$i], $GUI_UNCHECKED)
            Next
            
            DllCallBack()
            
            GUISetState(@SW_ENABLE, $hGui)
            $score += 10
            GUICtrlSetData($labelScore, "Game score: " & $score)
        Else
            $score -= 1
        EndIf
    Case 3
        For $i = 1 To UBound($Check_Array) -1
            If $Check_Array[$i] <> @GUI_CtrlId Then
                GUICtrlSetImage($Check_Array[$i], @TempDir & "\cover.bmp")
                GUICtrlSetState($Check_Array[$i], $GUI_UNCHECKED)
            EndIf
        Next
    EndSwitch
EndFunc
        
Func OptionEvent()
    Switch @GUI_CtrlId
    Case $optBtn
        GUISetState(@SW_ENABLE, $hGui)
        GUISetState(@SW_HIDE, $child)
        
        For $Bk_Image = $Radio1 To $Radio3
            If GUICtrlRead($Bk_Image) = $GUI_CHECKED Then
                GUICtrlSetState($Bk_Image, $GUI_UNCHECKED)
                GUICtrlSetImage($pic, @TempDir &"\"& GUICtrlRead($Bk_Image, 1) & ".jpg")
                GUICtrlSetState($pic, $GUI_DISABLE)
                ExitLoop
            EndIf
        Next
        
        If GUICtrlRead($chkBox) = $GUI_CHECKED Then
            _BassModClose()
        Else
            _BassMod(@TempDir & "\bassmod.dll", @TempDir & "\sound.mod", BitOR($BASS_MUSIC_SURROUND, $BASS_MUSIC_LOOP))
        EndIf
    EndSwitch
EndFunc

Func TrayEvent()
    Switch @TRAY_ID
    Case $Tray_Restore
        If Not BitAND(WinGetState($hGui), 2) Then
            GUISetState(@SW_SHOW, $hGui)
            _BassModPlay()
        EndIf
    Case $Tray_Exit
        Exit
    EndSwitch
EndFunc
        
Func SetTime()
    _TicksToTime(Int(TimerDiff($begin)), $hour, $min, $sec)
    $time = StringFormat("%02i:%02i:%02i", $hour, $min, $sec)
    GUICtrlSetData($labelTime, "Time elapsed: " & $time)
EndFunc

Func RandomArray()
    Local $retArray[12], $i
    For $i = 0 To UBound($retArray) -1
        While 1
            $number = Random(1, 12, 1)
            $search = _ArraySearch($retArray, $number)
            If @error Then ExitLoop
            WEnd
            $retArray[$i] = $number
        Next
        Return $retArray
    EndFunc
    
Func CheckEnd()
    Local $i
    For $i = 1 To $ButtonArray[0]
        If GUICtrlGetState($ButtonArray[$i]) = 80 Then Return 1
        Next
    EndFunc
    
Func HideProgram()
    If BitAND(WinGetState($hGui), 2) Then
        GUISetState(@SW_HIDE, $hGui)
        _BassModPause()
        If BitAND(WinGetState($child), 2) Then
            GUISetState(@SW_HIDE, $child)
            GUISetState(@SW_ENABLE, $hGui)
        EndIf
    Else
        GUISetState(@SW_SHOW, $hGui)
        _BassModPlay()
    EndIf
EndFunc

Func Dis_En_Tray_Item()
    If BitAND(WinGetState($hGui), 2) And $State = 0 Then
        TrayItemSetState($Tray_Restore, $TRAY_DISABLE)
        $State = 1
    ElseIf Not BitAND(WinGetState($hGui), 2) And $State = 1 Then
        TrayItemSetState($Tray_Restore, $TRAY_ENABLE)
        $State = 0
    EndIf
EndFunc

Func About()
    GUISetState(@SW_DISABLE, $hGui)
    MsgBox(64, "About program", "Find Image! - is developping and entertaining game!" & @CRLF & @CRLF & _
    "Idea and some resources by Microsoft Windows Vista" & @CRLF & @CRLF & _
    "Autor: Rasim Gilmanov (aka rasim)" & @CRLF & _
    "ICQ: 256733504")
    GUISetState(@SW_ENABLE, $hGui)
    GUISetState(@SW_RESTORE, $hGui)
EndFunc

Func DllCallBack()
    $pTimerProc = DllCallbackRegister("Semaphore", "int", "")
    $uiTimer = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 200, "ptr", DllCallbackGetPtr($pTimerProc))
    $uiTimer = $uiTimer[0]
EndFunc

Func Semaphore()
    $Flag = Not $Flag
    If $Flag Then
        $Count += 1
        GUICtrlSetState($Button1, $GUI_SHOW)
        GUICtrlSetState($Button2, $GUI_SHOW)
    Else
        GUICtrlSetState($Button1, $GUI_HIDE)
        GUICtrlSetState($Button2, $GUI_HIDE)
    EndIf
    If $Count = 3 Then
        GUICtrlDelete($Button1)
        GUICtrlDelete($Button2)
        DllCallbackFree($pTimerProc)
        DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $uiTimer)
        $uiTimer = ''
        
        If Not CheckEnd() Then
            AdlibDisable()
            Sleep(300)
            Local $EndTime = Int(TimerDiff($begin)) / 1024
            $EndTime = Round($EndTime)
            $score *= 10
            $score = ($score - $EndTime) - $cross
            If $score < 0 Then $score = 0
                SoundPlay(@TempDir & "\tada.mp3")
                MsgBox(64, "Congratulations", "You win! Your scores is " & $score)
                EndIf
            EndIf
        EndFunc

Func OnAutoItExit()
    _BassModClose()
    Local $TrashArray[25] = ["1.bmp", "2.bmp", "3.bmp", "4.bmp", "5.bmp", "6.bmp", "7.bmp", "8.bmp", _
    "9.bmp", "10.bmp", "11.bmp", "12.bmp", "cover.bmp", "back.jpg", "car.jpg", "nature.jpg", "abe.jpg", _
    "bassmod.dll", "sound.mod", "exit.ico", "hide.ico", "options.ico", "start.ico", "help.ico", "tada.mp3"]
    
    For $i = 0 To UBound($TrashArray) -1
        FileDelete(@TempDir &"\"& $TrashArray[$i])
    Next
EndFunc

Source

Compiled to exe

Edited by rasim

Share this post


Link to post
Share on other sites



#4 ·  Posted (edited)

TzarAlkex

You do know that "Purble Place" is a kids game that comes with Windows Vista?

Oops! :"> I did not be aware of this. My frend give me idea and game name. I jast realize this idea. :) Edited by rasim

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

JamesB' date='Dec 24 2007, 03:11 PM'

The images are not working and

What image not working?

I see no bassmod dll

Place UDF BassModd.au3 to "Program Files\AutoIt3\Include"

Stop! You downloading source? All what need in this archive.

Edited by rasim

Share this post


Link to post
Share on other sites

C:\Program Files\AutoIt3\Include\WinAPI.au3(562,70) : WARNING: $GENERIC_EXECUTE: possibly used before declaration.

If BitAND($iAccess, 1) <> 0 Then $iDA = BitOR($iDA, $GENERIC_EXECUTE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(563,67) : WARNING: $GENERIC_READ: possibly used before declaration.

If BitAND($iAccess, 2) <> 0 Then $iDA = BitOR($iDA, $GENERIC_READ)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(564,68) : WARNING: $GENERIC_WRITE: possibly used before declaration.

If BitAND($iAccess, 4) <> 0 Then $iDA = BitOR($iDA, $GENERIC_WRITE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(566,71) : WARNING: $FILE_SHARE_DELETE: possibly used before declaration.

If BitAND($iShare, 1) <> 0 Then $iSM = BitOR($iSM, $FILE_SHARE_DELETE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(567,69) : WARNING: $FILE_SHARE_READ: possibly used before declaration.

If BitAND($iShare, 2) <> 0 Then $iSM = BitOR($iSM, $FILE_SHARE_READ)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(568,70) : WARNING: $FILE_SHARE_WRITE: possibly used before declaration.

If BitAND($iShare, 4) <> 0 Then $iSM = BitOR($iSM, $FILE_SHARE_WRITE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(572,22) : WARNING: $CREATE_NEW: possibly used before declaration.

$iCD = $CREATE_NEW

~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(574,25) : WARNING: $CREATE_ALWAYS: possibly used before declaration.

$iCD = $CREATE_ALWAYS

~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(576,25) : WARNING: $OPEN_EXISTING: possibly used before declaration.

$iCD = $OPEN_EXISTING

~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(578,23) : WARNING: $OPEN_ALWAYS: possibly used before declaration.

$iCD = $OPEN_ALWAYS

~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(580,29) : WARNING: $TRUNCATE_EXISTING: possibly used before declaration.

$iCD = $TRUNCATE_EXISTING

~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(583,81) : WARNING: $FILE_ATTRIBUTE_ARCHIVE: possibly used before declaration.

If BitAND($iAttributes, 1) <> 0 Then $iFA = BitOR($iFA, $FILE_ATTRIBUTE_ARCHIVE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(584,80) : WARNING: $FILE_ATTRIBUTE_HIDDEN: possibly used before declaration.

If BitAND($iAttributes, 2) <> 0 Then $iFA = BitOR($iFA, $FILE_ATTRIBUTE_HIDDEN)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(585,82) : WARNING: $FILE_ATTRIBUTE_READONLY: possibly used before declaration.

If BitAND($iAttributes, 4) <> 0 Then $iFA = BitOR($iFA, $FILE_ATTRIBUTE_READONLY)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(586,80) : WARNING: $FILE_ATTRIBUTE_SYSTEM: possibly used before declaration.

If BitAND($iAttributes, 8) <> 0 Then $iFA = BitOR($iFA, $FILE_ATTRIBUTE_SYSTEM)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(914,24) : WARNING: $DI_MASK: possibly used before declaration.

$iOptions = $DI_MASK

~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(916,25) : WARNING: $DI_IMAGE: possibly used before declaration.

$iOptions = $DI_IMAGE

~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(918,26) : WARNING: $DI_NORMAL: possibly used before declaration.

$iOptions = $DI_NORMAL

~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(920,26) : WARNING: $DI_COMPAT: possibly used before declaration.

$iOptions = $DI_COMPAT

~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(922,31) : WARNING: $DI_DEFAULTSIZE: possibly used before declaration.

$iOptions = $DI_DEFAULTSIZE

~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(924,28) : WARNING: $DI_NOMIRROR: possibly used before declaration.

$iOptions = $DI_NOMIRROR

~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1043,52) : WARNING: $DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1044,47) : WARNING: $DISPLAY_DEVICE_PRIMARY_DEVICE: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_PRIMARY_DEVICE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1045,49) : WARNING: $DISPLAY_DEVICE_MIRRORING_DRIVER: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_MIRRORING_DRIVER)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1046,47) : WARNING: $DISPLAY_DEVICE_VGA_COMPATIBLE: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_VGA_COMPATIBLE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1047,42) : WARNING: $DISPLAY_DEVICE_REMOVABLE: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_REMOVABLE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1048,44) : WARNING: $DISPLAY_DEVICE_MODESPRUNED: possibly used before declaration.

If BitAND($iN, $DISPLAY_DEVICE_MODESPRUNED)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1128,44) : WARNING: $GW_CHILD: possibly used before declaration.

$hWnd = _WinAPI_GetWindow($hWnd, $GW_CHILD)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1134,48) : WARNING: $GW_HWNDNEXT: possibly used before declaration.

$hWnd = _WinAPI_GetWindow($hWnd, $GW_HWNDNEXT)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1405,72) : WARNING: $FLASHW_CAPTION: possibly used before declaration.

If BitAND($iFlags, 1) <> 0 Then $iMode = BitOR($iMode, $FLASHW_CAPTION)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1406,69) : WARNING: $FLASHW_TRAY: possibly used before declaration.

If BitAND($iFlags, 2) <> 0 Then $iMode = BitOR($iMode, $FLASHW_TRAY)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1407,70) : WARNING: $FLASHW_TIMER: possibly used before declaration.

If BitAND($iFlags, 4) <> 0 Then $iMode = BitOR($iMode, $FLASHW_TIMER)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(1408,74) : WARNING: $FLASHW_TIMERNOFG: possibly used before declaration.

If BitAND($iFlags, 8) <> 0 Then $iMode = BitOR($iMode, $FLASHW_TIMERNOFG)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(2062,51) : WARNING: $FORMAT_MESSAGE_FROM_SYSTEM: possibly used before declaration.

_WinAPI_FormatMessage($FORMAT_MESSAGE_FROM_SYSTEM,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(3467,71) : WARNING: $TOKEN_ADJUST_PRIVILEGES: possibly used before declaration.

$hToken = _Security__OpenThreadTokenEx(BitOR($TOKEN_ADJUST_PRIVILEGES,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(3467,85) : WARNING: $TOKEN_QUERY: possibly used before declaration.

$hToken = _Security__OpenThreadTokenEx(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(3974,33) : WARNING: $WM_SETFONT: possibly used before declaration.

_SendMessage($hWnd, $WM_SETFONT,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(4389,68) : WARNING: $LOGPIXELSY: possibly used before declaration.

$TwipsPerPixelY = 1440 / _WinAPI_GetDeviceCaps($lngDC, $LOGPIXELSY)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ToolbarConstants.au3(123,54) : WARNING: $CCM_GETCOLORSCHEME: possibly used before declaration.

Global Const $TB_GETCOLORSCHEME = $CCM_GETCOLORSCHEME

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ToolbarConstants.au3(124,54) : WARNING: $CCM_SETCOLORSCHEME: possibly used before declaration.

Global Const $TB_SETCOLORSCHEME = $CCM_SETCOLORSCHEME

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ToolbarConstants.au3(125,58) : WARNING: $CCM_SETUNICODEFORMAT: possibly used before declaration.

Global Const $TB_SETUNICODEFORMAT = $CCM_SETUNICODEFORMAT

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ToolbarConstants.au3(126,58) : WARNING: $CCM_GETUNICODEFORMAT: possibly used before declaration.

Global Const $TB_GETUNICODEFORMAT = $CCM_GETUNICODEFORMAT

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\ToolbarConstants.au3(127,54) : WARNING: $CCM_SETWINDOWTHEME: possibly used before declaration.

Global Const $TB_SETWINDOWTHEME = $CCM_SETWINDOWTHEME

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\GuiToolBar.au3(1968,87) : WARNING: $LR_LOADFROMFILE: possibly used before declaration.

$hBitmap = _WinAPI_LoadImage(0, $sFileName, 0, $aSize[1], $aSize[0], $LR_LOADFROMFILE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\GuiToolBar.au3(2000,72) : WARNING: $HINST_COMMCTRL: possibly used before declaration.

Return _SendMessage($hWnd, $TB_LOADIMAGES, $iBitMapID, $HINST_COMMCTRL)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\GuiImageList.au3(130,55) : WARNING: $IMAGE_BITMAP: possibly used before declaration.

$hImage = _WinAPI_LoadImage(0, $sImage, $IMAGE_BITMAP,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3(93,26) : WARNING: $WM_NOTIFY: possibly used before declaration.

GUIRegisterMsg($WM_NOTIFY,

~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3(177,17) : WARNING: $NM_LDOWN: possibly used before declaration.

Case $NM_LDOWN

~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\WinAPI.au3(562,70) : ERROR: $GENERIC_EXECUTE: undeclared global variable.

If BitAND($iAccess, 1) <> 0 Then $iDA = BitOR($iDA, $GENERIC_EXECUTE)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3(454,58) : ERROR: DllCallbackRegister(): undefined function.

$pTimerProc = DllCallbackRegister("Semaphore", "int", "")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3(455,125) : ERROR: DllCallbackGetPtr(): undefined function.

$uiTimer = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 200, "ptr", DllCallbackGetPtr($pTimerProc)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3(472,30) : ERROR: DllCallbackFree(): undefined function.

DllCallbackFree($pTimerProc)

~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Owner\Desktop\Source\Game\PurblePlace.au3 - 4 error(s), 48 warning(s)

Have Fun...

Just compile a version for people...


[center][/center]

Share this post


Link to post
Share on other sites

DBak

Have Fun...

In Autoit v3.2.10.0 all work correct. :P

Just compile a version for people...

A know, but after compiling code, program work incorrect on another computers(some image not work), if i install Autoit v3.2.10.0 to another computer and run script, all works correct, why? :)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Ok, i`m debugging script, and now script work correct! Also attached compiled script. See first post. :)

P.S. Waiting for your estimation... :P

Edited by rasim

Share this post


Link to post
Share on other sites

Jex

Still give error

:) I don`t understand why error occured? I tested compiled script on 3 another computers and not have errors. You tested compiled script?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0