FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Execute Click Mouse ( To Antonio )
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Execute Click Mouse ( To Antonio )
Posted: Wed Oct 14, 2009 10:29 PM
Antonio,

Yo gostaria de por una function que executa-se un click ( simulace ) un click del mouse ( rightbutton )
yo tieno pesquisado y consegui hacer isto pero no execute nenhuna açaõ.
para abrir lo menu iniciar
Code (fw): Select all Collapse
#include "Fivewin.ch"

function main()

   local Cor:=  GetCursorPos() // Return { x,y }

   SendClickMouse(MOUSEEVENTF_LEFTDOWN,755,20, 0, 0) 
   SendClickMouse(MOUSEEVENTF_LEFTUP  ,   755,20, 0, 0)

  // 755 = x, 20 = y cordenada del button inicial windows.
  /*
    isto era para executar lo buton iniciar del windows i abrir lo menu. pero no work
   o que estoy hacendo de errado ?

   ggracias

  */
return
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Execute Click Mouse ( To Antonio )
Posted: Wed Oct 14, 2009 10:30 PM

:D

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Execute Click Mouse ( To Antonio )
Posted: Thu Oct 15, 2009 05:01 AM
Lailton,

Do it this way:
Code (fw): Select all Collapse
#include "FiveWin.ch"

#define MENU_KEYCODE    91
#define KEYEVENTF_KEYUP  2

function Main()

   keybd_event( MENU_KEYCODE, 0, 0, 0 )
   SysRefresh()
   keybd_event( MENU_KEYCODE, 0, KEYEVENTF_KEYUP, 0 )
   SysRefresh()
   
   MsgBeep()

return nil

DLL static FUNCTION keybd_event( bvk AS LONG, bScan AS LONG, nFlags AS LONG, dwExtraInfo AS PTR ) AS VOID PASCAL LIB "user32.dll"
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Execute Click Mouse ( To Antonio )
Posted: Thu Oct 15, 2009 02:08 PM

It´s work fine, thanks.

Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: Execute Click Mouse ( To Antonio )
Posted: Thu Oct 15, 2009 02:14 PM

Gracias.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Execute Click Mouse ( To Antonio )
Posted: Thu Oct 15, 2009 03:02 PM

Lailton,

Si lo que quieres es abrir el menú principal de Windows (botón inicio), el código que te he mostrado lo hace :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion