Maximize a Window Without Making It Foreground in Clarion

Hello everyone,

I am working on a Clarion project where I need to maximize a window without it taking focus or becoming the foreground window, so as not to interrupt the interaction with other active applications (like Microsoft Word).

Here’s what I am trying to achieve:

Maximize a window (WMenu_Pay{PROP:Handle}) using SW_MAXIMIZE or a similar method.
Keep the window maximized in the background, without it becoming the active window or disturbing the currently foreground application.
I have tried using SW_SHOWNA instead of SW_MAXIMIZE, but it does not seem to work as expected. The window does not become activated in the foreground as desired, but it also does not take up its full available size.

I am open to any suggestions, whether it’s a modification of the current approach or the use of a specific Windows API that could be integrated into Clarion. If there are any known templates or extensions to handle this type of behavior, I would also be interested.

Thank you in advance for your help and suggestions!

Is it an AppFrame or a simple SDI window?

The easiest way is to define the window as maximized, open it and then programmatically minimize it or change it’s Z position using SetWindowPos() API.

What I have done is make API calls to see if the Foreground window changed then Set it back … this code is from memory:

   FgWnd_Before = GetForeGroundWindow()
  ...  Do what I got to do e.g. Maximize ...
   IF GetForeGroundWindow() <> FgWnd_Before THEN 
      !There may be other things that ideally should be checked like is it Minimized or Not Visible
      SetForegroundWindow(FgWnd_Before )
   END

I first try to code in Clarion to not take focus, but then have the above to save me in case something goes wrong.