Black Templar Admin
Nombre de messages : 356 Age : 35 Localisation : Lille (France) language de prog : Liberty BASIC; HTML; CSS; php; MySQL; C expérience en prog : Amateur Date d'inscription : 06/08/2005
| Sujet: connaitre la position du curseur Mer 8 Fév - 12:42 | |
| Un appel d'API pour connaitre la position du curseur sur l'écran Faire Alt F4 poue quitter - Code:
-
nomainwin WindowHeight = 33 WindowWidth = 45 BackgroundColor$ = "black" ForegroundColor$ = "white" statictext #1.x, "X = 1250", 1,1,50,15 statictext #1.y, "Y = 1250", 1,20,50,15 stylebits #1,0,0,_WS_EX_TOOLWINDOW or _WS_EX_TOPMOST,0 open "Cursor Pos" for window_popup as #1 print #1, "trapclose [q]" struct POINTAPI, _ X as long, _ Y as long hd = hwnd(#1) [loop] scan calldll #user32, "GetCursorPos", POINTAPI As struct, r As Long x = POINTAPI.X.struct y = POINTAPI.Y.struct print #1.x, "X = " + str$(x) print #1.y, "Y = " + str$(y) x = x+10 y = y+20 calldll #user32, "SetWindowPos", _ hd as long, _ 0 as long, _ x as long, _ y as long, _ 45 as long, _ 33 as long, _ _SWP_NOZORDER as long, _ result as long goto [loop] [q] close #1 end
| |
|