docs

Custom Message Windows

If your application uses its own message WINDOW or a third-party message procedure that is not dimmed automatically, cdWindowDim can dim the parent behind it.

Normal Clarion MESSAGE(), STOP() and HALT() calls already work with automatic message dimming, which is enabled by default. Supported CapeSoft MessageBox windows work automatically too; they do not require this extension.

Add the Custom Message Window extension

  1. In the APP containing the message window procedure, add cdWindowDim - Global Settings to Global Extensions if it is not already installed.
  2. Open the actual message window procedure in Clarion. Under its procedure extensions, add cdWindowDim - Custom Message Window.
  3. Generate and compile the APP. The extension does the necessary registration and restoration automatically for ABC and Legacy procedures.
  4. Open the message from another window to check that the parent dims while the message is displayed and restores when you close it.

Add the extension to each different custom message window procedure you want covered. Do not add it to every calling browse or form. You can leave the global automatic-message setting on (recommended) or turn it off; the custom extension works either way. If you use CapeSoft MessageBox, try the normal automatic setting first. The extension can also be used with a CapeSoft message window when you have access to that procedure.

Single EXE and multi-DLL applications

Hand-coded registration (optional)

Use the extension above whenever possible. If you need to insert the calls yourself, add these declarations to the Clarion MAP and link the matching product DLL/LIB:

MODULE('CDWindowDim.dll')
  CDRegisterMessageWindow(LONG),SIGNED,PROC,PASCAL,RAW,NAME('CDRegisterMessageWindow')
  CDUnregisterMessageWindow(LONG),SIGNED,PROC,PASCAL,RAW,NAME('CDUnregisterMessageWindow')
END

In the message WINDOW procedure, after the window opens:

IF 0{PROP:Handle} <> 0
  CDRegisterMessageWindow(0{PROP:Handle})
END

When that message window closes, before the window is destroyed:

CDUnregisterMessageWindow(0{PROP:Handle})

Tip: Open the supplied demo application in Clarion and select Source to see the generated registration and unregistration calls in their proper locations.

If the parent does not dim

For ordinary MESSAGE() calls use Automatic Message Dimming. See the DLL Function Reference if you need direct calls.