Re: Make Form stay on top until application is deactivated

From: Randy Birch (rgb_removethis_at_mvps.org)
Date: 01/18/05


Date: Mon, 17 Jan 2005 20:15:43 -0500

That sounds no different that specifying the Owner parameter in VB's Show
statement ...

form2.show vbmodeless, form1

This will make it topmost to the app - albeit not modal - and allow other
apps to appear over it.

-- 
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
"Ken Wickes [MSFT]" <kenwic@online.microsoft.com> wrote in message 
news:eIufYKO$EHA.2876@TK2MSFTNGP12.phx.gbl...
: CreateWindow hwndParent arg will set the owner for a top-level window. 
See
: this from MSDN
:
: "Handle to the parent or owner window of the window being created. To 
create
: a child window or an owned window, supply a valid window handle. This
: parameter is optional for pop-up windows. "
:
: I agree it is confusing but the param and the GetWindowLong field are
: overloaded.  They do mean parent for child windows and owner for top-level
: windows.
:
:
: -- 
:
: Ken Wickes [MSFT]
: This posting is provided "AS IS" with no warranties, and confers no 
rights.
:
:
: "Tom Esh" <tjeshGibberish@suscom.net> wrote in message
: news:g2nlu01oko3sm9k00hjdaih8cr95ieqfrl@4ax.com...
: > On Sun, 16 Jan 2005 12:43:36 -0800, "Ken Wickes [MSFT]"
: > <kenwic@online.microsoft.com> wrote:
: >
: >>Setting the owner of an existing window sounds a little dangerous to me.
: >
: > Hi Ken,
: >
: > Never had a problem with it. AFIK the owner / owned relationship (not
: > to be confused with parent / child BTW) effects only the zorder and
: > visibility behavior. I've found the SDK docs to be sometimes confusing
: > with regard to owner/owned vs parent/child relationships since they
: > often use the terms interchangably (and incorrectly). For example the
: > the defined name of the GWL_HWNDPARENT constant used with
: > Get/SetWindowlong would imply that it relates to parent/child, when in
: > fact it does not. (A more appropriate name choice would have been
: > GWL_HWNDOWNER.) Using SetParent OTOH is a different story and caution
: > would definitely be advisable :-)
: >
: >>Can't you just set the parent/owner param of CreateWindow or whatever 
the
: >>VB
: >>equivalent is?
: > CreateWindow's hwndParent arg is entirely different as it set's the
: > parent (not the owner). If you're referring to the Ownerform argument
: > to VB's show statement, I can't see how it's useful in this case
: > because it only accepts a Form object. My guess is behind the scenes
: > it's calling SetWindowLong with GWL_HWNDPARENT anyway, which AFIK is
: > the only way the API provides to set the owner.
: >
: >
: > -Tom
: > MVP - Visual Basic
: > (please post replies to the newsgroup)
:
: 


Relevant Pages

  • Re: Im back on the injured list!!
    ... > Well, at a motel room party after a gig, the keyboard player that I play ... > and smashed my ribs on the window sill. ... > The owner said he'd get the window fixed and then call me with the total ...
    (alt.guitar.bass)
  • Re: Im back on the injured list!!
    ... He's the one who should pay for the damage. ... > Well, at a motel room party after a gig, the keyboard player that I play ... and smashed my ribs on the window sill. ... > The owner said he'd get the window fixed and then call me with the total ...
    (alt.guitar.bass)
  • Re: Mechanic Cheated Me, What Should I Do?
    ... I dropped off my car for engine work (water pump replacement, ... roll up the window, ... was not in and only the owner can authorize the repairs. ... He said that their mechanics did ...
    (misc.legal)
  • Re: Make Form stay on top until application is deactivated
    ... That sounds no different that specifying the Owner parameter in VB's Show ... This will make it topmost to the app - albeit not modal - and allow other ... CreateWindow hwndParent arg will set the owner for a top-level window. ... "Handle to the parent or owner window of the window being created. ...
    (microsoft.public.outlook.program_addins)
  • Re: Make Form stay on top until application is deactivated
    ... That sounds no different that specifying the Owner parameter in VB's Show ... This will make it topmost to the app - albeit not modal - and allow other ... CreateWindow hwndParent arg will set the owner for a top-level window. ... "Handle to the parent or owner window of the window being created. ...
    (microsoft.public.outlook.thirdpartyutil)