#Window/Form Question
8 messages in this thread
I have a small form that I want to always be on top of any other windows on
the workspace, though not necessarily to have the input focus. I'm using a
timer to repeatedly execute the BringWindowToTop API, but this doesn't seem
to work. Any ideas?
Regards,
Mark
There are 3 Replies.
Hi Mark,
What you are trying to do is called child windows. VB does not support
this other than *you* creating a custom control with the CDK package. Mark
Novisoft or Ethan Winer may have this built into their tools.
Don FUnk
There is 1 Reply.
Don,
BringWindowToTop works in the sense that the window I want is brought to
the top, but ALSO recieves the input focus, which is NOT what I want. Any
way around this??
Thanks,
Mark
There are 2 Replies.
Mark,
You could do a GetFocus before BringWindowToTop and then a SetFocus
afterward.
Mark
Mark,
I think you can use SetParent or set the owner of your form. I
think Ted Young has accomplished this. Ask him -=- Jonathan
Mark,
I've come up with a solution to your problem: don't use BringWindowToTop,
use the SetWindowPos, with SWP_NOACTIVATE, SWP_SHOWWINDOW, SWP_NOMOVE, and
SWP_NOSIZE as the wFlags parameter. I think my code that shows how to do
this is in DL5 as FLOAT.ZIP…then again, it may not be there. If it
isn't, I can email it to you. Also, see the VB-TIPS file which spells out
exactly what I did, however, you should be able to figure out how to use
SetWindowPos by yourself.
– Ted
There is 1 Reply.
Ted,
Yup! I had figured it out about 5 min before I read these messages!
Thanks…
Mark
Get VBTIPS.EXE on DL1 and look for the item: "Floating" Window (Forcing
Window to Top).
The routine is also used in VBTVWR.EXE, the access program for VBTIPS, so
you can see it in actual use there, plus VBTVWR is a smaller download, if
the "floater" is all you are interested in.