mfc编程 如何在全局上检测鼠标的状态

mfc编程 如何在全局上检测鼠标的状态,第1张

没问题:

#include <Windowsh>

int main(void) {

while (1) {

if (GetKeyState(1) & 0x8000 || GetKeyState(2) & 0x8000) {

printf("Mouse Key is Pressed\n");

};

};

return 0;

};

private

sub

command1_mousemove(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

command1mousepointer

=

vbcross

end

sub

private

sub

command1_mouseup(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

if

button

=

vbrightbutton

then

msgbox

"现在鼠标光标位于命令按钮中"

end

if

end

sub

private

sub

form_load()

'picture1mouseicon

=

loadpicture("c:\handcur")'光标文件的路径

end

sub

private

sub

form_mousemove(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

memousepointer

=

vbdefault

end

sub

private

sub

form_mouseup(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

if

button

=

vbrightbutton

then

msgbox

"现在鼠标光标位于窗体上"

end

if

end

sub

private

sub

picture1_mousemove(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

picture1mousepointer

=

vbcustom

end

sub

private

sub

picture1_mouseup(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

if

button

=

vbrightbutton

then

msgbox

"现在鼠标光标位于框中"

end

if

end

sub

private

sub

text1_mousemove(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

text1mousepointer

=

vbhourglass

end

sub

private

sub

text1_mouseup(button

as

integer,

shift

as

integer,

x

as

single,

y

as

single)

if

button

=

vbrightbutton

then

msgbox

"现在鼠标光标位于文本框中"

end

if

end

sub

以上就是关于mfc编程 如何在全局上检测鼠标的状态全部的内容,包括:mfc编程 如何在全局上检测鼠标的状态、VB编程如何获取鼠标双击事件、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/9426255.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-28
下一篇 2023-04-28

发表评论

登录后才能评论

评论列表(0条)

保存