Link to home
Start Free TrialLog in
Avatar of mgazza
mgazzaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Lots of topmost forms in one application

hi iv had a bug 4 a while now that i cant seam to squish

i want more than one form per application to stay topmost but i can only get 1 form at any one time topmost any ideas...

each child form calls when its deactivated

SetWindowPos(Application.Handle,HWND_TOPMOST,0,0,0,0,
  SWP_NOACTIVATE or SWP_HIDEWINDOW or SWP_NOSIZE or SWP_NOMOVE);

the only problem is only the first form that was created retains topmost
must be something very simple! lol
regards mark,
Avatar of TheRealLoki
TheRealLoki
Flag of New Zealand image

you can only have 1 form "in front" per say, so that windows knows where to send the events such as keystrokes etc.
If you need to change which window is in front you can do a "BringToFront"
Avatar of mgazza

ASKER

the key strokes dont go though the main form i must be able to set more than one infront maybe if i use a mdi form and set everything inside that..... any sujections would be gr8!
regards
mark.
What do you mean with "each child form calls when its deactivated"?
Form is deactivated when another form in same application receives focus. If the whole app is deactivated, it doesn't mean that form is deactivated. From Delphi help:
"Use OnDeactivate to perform special processing when the form transitions from being the active form to another form in the same application becoming the active form. If activation goes to another application, this event is not triggered. To determine if another application has become active, Use the TApplication object’s OnDeactivate event."
Maybe you should process application's onDeactivate event, not forms'?
ASKER CERTIFIED SOLUTION
Avatar of ZhaawZ
ZhaawZ
Flag of Latvia 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
Avatar of mgazza

ASKER

ty that works i ant i noob just couldnt figure out why i changed ondeactivate to onidle cause its just better lol

best regards mark
Didn't understand your english...
Avatar of mgazza

ASKER

oh sorry!
i said, thankyou that works im not a newby, i just never done this before i changed the on activate to onidle but this is not needed since you only need to call this function once :)

best regards mark