Is window a real popup menu or not? WS_POPUP

Hi All!

I have a fsStayOnTop and bsNone form that's created with WS_POPUP style flag, but this window is not a popup menu like a shell context menu or a system menu. How can i detect that the window is not a 'real' menu popup window? I tried everything.

IsWindow; IsMenu; IsAnyPopup;  GetWindowLong(...WS_CAPTION...); GetMenu; GetSystemMenu etc... but i didn't find a perfect solution.

Is there any unique difference between a ws_popup form and a real menu popup window?

Thanks in advance!
rogerrrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TNameCommented:
What' wrong with
"is TForm"?

 if Form2 is TForm then
     ShowMessage('True')
  else
     ShowMessage('False');


BTW,

 if TControl(PopUpMenu1) is TForm then
    ShowMessage('True')
  else
    ShowMessage('False');

will always be false
0
rogerrrAuthor Commented:
Yes, you're in right but the form was an example. But how can i detect it if the windowclass is not a TForm is not a Delphi application window?
0
AmigoJackCommented:
you cannot really check that. most applications written in delphi have the classname "TForm", but this can also vary. see API GetClassName() for more. you better check the executable for some text like "Borland"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

rogerrrAuthor Commented:
I have a StayOnTop form and i want to keep it always on top, but not over popup menus, dropdown lists and file menus. I'm hooking the WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages. If a window has WS_POPUP style then i don't send it back because default it's a menu popup. But there are some other windows created with WS_POPUP flag (e.g. a simple fsStayOnTop form without border-->bsNone) but they aren't real menu popup windows because they don't contains any menu elements...

And i'd like to find a difference between a real and a 'phantom' popup window.
0
AmigoJackCommented:
i dont understand you clearly - mostly because you mix WS_POPUP with MENUes. menues themselves are something completely else, no matter if they come from the system (like maximize, minimize, restore...), from the window (file, edit, help...) or from the context (rightclick). its their nature to be more on top - even when there are stay-topmost windows. you cant influence that. same goes with comboboxes. in fact, every combobox has another window handle (which then is the listbox you get as the popular "dropdown" - thats also always topmost).

if you create a window and set its z-order with the TOPMOST flag to stay in front it should behave quite well. what else do you want? if there are other windows which are also always topmost, then both your and that window will behave like all other windows - only in their group. that means the one you click on is then really on top.

oh: and setting fsStayOnTop in delphi and using setwindowpos() are different things. experiment on that
0
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.