CompuServe Thread

#Window/Form Question

8 messages in this thread
#2397From: Mark A. HallermanOct 10, 1991 8:51 AM
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.
#2446From: Don FunkOct 10, 1991 12:33 PM
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.
#2457From: Mark A. HallermanOct 10, 1991 1:38 PM
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.
#2493From: Mark Novisoff/MicroHelpOct 10, 1991 4:10 PM
Mark, You could do a GetFocus before BringWindowToTop and then a SetFocus afterward. Mark
#2500From: Jonathan Zuck (UFI)Oct 10, 1991 4:29 PM
Mark, I think you can use SetParent or set the owner of your form. I think Ted Young has accomplished this. Ask him -=- Jonathan
#2481From: Ted M. YoungOct 10, 1991 4:07 PM
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.
#2624From: Mark A. HallermanOct 11, 1991 11:20 AM
Ted, Yup! I had figured it out about 5 min before I read these messages! Thanks… Mark
#2513From: Nelson FordOct 10, 1991 5:02 PM
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.