C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2012, 03:22 PM
Vic_ Vic_ is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 Vic_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 25 sec
Reputation 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?

Reply With Quote
  #2  
Old October 17th, 2012, 03:30 PM
G4143 G4143 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 71 G4143 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 7 h 39 m 39 sec
Reputation Power: 1
You might want to state which operating system the code will run on.

Reply With Quote
  #3  
Old October 17th, 2012, 03:32 PM
Vic_ Vic_ is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 Vic_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 25 sec
Reputation Power: 0
Quote:
Originally Posted by G4143
You might want to state which operating system the code will run on.
Windows 7 64bits.

GNU GCC Compiler.

Reply With Quote
  #4  
Old October 17th, 2012, 03:33 PM
salem's Avatar
salem salem is offline
Contributed User
Click here for more information
 
Join Date: Jun 2005
Posts: 3,838 salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)salem User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 153 Folding Title: Novice Folder
Time spent in forums: 2 Months 3 Weeks 2 Days 17 h 58 m 15 sec
Reputation Power: 1774
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

Reply With Quote
  #5  
Old October 17th, 2012, 03:47 PM
Vic_ Vic_ is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 Vic_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 1 m 25 sec
Reputation Power: 0
Quote:
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.

Reply With Quote
  #6  
Old October 17th, 2012, 04:40 PM
ChokolAwt's Avatar
ChokolAwt ChokolAwt is offline
The bad and the ugly...
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Location: Oz... No??? Neverland then?
Posts: 142 ChokolAwt Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 6 h 21 m 2 sec
Reputation Power: 0
Send a message via ICQ to ChokolAwt Send a message via AIM to ChokolAwt
Quote:
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!

Reply With Quote
  #7  
Old October 17th, 2012, 05:03 PM
mitakeet's Avatar
mitakeet mitakeet is offline
I'm Baaaaaaack!
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Jul 2003
Location: Maryland
Posts: 5,538 mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level)mitakeet User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 2 h 38 m 46 sec
Reputation Power: 242
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

Reply With Quote
  #8  
Old October 17th, 2012, 08:18 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
I'll bet it's a trivial tcl program.
Implementation details to be determined.
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
  #9  
Old October 18th, 2012, 04:10 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,364 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 3 Days 10 h 28 m 48 sec
Reputation Power: 383
bash/tcl solution

Code:
sleep 600 # 10 minutes
wish
button .submit -text "Click Me" -command { puts "\nHello World" }
pack .submit

Reply With Quote
  #10  
Old October 19th, 2012, 12:37 PM
clifford's Avatar
clifford clifford is offline
Contributing User
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Aug 2003
Location: UK
Posts: 4,808 clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level)clifford User rank is General 12nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 17 h 38 m 37 sec
Reputation Power: 1800
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Is it possible to write this program on C?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap