CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    2

    Making a form topmost in existing VB3 app

    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


  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Making a form topmost in existing VB3 app

    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




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured