Results 1 to 4 of 4

Thread: Create 5 commands in a screen who call an autoit exe

  1. #1
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,845

    Create 5 commands in a screen who call an autoit exe

    Hi,

    I have a little programme autoit (thanks again John) with 5 commands

    _WHEELUP()
    _WHEELDOWN()
    _CLICKRIGHT()
    _SLIDEON()
    _SLIDEOFF

    Who call:

    Code:
    Func _WHEELUP()	
    	WinActivate ($WindowsName) 	
    	MouseMove(500, 300, 10)
    	MouseWheel("up", 5) 
    EndFunc
    
    Func _WHEELDOWN()
    	WinActivate ($WindowsName) 	
    	MouseMove(500, 300, 10)
    	MouseWheel("down", 5) 
    EndFunc
    
    Func _CLICKRIGHT()
    	WinActivate ($WindowsName) 
    	MouseMove(500, 300, 10)
    	MouseClick("right", 500, 300, 1, 10) 
    EndFunc
    
    Func _SLIDEON()	
    	WinActivate ($WindowsName) 	
    	MouseClick("left", 380, 80, 1, 10)
    EndFunc
    
    Func _SLIDEOFF()
    	WinActivate ($WindowsName) 	
    	MouseMove(5, 80)
    	MouseClick("left", 5, 80, 1, 10) 
    EndFunc
    In a screen I have defines 5 buttons:

    Code:
    /, B, x, y, w, h, Command;COMMANDCODES, Tooltip
    B08,269,543,64,64,"","Mouse Right"
    B08,336,542,64,64,"WHEELDOWN","Roll Down"
    B08,73,543,64,64,"WHEELUP","Roll Up"
    B08,138,544,64,64,"","Mouse Left"
    B08,204,543,64,64,"CLICKRIGHT","Right Click"

    In my autoit exe i have some test but don't run :

    Code:
    		If  $rr.GetInfo("WHEELUP") Then _WHEELUP()
    		If  $rr.GetInfo("WHEELDOWN") Then _WHEELDOWN()
    		If  $rr.GetInfo("CLICKRIGHT$")  Then _CLICKRIGHT()
    		If  $rr.GetInfo("SLIDEON$") Then _SLIDEON()
    		If  $rr.GetInfo("SLIDEOFF") Then _SLIDEOFF()

    Who can help me and say me what i must to do .
    Thanks

  2. #2
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,845
    48 readings and nobody can help me ?

    Please who can take some time for to help me ?

    Thanks

  3. #3
    RoadRunner Mastermind
    Auto Apps:loading...
    guino's Avatar
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    9,818
    http://www.mp3car.com/vbulletin/road...t-program.html

    Some of the code in that thread is available with the SDK examples provided with the installer. All you have to do is add that code from post #5 of that thread, then where there's the "this"/"that" you'll compare the cmd received with a command to execute each of your 5 functions. Then on the RR side you'll use the SENDMSG;Receiver;<COMMAND> on each button you made (so it executes each corresponding function in the autoit script). That thread shows an alternate way of doing things too, but what I just described is likely the best choice.

    Should look like this (UNTESTED):
    Code:
    Global Const $StructDef_COPYDATA = "ptr;dword;ptr"
    Global Const $WM_COPYDATA = 0x4A
    Global Const $WM_CLOSE = 0x10
    Global Const $STRUCTDEF_AU3MESSAGE = "char[255]"
    
    Dim $cmd
    
    ; Create Reciver window
    $hwmd_Reciver = GUICreate("PierReceiver")
    
    ; Register Windows Messages
    GUIRegisterMsg($WM_COPYDATA, "_GUIRegisterMsgProc")
    GUIRegisterMsg($WM_CLOSE, "_GUIRegisterMsgProc")
    
    ;Loop indefinitely - put your commands in here
    While 1
    If $cmd = "WHEELUP" Then
      $cmd = ""
      _WHEELUP()
    Endif
    
    If $cmd = "WHEELDOWN" Then
      $cmd = ""
      _WHEELDOWN()
    Endif
    
    If $cmd = "CLICKRIGHT" Then
      $cmd = ""
      _CLICKRIGHT()
    Endif
    
    If $cmd = "SLIDEON" Then
      $cmd = ""
      _SLIDEON()
    Endif
    
    If $cmd = "SLIDEOFF" Then
      $cmd = ""
      _SLIDEOFF()
    Endif
    
    Sleep(250)
    WEnd
    
    ; Message Handler
    Func _GUIRegisterMsgProc($hWnd, $MsgID, $WParam, $LParam)
    	If $MsgID = $WM_COPYDATA Then
    		; We Recived a WM_COPYDATA Message
    		; $LParam = Poiter to a COPYDATA Struct
    		$vs_cds = DllStructCreate($StructDef_COPYDATA, $LParam)
    		; Member No. 3 of COPYDATA Struct (PVOID lpData;) = Pointer to Costum Struct
    		$vs_msg = DllStructCreate($STRUCTDEF_AU3MESSAGE, DllStructGetData($vs_cds, 3))
    
    		$SciTECmdLen = DllStructGetData($vs_cds, 2)
    		$cmd = StringLeft(DllStructGetData($vs_msg, 1), $SciTECmdLen)
    
    		; Display what we have recived
    		; MsgBox(0, "Test String", $cmd)
    
    	ElseIf $MsgID = $WM_CLOSE Then
    	; We Recived a WM_CLOSE Message
    		Exit
    	EndIf
    EndFunc ;==>_GUIRegisterMsgProc
    In RR:
    Code:
    /, B, x, y, w, h, Command;COMMANDCODES, Tooltip
    B08,269,543,64,64,"","Mouse Right"
    B08,336,542,64,64,"SENDMSG;PierReceiver;WHEELDOWN","Roll Down"
    B08,73,543,64,64,"SENDMSG;PierReceiver;WHEELUP","Roll Up"
    B08,138,544,64,64,"","Mouse Left"
    B08,204,543,64,64,"SENDMSG;PierReceiver;CLICKRIGHT","Right Click"
    Ride Runner RR's Myspace

    "Being happy is not about having what you want, it's about wanting what you have."
    "The best things in life are always free - but that doesn't mean money can't buy you good things."

  4. #4
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,845
    Quote Originally Posted by guino View Post
    http://www.mp3car.com/vbulletin/road...t-program.html

    Some of the code in that thread is available with the SDK examples provided with the installer. All you have to do is add that code from post #5 of that thread, then where there's the "this"/"that" you'll compare the cmd received with a command to execute each of your 5 functions. Then on the RR side you'll use the SENDMSG;Receiver;<COMMAND> on each button you made (so it executes each corresponding function in the autoit script). That thread shows an alternate way of doing things too, but what I just described is likely the best choice.

    Should look like this (UNTESTED):
    Code:
    Global Const $StructDef_COPYDATA = "ptr;dword;ptr"
    Global Const $WM_COPYDATA = 0x4A
    Global Const $WM_CLOSE = 0x10
    Global Const $STRUCTDEF_AU3MESSAGE = "char[255]"
    
    Dim $cmd
    
    ; Create Reciver window
    $hwmd_Reciver = GUICreate("PierReceiver")
    
    ; Register Windows Messages
    GUIRegisterMsg($WM_COPYDATA, "_GUIRegisterMsgProc")
    GUIRegisterMsg($WM_CLOSE, "_GUIRegisterMsgProc")
    
    ;Loop indefinitely - put your commands in here
    While 1
    If $cmd = "WHEELUP" Then
      $cmd = ""
      _WHEELUP()
    Endif
    
    If $cmd = "WHEELDOWN" Then
      $cmd = ""
      _WHEELDOWN()
    Endif
    
    If $cmd = "CLICKRIGHT" Then
      $cmd = ""
      _CLICKRIGHT()
    Endif
    
    If $cmd = "SLIDEON" Then
      $cmd = ""
      _SLIDEON()
    Endif
    
    If $cmd = "SLIDEOFF" Then
      $cmd = ""
      _SLIDEOFF()
    Endif
    
    Sleep(250)
    WEnd
    
    ; Message Handler
    Func _GUIRegisterMsgProc($hWnd, $MsgID, $WParam, $LParam)
    	If $MsgID = $WM_COPYDATA Then
    		; We Recived a WM_COPYDATA Message
    		; $LParam = Poiter to a COPYDATA Struct
    		$vs_cds = DllStructCreate($StructDef_COPYDATA, $LParam)
    		; Member No. 3 of COPYDATA Struct (PVOID lpData;) = Pointer to Costum Struct
    		$vs_msg = DllStructCreate($STRUCTDEF_AU3MESSAGE, DllStructGetData($vs_cds, 3))
    
    		$SciTECmdLen = DllStructGetData($vs_cds, 2)
    		$cmd = StringLeft(DllStructGetData($vs_msg, 1), $SciTECmdLen)
    
    		; Display what we have recived
    		; MsgBox(0, "Test String", $cmd)
    
    	ElseIf $MsgID = $WM_CLOSE Then
    	; We Recived a WM_CLOSE Message
    		Exit
    	EndIf
    EndFunc ;==>_GUIRegisterMsgProc
    In RR:
    Code:
    /, B, x, y, w, h, Command;COMMANDCODES, Tooltip
    B08,269,543,64,64,"","Mouse Right"
    B08,336,542,64,64,"SENDMSG;PierReceiver;WHEELDOWN","Roll Down"
    B08,73,543,64,64,"SENDMSG;PierReceiver;WHEELUP","Roll Up"
    B08,138,544,64,64,"","Mouse Left"
    B08,204,543,64,64,"SENDMSG;PierReceiver;CLICKRIGHT","Right Click"
    Thank you very much Guino, I try that.

    Thanks you very much.

Similar Threads

  1. any feedback info. on Dynamix 7" VGA Touch Screen TFT ???
    By xtreamvette in forum LCD/Display
    Replies: 29
    Last Post: 04-22-2007, 03:19 PM
  2. Tweaked 2.5 a little bit
    By d_sellers1 in forum SkinBedder
    Replies: 0
    Last Post: 12-01-2005, 07:29 AM
  3. FS: IBM Thinkpad 1400, National Display Systems Screen
    By emailthis1 in forum Classified Archive
    Replies: 8
    Last Post: 10-02-2005, 02:02 PM
  4. SpeakEasy Voice Recognition - Release 0.9.1
    By ruairi in forum Software & Software Development
    Replies: 11
    Last Post: 06-03-2005, 05:19 PM
  5. BASIC Stamp question
    By Banderon in forum General Hardware Discussion
    Replies: 18
    Last Post: 05-07-2004, 08:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •