Want my application form on top all the time

i have a game (GW, WOW, ..name it how wish)  that run in full screen. in same time i run my application. but allways when i activate the game my form is behind and can't show it on top. how can i program my from to be ALWAYS ON TOP. I want to display a clock all the time over any application.

don't tell me to set my form to be showed on top :). not enough!
LVL 9
ginsonicAsked:
Who is Participating?
 
ZhaawZSoftware DeveloperCommented:
Err... Games are something different ;) IIRC, you'll have to "modify" some functions that are used to render picture in games - that is not "MS Windows messages" or "window position" stuff. Even more - you have to do it for both DirectX and OpenGL, which are different things - that means that you'll need at least 2 different sollutions (one for dx, one for ogl).

Even if you get your application "on top of game window" (or as a child of game's window), you won't see it. It will physically be there, but dx (or ogl; whichever is used in game) will draw on top of it, so you won't see it. Even if you draw manually your window all the time, it will flicker, because dx and ogl usually draw picture all the time. That's why you need to modify dx/ogl drawing functions to get what you want.
0
 
kretzschmarCommented:
??

usual it should be enough to set the formStyle to fsStayOnTop
(of course it must be the mainForm!)

meikl ;-)
0
 
ginsonicAuthor Commented:
is not. when start the game my form is somewhere on back.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
ginsonicAuthor Commented:
work just if I set the game to run in a window. else if is maximized the gave fill the screen and my windoe diseapear.
0
 
kretzschmarCommented:
well, then your game run in another device-context and not maximized on your window-desktop
--> if so, no chance

meikl ;-)
0
 
ginsonicAuthor Commented:
http://www.xfire.com/ can do it :)
0
 
ginsonicAuthor Commented:
Hm, the experts ladder is different from my last visit here ( one year ago :P  )
0
 
ginsonicAuthor Commented:
and how i see my avatar isn't set as guru ( my rank on Ex-Ex ).

Sorry for off topic comments. But happy to back here :)
0
 
kretzschmarCommented:
phew, this is out of my expirience, but guess, there is a lot more to do, to get it work

sorry, so i'm out of help in this case

about your avatar --> questioners are so displayed, regardless about its expert-state
(if you comment on a q not owned by yours, you should see your guru-state)

meikl ;-)
0
 
sun4sundayCommented:
OnShow event, put this code

SetWindowPos(Form1.Handle,
              HWND_TOPMOST,
              0, 0, 0, 0,
              SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW);

This will stay the form always on the top.
0
 
ginsonicAuthor Commented:
yes, this is the problem and solution :) any idea how can do that?

0
 
RuntimeError007Commented:
Try this component:

http://www.torry.net/vcl/forms/other/topwin.zip.

It stays OnTop even when it's not focused.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.