Jump to content

Recommended Posts

Posted (edited)

ERROR: $WM_MOUSEMOVE previously declared as a 'Const'

ERROR: $WM_LBUTTONUP previously declared as a 'Const'

in the following code:

#include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <GDIPlus.au3>

If Not IsDeclared("WM_MOUSEMOVE") Then Global $WM_MOUSEMOVE = 0x0200
If Not IsDeclared("WM_LBUTTONDOWN") Then Global $WM_LBUTTONDOWN = 0x0201
If Not IsDeclared("WM_LBUTTONUP") Then Global Const $WM_LBUTTONUP = 0x0202

$picHolder = GUICreate("picHolder",100,100,-1,-1,$WS_POPUP,$WS_EX_TOPMOST)
GUIRegisterMsg($WM_MOUSEMOVE, "WM_MOUSEMOVE")
GUIRegisterMsg($WM_LBUTTONDOWN,"WM_LBUTTONDOWN")
GUIRegisterMsg($WM_LBUTTONUP,"WM_LBUTTONUP")
GUISetState(@SW_SHOW,$picHolder)
$pic = GUICtrlCreatePic("L:\2009-10 Computer Science\AutoIt3\MyWork\smiley-face.jpg",0,0,100,100)

while 1

WEnd

Func WM_MOUSEMOVE()

EndFunc

Func WM_LBUTTONDOWN()
    $aiPrePos = MouseGetPos()
    ConsoleWrite($aiPrePos[0])
    ConsoleWrite($aiPrePos[1])
EndFunc

Func WM_LBUTTONUP()
    $aiPostPos = MouseGetPos()
    ConsoleWrite($aiPostPos[0])
    ConsoleWrite($aiPostPos[1])
EndFunc

Thanks for helping!

Edited by rliiack

My Projects:Smart Icons

Posted

The variables mentioned by the error messages are already declared so you can re-declare them.

Just remove your lines of code declaring those and you'll be fine.

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
×
×
  • Create New...