Hello Coders

Could some one please help me with this problem. What i have done for quite a while was to not use the include \MASM32\INCLUDE\windows.inc and to this date i founded EVERYTHING that the program use from it and just wrote all of it right under all of my Marco in the asm file. Now i am trying to add this TYPE of Mouse Click Below, but it don't work unless i put the whole include file in it.

So as usual i thought i could find everything that was need but in this case i could not :(

Example:

DLGWINDOWEXTRA equ 30
KEYEVENTF_EXTENDEDKEY equ 1h
KEYEVENTF_KEYUP equ 2h
MOUSEEVENTF_MOVE equ 1h
MOUSEEVENTF_LEFTDOWN equ 2h
MOUSEEVENTF_LEFTUP equ 4h
MOUSEEVENTF_RIGHTDOWN equ 8h
MOUSEEVENTF_RIGHTUP equ 10h
MOUSEEVENTF_MIDDLEDOWN equ 20h
MOUSEEVENTF_MIDDLEUP equ 40h
MOUSEEVENTF_WHEEL equ 800h
MOUSEEVENTF_ABSOLUTE equ 8000h

MOUSE_MOVED equ 1h
DOUBLE_CLICK equ 2h
KEY_EVENT equ 1h

; ..................................................... COORD
COORD STRUCT
x WORD ?
y WORD ?
COORD ENDS

; ..................................................... MOUSE_EVENT_RECORD STRUCT
mouse_event equ 2h
mouse_eventC equ 2h

I tried changing this to mouse_eventC (still did'nt work) . Window.inc it is recoded as mouse_eventC but in the example
file it just say mouse_event and it has no problem working ever.


MOUSE_EVENT_RECORD STRUCT
dwMousePosition COORD <>
dwButtonState DWORD ?
dwControlKeyState DWORD ?
dwEventFlags DWORD ?
MOUSE_EVENT_RECORD ENDS


.const

x_a01 DWORD 600
y_a01 DWORD 48


.code

; ........................ SetCursorPos
PUSH y_a01
PUSH x_a01
CALL __user__SetCursorPos
; ........................ LEFT DOWN
PUSH 0
PUSH 0
PUSH 0
PUSH 0
PUSH MOUSEEVENTF_LEFTDOWN
CALL mouse_event
; ........................ LEFT UP
PUSH 0
PUSH 0
PUSH 0
PUSH 0
PUSH MOUSEEVENTF_LEFTUP
CALL mouse_event

Something is missing because it do not work as usual. I thought TypeDef stuff was needed but i don't think so.
I got to say when they wrote the Windows.inc file for masm32 i know they must have went through a lot it because things got to be in the right places such as as you see above COORD STRUCT has to be over MOUSE_EVENT_RECORD STRUCT or it will not work. I know all of the Constance above is not needed but this is all of what i ended up with and according to the call it don't SEEM to be missing anything but it does.

error A2076: jump destination must specify a label

error A2076: jump destination must specify a label


Thanks in advance
Posted on 2002-12-01 13:21:53 by cmax
Cmax, what are you doing? i have alot to learn
about assembly. But dont you get the error because
youre just trying to call up a label\location? and not a api function?

Either im terribly confused OR youre calling an address wich equals
'2h'. How can you excpect to make an api call by doing so?
Posted on 2002-12-01 13:52:40 by natas
:)
Posted on 2002-12-01 17:00:36 by cmax
Cmax, I know who he is. He is now known as the 'NOP-erator'. ( :) )
After checking my source code archive (just about 1000 source codes)
I found the whole thing(it's also located on his webpage).

Anyways, im going to check it out. See if i can get your code working. :alright:
Please remove all that "junk"? the users can get it from his homepage instead
if theyre interested. ;)
Posted on 2002-12-01 17:14:28 by natas
I knew everyone knew him....Here is my example that was broken down from the code above.... But remember i am not using windows.inc in one of my program only the constants .... That's where my problem is... Now i am going back to delete the above because it may be a space waster. This work all day long . if it don't please let me know...


.386
.MODEL FLAT,STDCALL
option casemap:none

include \MASM32\INCLUDE\windows.inc

include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc

includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib


.DATA

x_01 dd 100
y_01 dd 100


.CODE
start:



PUSH y_01
PUSH x_01
CALL SetCursorPos

invoke mouse_event, MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
invoke mouse_event, MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

invoke ExitProcess, 0




end start
-------------------------
Posted on 2002-12-01 17:27:20 by cmax
Cmax, those contants you where fooling around with(mouse_event/C).
The reason why they have declared it as 'mouse_eventC' is to avoid any
redefintions/problems with the 'mouse_event' api definitions. Even tho I
dont quite understand the usage for that specific constant.

What made you believe that it was so complicated? OR is there something
im missing?


Anyway, the example below works 100% without the use of 'Windows.inc'.
Why shouldnt it work? all it does is calling an api.( :) )
[color=sienna].386

.MODEL FLAT,STDCALL
option casemap:none
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib

SetCursorPos PROTO :DWORD,:DWORD
mouse_event PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
ExitProcess PROTO :DWORD

MOUSEEVENTF_RIGHTDOWN equ 8h
MOUSEEVENTF_RIGHTUP equ 10h
mouse_eventC equ 2h
.DATA
x_01 dd 100
y_01 dd 100
.CODE
start:
PUSH y_01
PUSH x_01
CALL SetCursorPos

xor eax,eax
PUSH eax
PUSH eax
PUSH eax
PUSH eax
PUSH MOUSEEVENTF_RIGHTDOWN
CALL mouse_event

PUSH eax
PUSH eax
PUSH eax
PUSH eax
PUSH MOUSEEVENTF_RIGHTUP
CALL mouse_event

CALL ExitProcess
end start[/color]
Posted on 2002-12-01 17:43:11 by natas
You'll right, I did not know it was in User.inc. I thought i checked it but must had not. So when i founded it in the Window.inc i thought my search was over.

Than i start switching things up from the Window.inc to app and got confussed because i did not under stand what that mouse_eventC had to do with it.

When i founded mouse_event in Window.inc i thought that it must had something special in the file somewhere else that make it work. So after a while i did not even think it was an API anymore

Thanks alot natas

Posted on 2002-12-01 20:49:44 by cmax