Embeds a window within a group

Syntax

rv = Send_Message(Ctrl, "OLE.EmbedWindow", Group, Handle)

Parameters

ParameterDescription
GroupIndex to an existing group
HandleHandle to the window to be embedded

Remarks

The EmbedWindow method can be used to embed an OpenInsight window into an SRP ShortcutBar Control group. The window is added as a new item to the bottom of the group.

There are no limits to the controls you can place on an embedded window. The can be as complex as a small form or as simple as a window with a single control.



Embedding an OpenInsight window requires some preparation. The next section will explain how to prepare an embedded window within OpenInsight 7.0 or earlier. If you are using OpenInsight 7.1 or greater, skip ahead to the next section.

OpenInsight 7.0 and Earlier

Prepping a window for embedding in OpenInsight 7.0 or earlier requires that you modify the actual window record. Follow these steps:

1. Create the window in the Form Designer and save it.

2. Open the window's record. The record is located SYSREPOSWINS and the key is **. So, if you have a window called MY_EMBEDDED_WINDOW saved in the SYSPROG application, then open the record SYSPROG**MY_EMBEDDED_WINDOW from the SYSREPOSWINS table.

3. Locate the window properties. This is usually the third or fourth line in most editors. It will be the line that starts with the same name as your window.

4. Locate the style settings in value 10. Note that there are two style settings, separate by sub-value marks, each beginning with '0x'.

5. Set the first sub-value to 0x42000000. Set the second sub-value to 0x0. The result should look something like this

6. Close the record and re-open your form in the Form Designer. Recompile.

Your form should now have no borders around it and is ready to be embedded. Proceed below to the section on Embedding.

OpenInsight 7.1 and Greater

Prepping a window for embedding in OpenInsight 7.1 and greater is made simple thanks to the Raw Style Bits editor in the Form Designer. Follow these steps:

1. Create the window in the Form Designer.

2. Open the window's raw style bits editor. It is located in the Properties menu:

3. Make sure all check marks are off except for the 1st and 4th check of the first row. Your window should look like this:

Your form should now have no borders around it. Save your window; it's ready to be embedded.

Embedding

Now that your window is prepared, embedding it is easy. First, start the window using the Start_Window stored procedure. Then, get the window's handle by calling its HANDLE property. Pass the handle, along with the index to the group in which the window will be embedded, to the EmbedWindow method.

Example

// Embed another form 
Start_Window("MY_EMBEDDED_WINDOW", @Window:".OLE_SHORTCUTBAR") 
hWnd = Get_Property("MY_EMBEDDED_WINDOW", "HANDLE") 
Send_Message(@Window:".OLE_SHORTCUTBAR", "EmbedWindow", 1, hWnd)
  • No labels