Jump to content

Help Please!


Recommended Posts

Hey, i am making a code so when a gui moves into a place it pops up a message. why isnt the message poping up?

Here is the code:

#include "GUIConstants.au3"

$gui=GUICreate("Take your dog on a walk", 618, 442, 226, 145, -1, $WS_EX_TOOLWINDOW)

$Pic1 = GUICtrlCreatePic(@ScriptDir & "\walk.gif", 0, 0, 617, 441)

$pic=GUICreate("", 49, 57, 5, 350,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui)
$guy = GUICtrlCreatePic(@ScriptDir & "\guyfarward.gif",0,0, 0,0)

$pic2=GUICreate("", 68, 100, 162, 237,$WS_POPUP,BitOr($WS_EX_LAYERED,$WS_EX_MDICHILD),$gui)
$Pic5 = GUICtrlCreatePic(@ScriptDir & "\door.gif", 0, 0, 0, 0)

GUISetState(@SW_SHOW,$pic)
GUISetState(@SW_SHOW,$gui)

HotKeySet("{LEFT}", "left")
HotKeySet("{RIGHT}", "right")
HotKeySet("{DOWN}", "down")
HotKeySet("{UP}", "up")

$picPos = WinGetPos($pic)
$guiPos = WinGetPos($gui)
$pic2pos = WinGetPos ($pic2)


While 1
    $msg = GuiGetMsg()
    
    $picPos = WinGetPos($pic)
    $pic2pos = WinGetPos($pic2)
    
    If $picPos[0] And $picPos[1] = $pic2pos[0] And $pic2pos[1] Then
        MsgBox (0,"hi","hi")
    EndIf
    
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    EndSelect
WEnd
Exit


Func left ()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]-5,$picPos[1])
    GUICtrlSetImage ($guy, @ScriptDir & "\guybackward.gif")
EndFunc

Func right()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0]+5,$picPos[1])
    GUICtrlSetImage ($guy, @ScriptDir & "\guyfarward.gif")
EndFunc

Func down()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]+5)
EndFunc

Func up()
    $picPos = WinGetPos($pic)
    WinMove($pic,"",$picPos[0],$picPos[1]-5)
EndFunc

[center]Kesne's Bar & Grill[/center]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...