I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaDon't think DDE is a good idea but can you explain a bit what you need to achieve ?
You can use Rumba Macro or Rumba Script to achieve all kind of automation.
Check the Emulation command in Rumba Script:
- EMReadScreen
- EMSendKey
I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaRumba is used here in a green screen environment that is menu based. I am attempting to automate the running of reports. For example, I know to run report "X", I need to key a "1" followed by a "4" and then followed by a "7". Depending on the report I may also need to input dates, etc. EMSendKey would probably do the trick but I would still need to have my application initiate the macro - wouldn't that be with DDE? There are no humans at the keyboard and this is known as "Robotic Process Automation" and in the past HLLAPI would have been used but I thought perhaps DDE might be easier. To use DDE, I believe I need to know the "Items" at play. In Excel for example, the item might be "R1C1" which refers to Row 1 Col 1 - I need the similar syntax for Rumba to try and make it work.....
I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaHi kpozmann,
opting for DDE is not easier that using HLLAPI, in fact it's more complicated, you need a DDE Client and some of the Function calls return variants which can cause headaches.
You mention a "my application", are you writing your own application or using something else, such as Excel?
Note: Dynamic Data Exchange is a client server conversation protocol. Your application being the DDE Client and Rumba being the DDE Server. Excel had a build in DDE Client, if you are writing your own application they I would strongly advice you not to take the DDE route as you would have to write your own DDE Client.
Note: DDE is 16-bit technology and is even older that HLLAPI. I would steer well clear of DDE.
You have several options.
1. Use HLLAPI (or EHLLAPI)
2. Record Rumba Basic scripts which run the reports and then with shell the scripts from your application or configure each to be a startup macro is a rumba session and then shell your session from your application.
3. If you need to interact with Rumba from your application, you could host an ActiveX control in your application and programmatically to to it, or as Adi suggested on a different thread use the VBA Add-on for Rumba 9.5, this will give you a COM interface to talk to Rumba through.
I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaHi kpozmann,
opting for DDE is not easier that using HLLAPI, in fact it's more complicated, you need a DDE Client and some of the Function calls return variants which can cause headaches.
You mention a "my application", are you writing your own application or using something else, such as Excel?
Note: Dynamic Data Exchange is a client server conversation protocol. Your application being the DDE Client and Rumba being the DDE Server. Excel had a build in DDE Client, if you are writing your own application they I would strongly advice you not to take the DDE route as you would have to write your own DDE Client.
Note: DDE is 16-bit technology and is even older that HLLAPI. I would steer well clear of DDE.
You have several options.
1. Use HLLAPI (or EHLLAPI)
2. Record Rumba Basic scripts which run the reports and then with shell the scripts from your application or configure each to be a startup macro is a rumba session and then shell your session from your application.
3. If you need to interact with Rumba from your application, you could host an ActiveX control in your application and programmatically to to it, or as Adi suggested on a different thread use the VBA Add-on for Rumba 9.5, this will give you a COM interface to talk to Rumba through.
I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaHey Tom - thanks for the reply. Yes, I'm creating an application that needs basic communication capabilities with Rumba - send keystrokes and scrape the screen - are there any examples out there using HLLAPI or an ActiveX or even a VBA example?
I am attempting to automate keyboard entry and just want to make sure this is possible to do with DDE or must I use HLLAPI?
One example of what I need to do is send a keystroke. What is the DDE "Item" I should be using to send the data?
Conversely, I would like to scrape the screen at various locations, or the entire screen would be acceptable as well.
This would be enough to get me going.
Is there a list of the DDE Items? I do not see anything in HELP. I am using Rumba Desktop 9.4.1 SP0 Patch0 on a Windows 7 Enterprise Pro Workstation, 32-bit.
#RumbaHi kp,
they following VBA/VB6 code should enable you do do most things, ehllapi is well documented on the internet, naturally if you have problems you can always contact us.
Private Declare Function hllapi Lib "C:\\Program Files (x86)\\Micro Focus\\RUMBA\\System\\ehlapi32.Dll" (Func%, ByVal Buffer$, bSize%, RetC%) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Main()
Dim Astr As String
Dim Alen As Integer
Dim RetC As Integer
Dim Func As Integer
'You need to set the HLLAPI short name in the Rumba session and you have to have the session already opened (or you can open it programatically using CreateProcess or Shell is easiest).
'Connect PS
Func = 1 ' connect PS
Astr = "C" ' This is the HLLAPI Shortname, in my case I'm using C
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
'Find String USER - Used to ID the screen
Func = 6 ' search PS
Astr = "User"
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
If RetC = 0 Then MsgBox "Found " Chr$(34) "User" Chr$(34)
'Query Cursor Position - Used to know where you are on the screen
Func = 7
Astr = ""
Alen = &H0
hllapi Func, Astr, Alen, RetC
MyCol = (Alen) Mod 80
MyRow = (Alen 80 - MyCol) / 80
MsgBox "Cursor is located at (" CStr(MyRow) "," CStr(MyCol) ")"
'Send Key you will need a list of HLLAPI SendKey Mnemonics, you can google these,
'should be the same for every emulator (in theory).
'So the @ is the "Escape" character and is following my a char. This indicates non AlphaNumeric key
'@T == <Tab>, @E == <Enter> etc.
Func = 3
Astr = "Username@TPassword@E"
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
'Wait 500 msec for host to return the screen
'I am using a hard coded wait for simplicity, you might want to use Function 4 or Function 13 (Google EHLLAPI).
Sleep 500
'Move Cursor to 20,40
Func = 40 'Set Cursor
Astr = Chr$(0)
Alen = 0
RetC = ((20 - 1) * 80) 40
hllapi Func, Astr, Alen, RetC
'Copy PS - Read the screen
Func = 5
Astr = Space(1920)
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
'Screen text
MsgBox Astr
'GetEachRow
For i = 1 To 1841 Step 80
MsgBox Mid(Astr, i, 80)
Next i
'DisconnectPS - Disconnect from the Terminal Session (not the host !!!)
Func = 2
Astr = ""
Alen = Len(Astr)
hllapi Func, Astr, Alen, RetC
End Sub
You can use the above to create more convenient subroutines, such as MoveCursor(row,col), GetCursor(row, col), GetString(row, col, len), etc, etc,
Note: I have steered clear of reading the operator information area, as I don't know what flavour of host you are talking to. You can use Function 4 (Wait) and Function 13 (CopyOIA) to determine if the host has responded and the terminal is ready for input.
Cheers,
Tom