#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Is it possible to write this program on C?


    At the moment I'm a statistcs graduation student with the basics of C programming knowledge.

    The idea is basically a program wich running in the "background" can get a combination of keys (let's say something like alt+8), and whenever the combination is pressed, a chronometer starts running from a certain time to 0. But what makes me think this is really unlikely, I need the time counter to be shown over other program, and in a certain region of the screen.

    As an example, assume you're downloading a file and the download will finish in 25 minutes, now assume you're using a full screen application, then you should be able to know when the download is finished without closing/minimizing the full screen program.

    I know it seems useless at first, but sometimes it'd make some stuff easier to have such a program and at the same time, learning about new librearies is always helpful.

    By the way, if it's not possible in C, any other language I could try?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    71
    Rep Power
    2
    You might want to state which operating system the code will run on.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    Originally Posted by G4143
    You might want to state which operating system the code will run on.
    Windows 7 64bits.

    GNU GCC Compiler.
  6. #4
  7. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,387
    Rep Power
    1871
    Let's start with the basics.
    Which operating system and compiler do you have?

    The choice of programming language is somewhat irrelevant.

    If your OS/GUI/Window manager doesn't allow popup notifications over full-screen windows, then you're pretty much stuck regardless of which language you choose.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    Originally Posted by salem
    Let's start with the basics.
    Which operating system and compiler do you have?

    The choice of programming language is somewhat irrelevant.

    If your OS/GUI/Window manager doesn't allow popup notifications over full-screen windows, then you're pretty much stuck regardless of which language you choose.
    As I said, I plan on running it on a Windows 7 64 bits.

    At this moment the compiler I have is minGW32-gcc, but I can use other compilers/OS in case these become a problem.
  10. #6
  11. The bad and the ugly...
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Oz... No??? Neverland then?
    Posts
    142
    Rep Power
    0
    If your OS/GUI/Window manager doesn't allow popup notifications over full-screen windows, then you're pretty much stuck regardless of which language you choose.
    i'd google this as a starting point. the problem with C is that it doesn't really have any graphics header files. there's a graph.h but i dont know of any for pop-up windows.


    can't the task-bar remain on top of whatever you run? if so, that makes me thing that this is definitely possible in windows. heck, take league of legends as an example. when the game first starts, and all the summoners connect, theres an emblem in the middle of the screen. even if you start typing in a word document, or browsing a web page, it sits there right in the middle of the screen.
    "Life is not a journey with the intent on arriving at the finish line in a pretty and well preserved body. But rather to skid in broadside, totally worn out, thoroughly used up and loudly proclaiming, "Wow! What a ride!" -Anonymous
    Halo! || Diablo 2 LOD Modding || OLGA's BACK!
  12. #7
  13. I'm Baaaaaaack!
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    5,538
    Rep Power
    244
    As mentioned, this is not a C issue at all, it is specific to the OS windows manager. You are going to have to look in OS specific GUI design forums unless you get lucky here.

    My blog, The Fount of Useless Information http://sol-biotech.com/wordpress/
    Free code: http://sol-biotech.com/code/.
    Secure Programming: http://sol-biotech.com/code/SecProgFAQ.html.
    Performance Programming: http://sol-biotech.com/code/PerformanceProgramming.html.
    LinkedIn Profile: http://www.linkedin.com/in/keithoxenrider

    It is not that old programmers are any smarter or code better, it is just that they have made the same stupid mistake so many times that it is second nature to fix it.
    --Me, I just made it up

    The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.
    --George Bernard Shaw
  14. #8
  15. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,855
    Rep Power
    481
    I'll bet it's a trivial tcl program.
    Implementation details to be determined.
    [code]Code tags[/code] are essential for python code and Makefiles!
  16. #9
  17. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,855
    Rep Power
    481

    bash/tcl solution


    Code:
    sleep 600 # 10 minutes
    wish
    button .submit -text "Click Me" -command { puts "\nHello World" }
    pack .submit
    [code]Code tags[/code] are essential for python code and Makefiles!
  18. #10
  19. Contributing User

    Join Date
    Aug 2003
    Location
    UK
    Posts
    5,110
    Rep Power
    1803
    In Windows you can assign a keyboard short-cut to any executable file via the "Shortcut" tab of the file's properties dialog (right-click, select Properties).

    Any GUI application main window or dialog box can have its window attributes set to "always-on-top", and such a GUI application can indeed be programmed in C. MinGW is a somewhat primitive tool however for GUI programming - you can write code to the Win32 API, but it has no visual design tools or even a simple resource editor. You could use a higherlevel GUI framework such as Qt or wxWidgets, but those are C++ as are most GUI frameworks, so C++ might be a better option in any case.

    Another option is C#. The .NET framework and Windows Forms is very easy to work with and the tools are free.

    See Visual Studio 2012 Express Edition A complete suite for C#, C, C++ and more.


    When you say "full screen", do you mean full screen or simply a maximised window? Even "always on top" may not work on some full-screen apps I imagine. Why don't you just get a cooking timer or use an app on your mobile phone? It probably already has one.

IMN logo majestic logo threadwatch logo seochat tools logo