Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 25 SEP 2002 03:00:08PM John Bouley wrote:

Does anyone know the class name for the Print Preview window in OIPI32? In OI16 it used to be "ThunderForm" but the method of calling FindWindow("ThunderForm":\00\,0) no longer returns a handle.

Thanks,

John


At 25 SEP 2002 04:13PM Sean FitzSimons wrote:

John,

The OIPI32 class name is "ThunderRT6FormDC".

Sean


At 26 SEP 2002 08:40AM John Bouley wrote:

Thanks Sean,

Thats what I was looking for.

By the way is this documented anywhere?

Thanks,

John


At 26 SEP 2002 12:54PM John Bouley wrote:

I checked my code again and it now returns a handle, however the call to BringWindowToTop does not work?

The following Code used to work in OI16 with "ThunderForm" of course:


Hwnd=FindWindow("ThunderRT6FormDC":\00\,0)

debug

If Hwnd 0 Then Call BringWindowToTop(Hwnd)

Any ideas?

Thanks,

John Bouley


At 26 SEP 2002 03:02PM Pat McNerthney wrote:

John,

Things work differently in Win32 versus Win16 with regards to what Windows are displayed.  Win32 doesn't let one executable just indescriminately force it's windows to be on top.  There is a concept of the foreground window, which is not the same as the active window.
Search msdn.microsoft.com for details about the SetForegroundWindow api.  You might also need to use the AllowSetForegroundWindow api.

Pat


At 26 SEP 2002 04:39PM John Bouley wrote:

Thanks Pat,

The SetForegroundWindow function call did the trick.

I modified the DLL_USER32 with the following:

VOID STDCALL SetForegroundWindow(HANDLE)

It appears to work.

Thanks again,

John Bouley


At 27 SEP 2002 06:37AM Oystein Reigem wrote:

Pat,

What you tell might explain a problem reported by some of my clients - not with OIPI Preview, but with a different "companion" program to my app. But could you please elaborate a bit about when the AllowSetForegroundWindow function would be necessary? John didn't seem to need it. And the explanation at the MSDN site went over my head.

- Oystein -


At 27 SEP 2002 12:33PM Pat McNerthney wrote:

Oystein,

In Win32 an application cannot just force it's windows to the foreground whenever it wants, it is normally up to the user to decide what is the current "foreground" application.
However, sometimes cooperating executables (for example, OINSIGHT.EXE and OENGINE.EXE) want to be able to "yield" the foreground to other execuables.  So the SetForegroundWindow allows an application to say "Make me the foreground".  But this won't automatically happen if the current foreground application is not in a state which allows it.  If the current foreground application *wants* to yield the foreground, then the AllowSetForegroundWindow call will allow another executable to take the foreground from the current executable.
In order for OINSIGHT and OENGINE to somewhat seemlessly bring their own windows to the foreground from each other, they are calling AllowSetForegroundWindow whenever they think the other might need to pop up on top.  So I suspect that John did not need to make this call himself because it is already in effect.

HTH,

Pat


At 27 SEP 2002 12:45PM Oystein Reigem wrote:

Pat,

Right. Thanks.

- Oystein -

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/7f2ed6fffd761b2185256c3f00686202.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1