Written on July 27th, 2009 at 2:27 am by

11 Comments

How to use Windows API in Java?-Solution

We all know that Win32 API’s are Powerful and provide great features and ability from getting Window handles,Spawning new process,killing process ,Send Keystrokes ,Tweaking Registry, Logging lots and lots more.

But how to use Windows API in Java ,this is sure to make your Java Application Power packaged and versatile and also eases your work.It will be really useful for those who write Java Application for Windows Platform.

How to use Win32 API in Java?

1.Visit this page http://www.jamesyoung1.com/jDownloadsV2.shtml

2.Download copy of JWinAPI .JWinAPI Download

3.Install the setup.And you are Ready to go.

4.Include JWinAPI.jar in your Project Library.

5.Done!

Demo :

For Demo Go to the directory where you have installed JWinAPI. Type:

<strong>java -jar JWinAPI.jar </strong>

Demo Code of how to use JWinAPI:

Poping up Message Box:

WinAPI wapi = new JWinAPI();
wapi.doMessageBox("JWinAPI DLL has been loaded successfully!",
"JWinAPI", MBConstants.MB_OK + MBConstants.MB_ICONASTERISK );

Accessing Windows Registry From Java Example

// write an int value
wapi.doWriteToRegistry(REGConstants.HKEY_CURRENT_USER,
"Software\\jamesyoung\\regsample",
"javaINTValue",	REGConstants.REG_DWORD, new Integer(123456 ) ) ;

See what are the functions supported by JWinAPI:

JWinAPI Doc

Hope it was Useful!

Get Free Newsletter
API for accessing the windows registry using Java, API to access Windows registry via JAVA, calling Win32 API from Java, calling Windows API from Java, Editing the Windows Registry with Java, how to access windows registry from Java, how to use windows api in java programming, How to use Windows API in Java?, using win32 api in java, win32 api in java

11 Responses to “How to use Windows API in Java?-Solution”


  1. ganda

    2 years ago

    Great dude. Thankx for this. Its been a while I search about how to access win api through java application. you help me much. Thanx buddy!

    Reply

    • admin

      2 years ago

      You are always Welcome ganda..

      Reply

  2. Maksym

    2 years ago

    I get “no JWinAPI in java.library.path” AWTException on Windows Vista.
    Trying to run my desktop app with JWinAPI.jar distributed. JWinAPI is
    not installed on the system.

    Is this a bug or I should force user to install JWinAPI before
    running my app?

    Reply

    • Shunmugha

      2 years ago

      @Maksym

      Yes ,you should first ask your user to install JWinAPI…

      Reply

  3. khadija

    11 months ago

    please gide me how to use Windows Api in java .Also tel windows API for Xp 32 bit are different from Vista..I m Xp 32 bit Os user

    Reply

    • Shunmugha

      10 months ago

      You can use above mentioned api’s for Xp 32 Bit OS.

      Reply

  4. jd

    9 months ago

    the links are broken.

    Reply

    • Mohit

      4 months ago

      If anyone have this JWinAPI.jar then pls send me that file on my email id ::: mohit.sonee@yahoo.com

      Regards,
      Mohit

      Reply

3 Trackbacks For This Post

  1. How to Access Windows Registry from Java-API’s | Technobuz Says:

    [...] http://technobuz.com/2009/07/how-to-use-windows-api-in-java/ [...]

  2. Posts about plugins as of July 27, 2009 | All About WordPress Says:

    [...] How to use Windows API in Java?-Solution – technobuz.com 07/27/2009 We all &#107&#110&#111w that Win32 API’s are Powerful and [...]

  3. Detecting system user privileges on XP OS? - Java Programming Forums Says:

    [...] Detecting system user privileges on XP OS? How about this. How to use Windows API in Java?-Solution | Technobuz Generated Documentation (Untitled) // [...]

Leave a Reply



Previous Post:

Next Post: