按鍵精靈”一鍵獲取當前滑鼠的座標和顏色”語句是什麼

2021-07-28 04:08:21 字數 4789 閱讀 3175

1樓:匿名使用者

vbscall call setcursorposvbscall call setcursorpos(cursorx,cursory) '這個函式用來設定滑鼠當前位置

vbscall call getcursorpos這個功能允許您得到當前滑鼠所在的位置,並儲存在變數中格式vbscall call getcursorpos(x,y)x和y都是整數型變數,分別表示當前滑鼠的x和y座標您可以隨便取變數名,不一定是x和y

例子vbscall call getcursorpos(mx,my) 把當前滑鼠位置的x和y座標放在變數mx和my中

************************給我加分呀*********************

2樓:匿名使用者

試試這樣:

module1:

option explicit

public declare function getkeyboardstate& lib "user32" (pbkeystate as byte)

public declare function getkeynametext& lib "user32" alias "getkeynametexta" (byval lparam as long, byval lpbuffer as string, byval nsize as long)

public declare function mapvirtualkey& lib "user32" alias "mapvirtualkeya" (byval wcode as long, byval wmaptype as long)

public declare function getasynckeystate% lib "user32" (byval vkey as long)

public declare function setwindowword& lib "user32" (byval hwnd as long, byval nindex as long, byval wnewword as long)

public declare function getkeystate% lib "user32" (byval nvirtkey as long)

public const gwl_hwndparent& = (-8)

public const vk_shift& = &h10

public const vk_menu& = &h12

public declare function sendmessage lib "user32" alias "sendmessagea" (byval hwnd as long, byval wmsg as long, byval wparam as long, lparam as any) as long

public hotkey as long

public hotkey_cild as long

form1:

private type pointapi

x as long

y as long

end type

private declare function getasynckeystate lib "user32" (byval vkey as long) as integer

'判斷函式呼叫時指定虛擬鍵的狀態

private declare function getcursorpos lib "user32" (lppoint as pointapi) as long

private declare function getdc lib "user32" (byval hwnd as long) as long

private declare function releasedc lib "user32" (byval hwnd as long, byval hdc as long) as long

private declare function getpixel lib "gdi32" (byval hdc as long, byval x as long, byval y as long) as long

private sub form_load()

timer1.interval = 1

end sub

private sub timer1_timer()

dim hdc as long

dim a as pointapi

dim quyanse as long

call getcursorpos(a) '取得滑鼠位置

text1.text = "x座標:" & a.x & "...y座標:" & a.y

hdc = getdc(0) '取得整個螢幕的hdc

form1.backcolor = getpixel(hdc, a.x, a.y) '取顏色

releasedc 0, hdc '釋放hdc

if myhotkey(vbkeyf2) then '如果按下f2,就獲取顏色值到變數中

quyanse = getpixel(me.hdc, 2, 2) '取顏色值

text2.text = str(quyanse)

msgbox text1.text & "顏色值:" & quyanse

end if

end sub

private function myhotkey(vkeycode) as boolean

myhotkey = (getasynckeystate(vkeycode) < 0)

end function

'注意!!!!module1可以不要!!

按鍵精靈關於滑鼠所在位置的顏色的問題

3樓:匿名使用者

getcursorpos x,y

//得到當前滑鼠所在的位置座標

getcolor1=getpixelcolor(x,y)//得到指定位置的點的顏色

rem aaa

getcolor2=getpixelcolor(x,y)if getcolor2 = getcolor1 thendelay 100

goto aaa

//顏色沒變就循版環等

end if

//顏色變了,進行下一步權

按鍵精靈怎麼獲取螢幕滑鼠座標

4樓:秋風奏鳴曲

getcursorpos x, y ‘得到當前滑鼠座標,存入變數x,y

是按鍵精靈自帶的函式,可以在左邊框那裡找得到的~

5樓:匿名使用者

dim x,y,color

//宣告變數

getcursorpos x, y

//得到當前滑鼠的座標位置 並儲存到變數x,y中color=getpixelcolor(x,y)//得到指定座標位置的顏色 並儲存到變數color中messagebox("座標為:"&x&","&y&" 顏色為:"&color)

//彈出視窗 輸出座標和顏色的值

按鍵精靈怎麼獲取螢幕滑鼠座標?

6樓:匿名使用者

dim x,y,color

//宣告制變數

getcursorpos x, y

//得到當前滑鼠的座標

位置 並儲存到變數x,y中

color=getpixelcolor(x,y)//得到指定座標位置的顏色 並儲存到變數color中messagebox("座標為:"&x&","&y&" 顏色為:"&color)

//彈出視窗 輸出座標和顏色的值

用按鍵精靈找色, 如何將滑鼠移動到找到的這個座標intx,inty

7樓:匿名使用者

findcolor 0,0,1600,900,"c2e9c2",intx,inty

if intx > 0 and inty > 0 thenmoveto intx, inty

messagebox "找到了"

else

messagebox "沒找到"

end if

試試這個回看找答到沒

如何用按鍵精靈獲取當前滑鼠位置

8樓:匿名使用者

getcursorpos x, y

這句的意思是,把當前滑鼠位置儲存到x和y裡面。

9樓:匿名使用者

getcursorpos x, y

traceprint x& "," &y

- -咱是新手,按鍵精靈,用找圖取色工具,找出座標和顏色之後,怎麼寫做到鍵盤按的是找到的顏色和座標?

10樓:匿名使用者

dim x,y,color

getcursorpos x, y

color=getpixelcolor(x,y)saystring ("座標為:"&x&","&y&" 顏色copy為:"&color)

1.定義變數x,y,color

2.獲取

滑鼠座標儲存到x,y

3.獲取顏色儲存到color

4.輸出文字x,y,color

這樣寫好理解吧

按鍵精靈怎麼匯入指令碼,按鍵精靈 一個指令碼如何呼叫另一個指令碼?

關於使用 如果你看到的指令碼是一段語句,你可以把它複製下來,然後開啟按鍵精靈 點 增加 會開啟指令碼編輯器,在編輯區域 右下空白的地方 的上面一點有 普通 和 原始檔 兩個按鈕,點 原始檔 然後把你複製下來的語句貼上到下面編輯區,然後設定好上面的 指令碼描述 啟動熱鍵 中止熱鍵 和 迴圈 然後點儲存...

求按鍵精靈自動喊話指令碼,求一個按鍵精靈自動喊話指令碼

uservar moshi droplist 0 設定模擬方式 uservar str1 0 請輸入自動叫喊的第1句話 uservar str2 0 請輸入自動叫喊的第2句話 uservar str3 0 請輸入自動叫喊的第3句話 uservar str4 0 請輸入自動叫喊的第4句話 userva...

問按鍵精靈的指令碼,問一個按鍵精靈的指令碼。

不對的 首先你要在vbscall findcolorex 0,0,1024,768,ffffff 1,0.8,x,y 之前加進去一天標記語句 然後 再把的語句 插在moveto x 1,y 1之前 這樣 在滑鼠移動到x 1,y 1之前 就判斷了x 10,y 10是否要點選 不點選的話 他就重新回到找...