Link to home
Start Free TrialLog in
Avatar of setfocus
setfocus

asked on

Keeping popup window on top of active form

I want to keep a popup form in front of the active form while the popup is open.

It is a small window that contains address info that the user may want to see while working on the form.

I hope this is easy...I have tried the setparent api but it doesn't work the way I would like it to...It only allows movement within the form... if it is possible they should be able to move it anywhere on the screen.

Thanks...sorry for low points
Avatar of jrspano
jrspano
Flag of United States of America image

this will keep it on top of everything



SetWindowPos form.hwnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, SWP_NOACTIVATE Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOREDRAW

here are the constants
Private Const HWND_NOTOPMOST = -2
Private Const HWND_TOPMOST = -1
Private Const HWND_TOP = 0
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOZORDER = &H4
Private Const SWP_NOREDRAW = &H8
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_NOOWNERZORDER = &H200

make the form show non modal and use this on it
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
<grr> when will these "experts" learn that API is not always the first solution ...</grr>
just joking
Avatar of setfocus
setfocus

ASKER

I always try to get around API's especially if your one liner works...

I like to keep it simple.

testing..
Excellent! Exactly what I wanted... and simple
cool i didn't know it was that easy!!
glad i could help 2 people at the same time!