Posts: 22
Threads: 9
Joined: Oct 2015
str fBmp="$temp$\qm_modi.bmp"
fBmp.expandpath
if(scan("resource:<Macro1>image:h1B7A5E0B" win() r 16|128 100))
if(!CaptureImageOnScreen(r.left r.top r.right-r.left r.bottom-r.top(fBmp))) ret
I tried adding your code into this but it gave me a syntax. But I can't seem to find out where is the error.
This was the original code
str fBmp="$temp$\qm_modi.bmp"
fBmp.expandpath
if(!CaptureImageOnScreen(655 340 85 35(fBmp))) ret
And just wondering it it's possible to restrict running my .exe macro on a single computer only? Don't need it to be professional just don't want it to proliferate after giving it to 1 or 2 person.
Posts: 12,092
Threads: 142
Joined: Dec 2002
r.top is not a function. Did you mean
?
If you know computer name or user name, use function GetUserInfo to get it and exit macro if the name does not match.
Posts: 22
Threads: 9
Joined: Oct 2015
if(scan("image:h1B7A5E0B" w 0 16))
fBmp.expandpath
if(!CaptureImageOnScreen(655 340 85 35(fBmp))) ret
typelib MODI {A5EDEDF4-2BBC-45F3-822B-E60C278A1A79} 12.0
MODI.Document doc._create
doc.Create(fBmp)
doc.OCR(MODI.miLANG_ENGLISH -1 0)
MODI.Image im=doc.Images.Item(0)
s1=im.Layout.Text
'BBBBBBBBBB
key (s1)
if(scan("image:h1B7A5E0B" win() 0 16))
fBmp.expandpath
if(scan("image:h841C7961" win() r 16|128 100))
if(!CaptureImageOnScreen(r.left r.top r.right-r.left r.bottom-r.top fBmp)) ret
typelib MODI {A5EDEDF4-2BBC-45F3-822B-E60C278A1A79} 12.0
MODI.Document doc._create
doc.Create(fBmp)
doc.OCR(MODI.miLANG_ENGLISH -1 0)
MODI.Image im=doc.Images.Item(0)
s1=im.Layout.Text
'BBBBBBBBBB
key (s1)
Changed it but I have a problem with MODI instead. Any clue what is happening?
What do you mean by getuserinfo? I can't seem to find much information in QM Help.
Posts: 22
Threads: 9
Joined: Oct 2015
Nevermind. Found the problem. Still need some tips on GetUserInfo though. Not sure how to use it. Don't really understand QM help
Posts: 12,092
Threads: 142
Joined: Dec 2002
Macro
Macro2749
str pcName userName
GetUserInfo userName
GetUserInfo pcName 1
out userName
out pcName
Posts: 22
Threads: 9
Joined: Oct 2015
I tried adding in IP address too but can't seem to work cause my country uses dynamic IP and the last 2 numbers of the ip keeps changing. Is to possible to change my code to only compare the first part of the ip but not the last 2 characters?