Re: Hotkey Manager



"Chris Uppal" <chris.uppal@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4530bc32$0$627$bed64819@xxxxxxxxxxxxxxxxxxxx
Luc The Perverse wrote:

I had no idea I posted this in HTML

How embarassing

Never mind...

Now, as to your /other/ problem (;-) I think you can assume that no
reasonable
Java implementation is ever going to start up fast enough for this to work
well -- there's just too much to do before it can get any useful work
done.

Also, I don't know of any way of hooking "global" keyboard events from
Java
(but that might just be my ignorance).

So both considerations suggest that a good architecture would be for your
Java
stuff to be a single long-lived process which (amongst other things)
listened
on a socket, waiting to be told to start an "application" (which is really
just
another window opened from the same program). It would probably be
sufficient
to create a little program in some fast-starting language which opened a
socket
connection and passed an instruction through to the "main" program then
quit (I
use that architecture myself). If so then you can tell Windows to start
that
program from a hot-key combination without having to mess with real
Windows
programming by putting a shortcut with that hotkey somewhere in the start
menu.
That leaves you with the choice of implementation language. One option
would
be to use a small footprint language like C (or compiled Forth or whatever
suits your fancy); however it might be that one of the Windows scripting
languages like jscript would work just as well in practice if the DLLs
needed
to interpret the script tended to be loaded into memory already (and if
it's
possible to open a local socket from them -- I have no idea whether it
is).

Of course, if you can find a way to hook global hot-keys from Java then
there's
no need for the helper program or the socket...

I don't know why I never think of Datagrams - but the solution is perfect!
It would even allow me to broaden the scope of the program to allow messages
over the network (although I suppose I would need to add verification or use
TCP if it is off the local computer). I always think I have to work with
stupid windows messages.

I have never written a networking program in any language but Java (I tried
one in C++ and eventually gave up) Oh yeah - I wrote something in VB
once - but that doesn't solve any problems I am having.

I will probably write it in C or C++ and use your idea - because you are
smart :)

Thank you d00d.

--
LTP

:)


.



Relevant Pages

  • Re: C# is a proprietary programming language ??
    ... Java tried this too, of course. ... for calling the Windows API, SUN sued, and won. ... Java is the language where you can write code on one operating system ... Of course, if you write code in C# on Windows, you can't run it on UNIX. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Comparing Lisp conditions to Java Exceptions
    ... All the ISO standards in the world will not make the world ... Nothing keeps you from annotating your program with exceptions based on what ... language should adhere to your theory. ... Curiously, although you don't say it, Java has the opposite problem. ...
    (comp.lang.lisp)
  • Re: MFC updates and enhancements
    ... We're not talking about some fringe niche tool here, ... applications to run on Windows. ... I may not like the language but it is far from being a nice tool. ... To a large part the relative simplicity of the Java language is ...
    (microsoft.public.vc.mfc)
  • Re: casts
    ... This is why most shit programmers refuse to learn languages including ... C Sharp and Java. ... compiler in a later edition of Visual Basic, ... language for processing data. ...
    (comp.lang.c)
  • Re: C, really portable?
    ... > Wait, is Java a modern language superior to C, or is it still ... It is a much better OO language than C++, ... It depends what you are doing, Java aims for rigorous portability - the same ... regardless of platform. ...
    (comp.lang.c)