Page 1 of 1

How to move / set mouse pointer at specified location

Posted: Sat Nov 17, 2012 10:06 am
by bpd2000
How to move / set mouse pointer at specified location by coding

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

Posted: Sat Nov 17, 2012 11:00 am
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

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

Posted: Sat Nov 17, 2012 11:07 am
by danielmaximiliano

Code: Select all

SetCursorPos( 380+Win_1.Col+GetBorderWidth(), 195+Win_1.Row+GetTitleHeight()+GetBorderHeight() )

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

Posted: Sat Nov 17, 2012 12:52 pm
by Pablo César
Me ganaste de mano.... jajajaja

You came before my answer... hahaha

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

Posted: Sun Nov 18, 2012 3:30 am
by bpd2000
danielmaximiliano wrote:

Code: Select all

SetCursorPos( 380+Win_1.Col+GetBorderWidth(), 195+Win_1.Row+GetTitleHeight()+GetBorderHeight() )
Thank you, DaNiElMaXiMiLiAnO