How can I control external window(3270 emulator) through smallTalk?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I control external window(3270 emulator) through smallTalk?

Denis Ermolin
I am trying to access the "Disconnect" or "Connect" Button so that I can press it using SmallTalk. Unfortunately, once the window is disconnected, Abt3270Terminal methods are all useless. Thus, I've been trying to use OSCalls 

Solutions I've tried: 

Getting OSHwnd like so; OSHwnd findWindow: nil lpszWindow: 'Session D'.
this returns a window handle that I try passing to OSWidget findWidget: OSHwnd. However, I always get a return of nil, no matter what. If I do OSWidget focusWidget- that works fine, but does not help me in any way because I need the emulator window, this is just the focused windowed.

I've tried using DDE but it does not return 3270 sessions as one of the available topics/subjects. (It should be IBM3270 or IBM327032 but there is nothing)

I've tried using OLE objects , something like MpAbstractOleInterface new createRootOleObject: 'HostExplorer.SessionOptions' .  But what now? How can I control any of the menus?

I've had major luck using OShmenu which allows to return different state of menus and manipulation, but there is no way to click a menu item......

tl;dr: I need to get control of 3270 emulator window menus and send a click event to the connect button.


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How can I control external window(3270 emulator) through smallTalk?

Louis LaBrunda
Hi Denis,

What are you using to emulate the 3270 terminal?  Does it have an API you can talk to?

Lou

On Thursday, March 17, 2016 at 2:10:56 PM UTC-4, Denis Ermolin wrote:
I am trying to access the "Disconnect" or "Connect" Button so that I can press it using SmallTalk. Unfortunately, once the window is disconnected, Abt3270Terminal methods are all useless. Thus, I've been trying to use OSCalls 

Solutions I've tried: 

Getting OSHwnd like so; OSHwnd findWindow: nil lpszWindow: 'Session D'.
this returns a window handle that I try passing to OSWidget findWidget: OSHwnd. However, I always get a return of nil, no matter what. If I do OSWidget focusWidget- that works fine, but does not help me in any way because I need the emulator window, this is just the focused windowed.

I've tried using DDE but it does not return 3270 sessions as one of the available topics/subjects. (It should be IBM3270 or IBM327032 but there is nothing)

I've tried using OLE objects , something like MpAbstractOleInterface new createRootOleObject: 'HostExplorer.SessionOptions' .  But what now? How can I control any of the menus?

I've had major luck using OShmenu which allows to return different state of menus and manipulation, but there is no way to click a menu item......

tl;dr: I need to get control of 3270 emulator window menus and send a click event to the connect button.


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How can I control external window(3270 emulator) through smallTalk?

Alex Greber
In reply to this post by Denis Ermolin
Hello Denis.

We had full control over the terminal emulation with these 4 OLE wrappers of the product "Personal Communications" from IBM:

PCOMM.autECLConnList.1
PCOMM.autECLSession.1
PCOMM.autECLWinMetrics.1
PCOMM.autECLPS.1


Maybe this helps
Regards Alex

Am Donnerstag, 17. März 2016 19:10:56 UTC+1 schrieb Denis Ermolin:
I am trying to access the "Disconnect" or "Connect" Button so that I can press it using SmallTalk. Unfortunately, once the window is disconnected, Abt3270Terminal methods are all useless. Thus, I've been trying to use OSCalls 

Solutions I've tried: 

Getting OSHwnd like so; OSHwnd findWindow: nil lpszWindow: 'Session D'.
this returns a window handle that I try passing to OSWidget findWidget: OSHwnd. However, I always get a return of nil, no matter what. If I do OSWidget focusWidget- that works fine, but does not help me in any way because I need the emulator window, this is just the focused windowed.

I've tried using DDE but it does not return 3270 sessions as one of the available topics/subjects. (It should be IBM3270 or IBM327032 but there is nothing)

I've tried using OLE objects , something like MpAbstractOleInterface new createRootOleObject: 'HostExplorer.SessionOptions' .  But what now? How can I control any of the menus?

I've had major luck using OShmenu which allows to return different state of menus and manipulation, but there is no way to click a menu item......

tl;dr: I need to get control of 3270 emulator window menus and send a click event to the connect button.


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How can I control external window(3270 emulator) through smallTalk?

Denis Ermolin
In reply to this post by Denis Ermolin
I am using Abt3270Terminal classes which connect to the presentation space and controls the emulator. The problem is that once the emulator is disconnected - you cannot send messages to the host presentation space anymore or detect that the session is disconnected.

I am using 8.5 VA SmallTalk and Windows 7. 


Thank you for the suggestion Alex! However, I am not sure I can take that path as I am limited by corporate politics. I have to accomplish this using 8.5 VA SmallTalk.

Right now, I am able to use OSHwnd to create OSHmenu and do calls to find out whether 'Connect' or 'Disconnect' buttons are greyed out. If connect is not greyed out that means the emulator is disconnected, I shut down the window and open a new one which connects automatically; however, I really wish I could just press that connect button through code instead of re-opening the emulator.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How can I control external window(3270 emulator) through smallTalk?

Instantiations mailing list
Not sure, I have unterstand this right, you will emulate a button click in your terminal window?. If you have the window handle to the button, you can all messages send via 
myButtonHandle sendMessage: msg wParam: aWParam lParam: aLParam

In your case msg = PlatformConstants::BnClick, params are 0. BnClick, I think is it in PlatformConstants.

Look Window API for more informations. If this true forget the rest of the answer. Otherwise you will find window handle to the button? Use API functions EnumWindows and EnumChildWindows or use FindWindowEx. But, in Smalltalk you must do a little more therefore. 

I hope, i have not totaly misunderstood your question.:)

Here an example for EnumWindow, EnumChildWindow will working too, read win api help for this functions.

platformSearchWindowHandle

| windowProc address |

self windowHandle: nil.
windowProc :=
EsEntryPoint
receiver: [:hwnd :lParam | 
self platformEnumWindowsFindWindow: hwnd lParam: lParam] "THIS IS YOUR METHODE d"
selector: #value:value:
callingConvention: 'c'"@CMNO"
arrayBased: false
parameterTypes: #(uint32 pointer)
returnType: #boolean.

windowProc failAddress: PlatformFunctions::DefWindowProc address.
address := windowProc address.
PlatformFunctions::EnumWindows callWith: address with: 0.
windowProc unbind.

This is the call to the EnumWindows function. To find the window, for us we use this method, but you can all do what you want.

platformEnumWindowsFindWindow: aHwnd lParam: aLParam

| pid tid wnd |

pid := OSPtr new: 4.
wnd := OSHwnd fromInteger: aHwnd.
tid := wnd getWindowThreadProcessId: pid.
pid := pid int32At: 0.
pid = idProcess 
ifTrue: [self windowHandle: wnd].
^true



--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.