Form1.Circle (X, Y), 60
End Sub
[code:1]#include <gdk/gdk.h>
main()
{
int x,y
GdkDisplay *dpy
GdkScreen *scr
GdkModifierType mask
gdk_init(NULL,NULL)
dpy = gdk_display_open(NULL)
if(dpy)
{
scr = gdk_display_get_screen(dpy,0)
gdk_display_get_pointer(dpy,&scr,&x,&y,&mask)
printf("x=%d y=%d\n",x,y)
}
gdk_exit(NULL)
}
[/code:1]
[code:1]
#include <stdio.h>
#include <X11/Xlib.h>
main()
{
Display *dpy
Window win
Window root
Window child
int rootx,rooty,winx,winy,mask
dpy=XOpenDisplay(NULL)
if(!dpy)
{
printf("XOpenDisplay error\n")
return
}
XQueryPointer(dpy, RootWindow(dpy,0), &root, &child,
&rootx, &rooty, &winx, &winy, &mask)
printf("x=%d y=%d\n", rootx, rooty)
XCloseDisplay(dpy)
}
[/code:1]
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)