Thread: need to display a graphic always on top (even when other programs run in fullscreen)

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    5

    need to display a graphic always on top (even when other programs run in fullscreen)

    Hi,

    I want to display the temperature of the CPU/GPU using a graphic. My main purpose to do this project is that laptop users often have overheating problems when playing high performance games.

    I already know how to get the temperature of the PC but I don't know how to display a graphic that is always on top even though there are games running in fullscreen.

    The program "fraps" is exactly doing what I am looking for except that it shows the frames per second instead of the temperature.

    So, how can I ensure that a graphic will be always on top?

    Thanks,
    moccajoghurt

  2. #2
    Registered User
    Join Date
    May 2012
    Posts
    1,066
    I think that's a OS/window manager-specific problem and since you are mentioning "fraps" I guess you are speaking about Windows, aren't you?

    Bye, Andreas

  3. #3
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Download the free (for Windows), program "CoreTemp".

    Click on "options" menu, and then on "Always on Top".

    Works great!

  4. #4
    Registered User
    Join Date
    Sep 2012
    Posts
    5
    Yes, I am talking about Windows.
    Thank's for the hint. Well then I guess my program idea is obsolete.
    However I am still kind of curious how you can display a graphic on Windows always on top, even though there are other things running in fullscreen. If anyone got a hint, I'd be thankful.
    Thanks for your replys so far.
    moccajoghurt

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by moccajoghurt View Post
    Yes, I am talking about Windows.
    Thank's for the hint. Well then I guess my program idea is obsolete.
    However I am still kind of curious how you can display a graphic on Windows always on top, even though there are other things running in fullscreen. If anyone got a hint, I'd be thankful.
    Thanks for your replys so far.
    moccajoghurt
    Each "Window" in windows, has a list of properties that go with it. Think of a struct in C, with a whole bunch of struct members.

    Several of those properties determines the display characteristics of a window: size, position, color, border type, etc. One of those properties determines if the window should stay on top, or act like a normal window.

    This is not a C language thing, it's very much a Windows thing. A Google search should take you right to the Windows API that controls it. Also, with a little poking around, you can surely find some open source projects in C, that use that property.

    The MSDN library should have the answer, (and they usually have C code showing how to use it). A good Windows forum can perhaps answer it, as well. I've found the Windows 7 forum to be quite knowledgeable on Windows issues. I'm not sure if that extends to programming for it, however.

  6. #6
    Registered User
    Join Date
    Sep 2012
    Posts
    5
    Thank you, this helped me a lot. Now I am having a starting point which is exactly what I have been looking for.

  7. #7
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Have you looked at the window styles of WS_EX_TOPMOST and WS_EX_TRANSPARENT ?

    Also you will probably want to remove the border, sysmenu and title/caption bar (again styles).
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 13
    Last Post: 05-02-2012, 04:17 PM
  2. C Programs for Calendar (DIsplay Month and Year)
    By Karyumi in forum C Programming
    Replies: 4
    Last Post: 03-04-2012, 05:12 AM
  3. Replies: 1
    Last Post: 11-09-2009, 07:03 AM
  4. [Q]Dos in fullscreen
    By Yuri in forum C++ Programming
    Replies: 13
    Last Post: 08-17-2005, 10:40 AM
  5. alt-tab with fullscreen
    By lambs4 in forum Windows Programming
    Replies: 0
    Last Post: 10-12-2003, 05:37 PM