Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...The forum looks great! You guys have done a fantastic job on arranging things there...Your site is very precise and fun to visit..."

Geography

Where in the world do Tek-Tips members come from?
streetprog (TechnicalUser)
7 Jan 09 14:46
I started developing Extra! macros a few years ago and quickly moved into VBA to interact with Extra! sessions due to improved performance and functionality.  I've now gotten into .NET and have begun development of better tools but don't love having to switch back and forth from the .NET app and Extra.  Ideally I would love to build a .NET that sits on top of the session, allowing users to type in the application as they would in Extra but also have quick access to .NET menus and tools.

In other words, I want custom menus and tools that I can't build in Extra Basic macros/forms yet have that close tie with the session instead of running two apps like I do with VBA.

I've read a little about Host Integration Server but got lost and I don't know that this is an option.  Is there a way I can embed Extra in my app or at least dock my form around Extra?  Or a better idea?
CompuDork (Programmer)
21 Jan 09 19:18
Nope....   I have PCOMM and Attachmate at work, and the only emulator that allows this is PCOMM, using Java Beans
Helpful Member!  streetprog (TechnicalUser)
22 Jan 09 9:29
Gotcha.  I figured it would be something like that.  I don't know that licenscing PCOMM is an option for me, but I've been playing around with a "no extra cost" solution that might do what I want, although not as slick as an emulator.  I was able to create a .NET form with a transparent panel and "dock" EXTRA inside the panel.  When EXTRA is docked, resizing/moving the form also resizes and moves EXTRA.  I also figured out how to lock keyboard entry so that while .NET code is executing in EXTRA, user input is not allowed.   
genet24 (Programmer)
21 Feb 09 21:30
How were you able to "dock" Extra inside the panel?  i am trying to do this as well.   
streetprog (TechnicalUser)
23 Feb 09 8:29
I'm posting the pertinent code from my form.  You'll need to create the following but change whatever you don't like to fit your needs:
- form (frmMain) with a MenuStrip at the top and a StatusStrip as the bottom.  The default size is 800x600.
- panel (pnlEXTRA) with the BackColor set equal to your form's TransparencyKey color.  I set the Dock = Fill which makes it 784x518.  Making the panel transparent allows you to see through the panel and click through it as well which allows the form to sit around EXTRA and still allow you to click directly in it.
- MenuItem (DockSessionToolStripMenuItem) that fires the Dock/Undock session sub
- button (btnBringToFront) - this fires off ActivateExtra which just brings focus to the docked Session in the panel.  Is useful when EXTRA gets lost behind other windows or is minimized.

I refer to the EXTRA object as G.mySess which is a global variable I store in a module.  I din't include the code I use to initialize the session object, but you probably already have that.  I cut out this code from my form so I hope I gave you all you need.  It should give you a general idea to get started though.

CODE

'I have this enum in another class but you can use it in the form as well
'I did this because the EXTRA object doesn't specify which numbers
'pertain to what window state
    Public Enum SessionWindowState
        Minimized = 0
        Restore = 1
        Maximized = 2
    End Enum

Public Class frmMain
    Public IsDocked As Boolean = False
    
    'These variables are set prior to docking so that if the user undocks EXTRA,
    'it will return to it's original location on the screen
    Private eTop As Integer, eLeft As Integer, eHeight As Integer, eWidth As Integer, eWindowState As SessionWindowState

    Private Sub DockSessionToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DockSessionToolStripMenuItem.Click
        DockExtra(Not IsDocked)
        ActivateExtra()
    End Sub

    Private Sub ActivateExtra()
        'Because the form and EXTRA aren't the same application, EXTRA can get
    'lost behind other windows at times; this brings it to focus
        If IsDocked Then
            If G.mySess.WindowState = SessionWindowState.Minimized Then
                G.mySess.WindowState = SessionWindowState.Restore
            End If
            AppActivate(G.mySess.Name + " - EXTRA! for NetWare")
        End If
    End Sub

    Private Sub DockExtra(ByVal Dock As Boolean)
        Try
            IsDocked = Dock
            btnBringToFront.Visible = Dock

            Select Case Dock
                Case False
                    With G.mySess
                        If eTop <> 0 AndAlso .WindowState <> SessionWindowState.Minimized AndAlso eTop > 0 Then
                'reset EXTRA's size to what it was prior to docking
                            .Top = eTop
                            .Left = eLeft
                            .Height = eHeight
                            .Width = eWidth
                            .WindowState = eWindowState
                        End If

                    End With

                    DockSessionToolStripMenuItem.Text = "&Dock Session"
                Case True
                    GetSessionSize()
                    SizeForm()
                    SizeExtra()

                    DockSessionToolStripMenuItem.Text = "&Undock Session"
            End Select
        Catch ex As Exception

        End Try

    End Sub


    Private Sub GetSessionSize()
        If Me.Visible = True Then
            With G.mySess
                eTop = .Top
                eLeft = .Left
                eHeight = .Height
                eWidth = .Width
                'Extra WindowState: 0=Minimized,1=Restore,2=Maximized
                eWindowState = .WindowState
            End With
        End If
    End Sub

    Private Sub SizeExtra()
        With G.mySess
            If pnlEXTRA.Height > 0 Then
                .WindowState = 1
                .Top = Me.Top + pnlEXTRA.Top + 29
                .Left = Me.Left + pnlEXTRA.Left + 9
                .Height = pnlEXTRA.Height
                .Width = pnlEXTRA.Width + 5
            End If
        End With
    End Sub

    Private Sub frmMain_Move(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Move, MyBase.ResizeEnd
        If Me.Visible = True AndAlso IsDocked = True AndAlso Me.Top > 0 Then
            SizeExtra()
        End If
    End Sub

    Private Sub btnBringToFront_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBringToFront.Click
        ActivateExtra()
    End Sub
genet24 (Programmer)
24 Feb 09 22:20
thanks this helps out alot

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close