Jump to content

Help with 1 input, 1 window, 2 instances.


Aareon
 Share

Recommended Posts

I have a GUI going that automatically runs an swf, creates a button, and when the button is pressed, it creates another instance of the same swf file 1/9 of the original size. I want to be able to put input into the largest instance and the same input go into the small instance at the same time. Any suggestions?

Link to comment
Share on other sites

  • Moderators

Aareon,

Welcome to the AutoIt forum. :)

What exactly do you mean by "input into the largest instance"? Perhaps if you posted the code you have now (see here how to do it) we might get a better idea of what you require. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <Misc.au3>


Local $hDLL = DllOpen("user32.dll")


;***** GUI Create *****


AutoItSetOption("GUIOnEventMode", 1)
$hGUI = GUICreate("Aareon's Client",875,580)


$mbbutton = GUICtrlCreateButton("Multibox",740,0,60)
GUICtrlSetOnEvent($mbbutton, "MBButton")


;***** Show GUI *****


GUISetState(@SW_SHOW)


;***** Show Flash *****
Sleep(1000)
$oAlphaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
$oAlphaFlash.Loop = False
$GX = GUICtrlCreateObj($oAlphaFlash, 0, 0, 740, 580)
$oAlphaFlash.Movie = @WorkingDir & "\load.swf"
$oAlphaFlash.Loop = False


;***** Multibox *****


Func MBButton()
Sleep(1000)
$oBetaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
$oBetaFlash.Loop = False
$GX = GUICtrlCreateObj($oBetaFlash, 740, 26, 130, 130)
$oBetaFlash.Movie = @WorkingDir & "\load.swf"
$oBetaFlash.Loop = False
EndFunc




;Sending keys to both clients


$hDLL = DllOpen("user32.dll")


While 1


    If _IsPressed("57", $hDLL) Then
opt("MouseCoordMode",0)
ControlFocus("[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:2]")
        Send("{w}")
Sleep(100)
ControlFocus("CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]")
    EndIf
WEnd


Func On_Exit()
    DllClose($hDLL)
    Exit
EndFunc


;***** Show Errors/Close *****


GUISetState(@SW_SHOW)
$oAutoItError = ObjEvent("AutoIt.Error", "COMError")
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")


;***** Prevent Lag *****


While 1
   Sleep(1500)
WEnd


;***** Show Errors ****


Func COMError()
   $fError = True
EndFunc   ;==>COMError


Func Close()
Exit
EndFunc

As you can see, I've tried many things. Including ControlClick, ControlFocus, etc.

Link to comment
Share on other sites

  • Moderators

Aareon,

For a start, you do not have the correct syntax for the 2 ControlSend calls - and you do not appear to send anything the second time (plus that syntax is wrong too). :(

This modified version at least passes the syntax checker and has a lot of unecessary code removed - give it a try and see if it works:

#include <GUIConstantsEx.au3>
#include <Misc.au3>

$oAutoItError = ObjEvent("AutoIt.Error", "COMError")

Local $hDLL = DllOpen("user32.dll")

;***** GUI Create *****
AutoItSetOption("GUIOnEventMode", 1)
$hGUI = GUICreate("Aareon's Client", 875, 580)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")

$mbbutton = GUICtrlCreateButton("Multibox", 740, 0, 60)
GUICtrlSetOnEvent($mbbutton, "MBButton")

;***** Show GUI *****

GUISetState(@SW_SHOW)

;***** Show Flash *****
Sleep(1000)
$oAlphaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
$oAlphaFlash.Loop = False
$GX = GUICtrlCreateObj($oAlphaFlash, 0, 0, 740, 580)
$oAlphaFlash.Movie = @WorkingDir & "\load.swf"
$oAlphaFlash.Loop = False

;Sending keys to both clients

$hDLL = DllOpen("user32.dll")

While 1
    If _IsPressed("57", $hDLL) Then
        ControlFocus($hGUI, "", "[CLASS:MacromediaFlashPlayerActiveX; INSTANCE:2]") ; Use the correct syntax - you need the GUI and text parameters
        Send("w") ; Use the correst syntax - you do not need { }
        Sleep(100)
        ControlFocus($hGUI, "", "CLASS:MacromediaFlashPlayerActiveX; INSTANCE:1]") ; Use the correct syntax - you need the GUI and text parameters
        Send("w") ; Sent something!
    EndIf
WEnd

;***** Multibox *****
Func MBButton()
    Sleep(1000)
    $oBetaFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash")
    $oBetaFlash.Loop = False
    $GX = GUICtrlCreateObj($oBetaFlash, 740, 26, 130, 130)
    $oBetaFlash.Movie = @WorkingDir & "\load.swf"
    $oBetaFlash.Loop = False
EndFunc   ;==>MBButton

;***** Show Errors/Close *****
Func COMError()
    $fError = True
EndFunc   ;==>COMError

Func Close()
    DllClose($hDLL)
    Exit
EndFunc   ;==>Close
Any luck? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

No luck. I appreciate the corrections. The goal is to detect when I press 'w' while I have big instance focused(1), quickly set focus to Instance 2 after I've pressed w, and repeat the key. Then set focus back to big instance.

Link to comment
Share on other sites

  • Moderators

Aareon,

Perhaps if you could explain why you wish to interact with this Flash object (and in 2 instances to boot) we might be able to suggest a better way to go about it. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Aareon,

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...