Click to See Complete Forum and Search --> : Making a form topmost in existing VB3 app


David Glass
May 27th, 1999, 01:58 PM
Hello from a newcomer. I have resurrected an application written in VB3, in 1995, that behaves oddly in the Win95/98 environment. The app places a small form topmost (visible) when a timer calls it, regardless of the running applications, then hides the form after a preset time. It worked great with all 16-bit apps in Win 3.x, but in 95/98 with newer apps (e.g. Word 97, Excel, etc.), Form2.Show won't bring my form to the front. When all windows are minimized (only the desktop and wallpaper showing), it works fine. I would prefer to avoid rewriting it in VB5 or 6. Is there a VB3 method that will make my 16-bit app come to the front? I've looked at ZOrder, but without success. This seems so simple...
Thanks in advance for any help.
David

Ravi Kiran
May 28th, 1999, 01:53 AM
Hi,

Dont get me wrong, if i say: "if you are resurrecting any program in the '99s, it makes good sense to go for 32 bit." You will never know when in the future, 16 bit support could be stopped. Anyway..

Windows is supposed to be becoming a better "preemptive multitasking environment" and under this criteria, they have changed how apps wrest focus. It is expected that passing around 'focus' is to be confined to windows belonging to a SINGLE process ONLY.

On Win95 you could try using SetForegroundWindow.
But even this function doesnt work all that well on Win98. (It is supposed to satisfy few conditions - MSDN).
You could add its 16bit equivalent and 'rebuild' your project( - in which case makes sense to build using VB 5/6, unless it involes a number of VBXs, for which 32bit equls dont exist - then you have no choise)

Ravi