Writing Low Resource Windows Service

L

Luc The Perverse

I am a Java programmer - but I have had some experience programming in C++
before (3 years on a job) I have need of an application or set of
applications to do the following on a windows machine:

1 - Passively monitor CPU and HD utilization, and if they drop to 0, and X
number of seconds have passed, request the OS (windows) use its time to
cache some files which may be launched. (The files would be user
selectable
2 - Watch for trigger keys which indicate a macro is to be run. For
instance CTRL+ALT+SHIFT+F would bring up F:\My Music\French or CTRL+ALT+S
would run the program "Luc's Nifty Media Management Program"
3 - Define keyboard "shortcut" macros. (These could of course be turned
off.) For instance if I were programming in Java I could (by hotkey) turn
on my Java Macro shortcuts, to allow a key combination like CTRL+T+I to type
TreeSet<Integer> tr = new TreeSet<Integer>();

I have to be honest, I am a little worried about memory foot print. I know
ATI has a key listener service installed by default that consumes 1.6 MB of
memory!!! WTF? If I start to exceed 400 kb, I might try shoving some
stuff into a DLL - whatever it takes to get that down. (I hate hate hate
bloat.)

2 and 3 are almost the same thing, except 3 requires that I know how to
locate and "type" in the foreground app.

I would need a dedicated configuration keystroke which would initialize a
setup program (it could be console window if that allowed me to reduce
bloat, but a dynamically created window with no nifty graphics shouldn't be
too bad)

This is being born out of necessity. Trying to use window's built in
service of going through and manually setting shortcut keys through the
start menu is downright exhausting not to mention requiring shortcuts to
folders and other things which would not normally go in the start menu just
to make it even possible.

If no one knows of a reasonable freeware application which does these - I am
intending on writing such an app in Dev C++ (an IDE for the standard GNU C++
compiler) I could also download and install the command line .Net
microsoft compiler if it meant I could use some premade code.

#1 may be beyond my programming expertise (ok all three of them are beyond
my expertise, however if I could find a ready made shell which allowed me to
interprit system keystrokes, the hard part would already be done.)

Advice?
 
J

Jacek Dziedzic

Luc said:
> [...]
1 - Passively monitor CPU and HD utilization, and if they drop to 0, and X
number of seconds have passed, request the OS (windows) use its time to
cache some files which may be launched. (The files would be user
selectable
2 - Watch for trigger keys which indicate a macro is to be run. For
instance CTRL+ALT+SHIFT+F would bring up F:\My Music\French or CTRL+ALT+S
would run the program "Luc's Nifty Media Management Program"
3 - Define keyboard "shortcut" macros. (These could of course be turned
off.) For instance if I were programming in Java I could (by hotkey) turn
on my Java Macro shortcuts, to allow a key combination like CTRL+T+I to type
TreeSet<Integer> tr = new TreeSet<Integer>();
>
[...]
>
Advice?

Yes, though not really helpful. This newsgroup tries as hard
as it can not to deal with OS-specific questions (such as yours),
but rather with C++ language-only topics, so you'll have more
luck in some of the newsgroups in the microsoft hierarchy.

As a side note -- if the CPU utilization drops to 0
(as in "exactly zero") than no instructions in your program
are executed, by definition.

- J.
 
L

Luc The Perverse

Jacek Dziedzic said:
Yes, though not really helpful. This newsgroup tries as hard
as it can not to deal with OS-specific questions (such as yours),
but rather with C++ language-only topics, so you'll have more
luck in some of the newsgroups in the microsoft hierarchy.

That was the purpose of the cross post - sorry though I wasn't trying to
offend you.
As a side note -- if the CPU utilization drops to 0
(as in "exactly zero") than no instructions in your program
are executed, by definition.

Well . . . I could offset that with some sort of threshold like 0.1% or
something. In my defense I will say I was calculating the CPU utilization
on an integer scale, and my program will be so streamlined that it won't
push it over the 0 marker *wink*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top