Jump to content

Mainframe Automation - Need to click on "Run Macros" from my mainframe session


Recommended Posts

@Danp2 Sure I would wait for 24 hours , sorry for posting two posts. I am adding the one I tried with reference to other thread. The Control Command option. I am adding the code and my console

 

Func PassportInputs()
Local $IE = _IECreate("My Application")
sleep(10000)

  $hwndWindow =  WinGetHandle('[CLASS:IEFrame]')
  $hwndToolbar  = ControlGetHandle ( $hwndWindow, "", '[CLASS:Afx:ToolBar:400000:8:10003:10; INSTANCE:2]' )
  $aPos = ControlGetPos ( $hwndWindow, "", $hwndToolbar )
  ConsoleWrite($aPos[0] & '-' & $aPos[1] & '-' & $aPos[2] & '-' & $aPos[3] & @CRLF)
    WinActivate ( $hwndWindow )
    ControlFocus ( $hwndWindow, "", $hwndToolbar )
        $iCmdID = _GUICtrlToolbar_IndexToCommand($hwndToolbar, 16)
        ConsoleWrite ( $iCmdID & @CRLF ) 
        $sText = _GUICtrlToolbar_GetButtonText($hwndToolbar, $iCmdID)
        _GUICtrlToolbar_ClickButton ( $hwndToolbar, $iCmdID, "left", True, 1, 80 )
        $atest1 = _GUICtrlToolbar_GetButtonRect ( $hwndToolbar, $iCmdID )
        $atest2 = _GUICtrlToolbar_GetButtonRectEx ( $hwndToolbar, $iCmdID )
        $atest3 = _GUICtrlToolbar_GetButtonSize ($hwndToolbar )
        ControlFocus ( $hwndWindow, "", $hwndToolbar )
        _GUICtrlToolbar_PressButton ( $hwndToolbar, $iCmdID )
        $result = ControlCommand ( $hwndWindow, "", $hwndToolbar, "SendCommandID", $iCmdID )
        ConsoleWrite ( $result & @CRLF )
    

EndFunc


>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" /ErrorStdOut "C:\Users\SZP0544\Documents\FMB Automation\FMB Automation.au3"    
--> IE.au3 V3.1-0 Error from function _IELoadWait, $_IESTATUS_ClientDisconnected (-2147023179, Browser has been deleted prior to operation.)
0-0-702-53
31016
0
>Exit code: 0

 

Link to comment
Share on other sites

Have you tried to find a Key sequence you could send to the window to activate the button, like Shift+Alt+M?  perhaps you could look through the help file to find the right key sequence.

Also, I have automated a mainframe app in the past "BlueZone" which has an automation dll which I can connect to and is able to launch stored macro's.  I assume the software you are using would have automation as well.  You should find and look through any help documents you can find for your software.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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