IfmManage::RegisterStartedApplication

This method registers an application with the Forms Manager, indicating that the application has started.

Syntax

HRESULT RegisterStartedApplication( OLE_HANDLE hFC BSTR bstrAppName LONG AppMsgID LONG Flags );

Parameters

hFC
Handle to the Forms Manager’s context. It is FC_MAINFACEPLATE.
bstrAppName
Unicode string that contains the name of the application.
AppMsgID
Message identifier to be associated with this application.
Flags
Not currently implemented.

Return Values

NOERROR indicates success. If an error occurs, the appropriate HRESULT value is returned.

Remarks

An application needs to call this method to get the focus. This method associates a name for an application with a running process. The name should correspond the name of the application in the shell. While an application remains registered with the Forms Manager, the shell does not need to restart the application in order to restore the focus to that application. An application that is registered with the Forms Manager should call IfmManage::DeregisterStartedApplication to remove the registration from the application before exiting.

Context handles are always to the faceplate screen.

To enable message passing between applications

  1. Define the message name in a shared header file.
  2. The first application obtains a unique message identifier by calling RegisterWindowsMessage.

    The AppMsgID parameter is a Windows-based message identifier.

  3. A second application passes the unique message identifier to RegisteredStartedApplication.
  4. The second application invokes RegisterWindowsMessage.
  5. The second application uses PostMessageToApp to send messages to the first application.

See Also

IfmManage::DeregisterStartedApplication