0

I'm relatively new to programming, I've been developing a lot lately in the eclipse environment and had the idea to build a small application for windows 7 that when I remove the power cord from my laptop it will enable my touch-pad and when the power is reconnected disable the touch-pad.

  • My question is how exactly do I go about building such an application?
    • Is there a package I can import that gives me access to the Windows 7 API?
    • And is it possible to compile a java application so I can have it run at startup?
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
user827570
  • 491
  • 1
  • 8
  • 15
  • 1
    Java is not a good choice of language for getting into (viewing, using or changing) the specifics of the OS or hardware. – Andrew Thompson Sep 02 '12 at 07:15
  • Oh ok, I'll look into the native language for windows applications. Do you have any personal preferences? Cheers. – user827570 Sep 02 '12 at 07:18

1 Answers1

2

I agree with Andrew that java is probably not the best choice for such kind of application but anyway here is what you can do.

Java 7 file API is able to listen to file system. You should listen for the changes is root folder of your card. I guess you will get exception when card is disconnected.

Touch pad may be invoked as an external application. Take a look on this discussion for details: Java - invoke on-screen keyboard

Alternatively you can use JNI, JNA or one of java-to-windows libraries (JaWin, Jintegra, Jinterop). But I think this is much more complicated. I'd recommend you to start from the first solution.

Community
  • 1
  • 1
AlexR
  • 114,158
  • 16
  • 130
  • 208