How to move / set mouse pointer at specified location

Discuss anything else that does not suite other forums.

Moderator: Rathinagiri

Post Reply
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

How to move / set mouse pointer at specified location

Post by bpd2000 »

How to move / set mouse pointer at specified location by coding
BPD
Convert Dream into Reality through HMG
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: How to move / set mouse pointer at specified location

Post by danielmaximiliano »

Hello BDP:
in Minigui is an example of mouse. work ok in HMG

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002 Roberto Lopez <harbourminigui@gmail.com>
 * http://harbourminigui.googlepages.com/
 *
 * MOUSEMOVE demo
 * (C) 2006 Jacek Kubica <kubica@wssk.wroc.pl> 
*/

#include "MiniGUI.ch"

Procedure main()

DEFINE WINDOW Form_1 ;
	AT 0,0 ;
	WIDTH 348 ;
	HEIGHT 176 ;
	MAIN ;
	TITLE "Mouse Test" ;
	ON MOUSEMOVE DisplayCoords()


END WINDOW

CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1

Return

*--------------------------
Procedure DisplayCoords()
*--------------------------
Local aCoords:={}

	aCoords := GETCURSORPOS()
	Form_1.Title:= "Pos y: "+ PADL(aCoords[1]-Form_1.Row-GetTitleHeight()-GetBorderHeight(), 4) + ;
		" Pos x: "+ PADL(aCoords[2]-Form_1.Col-GetBorderWidth(), 4)
Return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
danielmaximiliano
Posts: 2763
Joined: Fri Apr 09, 2010 4:53 pm
DBs Used: DBF
Location: Argentina
Contact:

Re: How to move / set mouse pointer at specified location

Post by danielmaximiliano »

Code: Select all

SetCursorPos( 380+Win_1.Col+GetBorderWidth(), 195+Win_1.Row+GetTitleHeight()+GetBorderHeight() )
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Telegram invitation https://t.me/HMGWorkspace
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: How to move / set mouse pointer at specified location

Post by Pablo César »

Me ganaste de mano.... jajajaja

You came before my answer... hahaha
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: How to move / set mouse pointer at specified location

Post by bpd2000 »

danielmaximiliano wrote:

Code: Select all

SetCursorPos( 380+Win_1.Col+GetBorderWidth(), 195+Win_1.Row+GetTitleHeight()+GetBorderHeight() )
Thank you, DaNiElMaXiMiLiAnO
BPD
Convert Dream into Reality through HMG
Post Reply