Developing JNI routines for Windows - want your suggestions

Everyone:
After seeing several questions over and over again about how to do certain things that can only be done (or at least best be done using JNI), I am taking the time to develop some java/c code to access native Windows functions from Java.
Please make suggestions as to functions you wish you had through java but do not. Common requests are: reading environment variables, setting system time, date, getting mac address, etc. The more you ask for, the more the library will be able to do. Once it's working, I'll post the code here for anyone who wants it.
Thanks.

Updated list of jni functions now supported (descriptions are self explanatory):
JNIEXPORT jstring JNICALL Java_Win32Native_sayHello (JNIEnv *env, jobject);
JNIEXPORT void JNICALL Java_Win32Native_setSystemTime (JNIEnv *env, jobject obj, jshort hour, jshort minutes);
JNIEXPORT jstring JNICALL Java_Win32Native_getMACAddress (JNIEnv *env, jobject obj);
JNIEXPORT jlong JNICALL Java_Win32Native_createMutex (JNIEnv *env, jobject obj, jstring strMutexName);
JNIEXPORT jlong JNICALL Java_Win32Native_getLastError (JNIEnv *env, jobject obj);
JNIEXPORT jlong JNICALL Java_Win32Native_getErrorCode (JNIEnv *env, jobject obj);
JNIEXPORT jboolean JNICALL Java_Win32Native_isRunning (JNIEnv *env, jobject obj, jstring strMutexName);
JNIEXPORT jstring JNICALL Java_Win32Native_getWindowsDirectory (JNIEnv *env, jobject obj);
JNIEXPORT jstring JNICALL Java_Win32Native_getSystemDirectory (JNIEnv *env, jobject obj);
JNIEXPORT jstring JNICALL Java_Win32Native_expandEnvironmentStrings (JNIEnv *env, jobject obj,jstring strSource);
JNIEXPORT void JNICALL Java_Win32Native_lockWorkstation (JNIEnv *env, jobject obj);
JNIEXPORT jstring JNICALL Java_Win32Native_getFileTime (JNIEnv *env, jobject obj, jstring strFileName);
JNIEXPORT jlong JNICALL Java_Win32Native_getTickCount (JNIEnv *env, jobject obj);
JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceFrequency (JNIEnv *env, jobject obj);
JNIEXPORT jdouble JNICALL Java_Win32Native_queryPerformanceCounter (JNIEnv *env, jobject obj);
JNIEXPORT jint JNICALL Java_Win32Native_getHwnd(JNIEnv *env, jobject obj, jstring title);
JNIEXPORT void JNICALL Java_Win32Native_setWindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag);
JNIEXPORT jstring JNICALL Java_Win32Native_getDriveType(JNIEnv *env, jclass obj, jstring strPath);
JNIEXPORT jlong JNICALL Java_Win32Native_getDiskFreeSpace(JNIEnv *env, jclass obj, jstring strPath);
JNIEXPORT jstring JNICALL Java_Win32Native_getEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable);
JNIEXPORT jboolean JNICALL Java_Win32Native_setEnvironmentVariable(JNIEnv *env, jclass obj, jstring strVariable, jstring strValue);
JNIEXPORT void JNICALL Java_Win32Native_rebootPC (JNIEnv *env, jobject obj);
JNIEXPORT jboolean JNICALL Java_Win32Native_moveFile(JNIEnv *env, jclass obj, jstring strSource, jstring strDestination);
JNIEXPORT jboolean JNICALL Java_Win32Native_installFilters(JNIEnv *env, jclass obj, jint hInstance, jstring strTitle, jlong tmNow);
JNIEXPORT jboolean JNICALL Java_Win32Native_killFilters(JNIEnv *env, jclass obj);
JNIEXPORT jlong JNICALL Java_Win32Native_getCurrentTime(JNIEnv *env, jobject obj);
JNIEXPORT jlong JNICALL Java_Win32Native_getHinstance(JNIEnv *env, jobject obj, jstring title);
JNIEXPORT jint JNICALL Java_Win32Native_createProcess(JNIEnv *env, jobject obj, jint nMode, jstring cmdproc, jstring buff );
JNIEXPORT jint JNICALL Java_Win32Native_createLink(JNIEnv *env, jobject obj, jstring strPathObj, jstring strPathLink, jstring strDesc );
JNIEXPORT void JNICALL Java_Win32Native_launchDefaultBrowser(JNIEnv *env, jobject obj, jstring strURL );
JNIEXPORT jboolean JNICALL Java_Win32Native_emptyBrowserCache(JNIEnv *env, jobject obj );
JNIEXPORT jboolean JNICALL Java_Win32Native_sendFileToRecycleBin(JNIEnv *env, jobject obj, jstring strFilePath);
Thanks to those who made suggestions. Certainly open to more ideas.

Similar Messages

  • Developing Java Applications for Windows CE

    Hello,
    I hope this sub forum is right. So I must develop a Java Application for Windows CE. I read something about J2ME, but I think this is only for Mobilephone and Windows CE supports AWT. So I tried just some simple forms with J2ME.
    Can anybody tell me how I develop java Applications for Windows CE? Can I use Eclipse or must I use another IDE?
    Realy I developed Swing 5-6 Month but I have no idea how I develop Java Applications for Windows CE.
    Thanks a lot for helping...

    The MIDP for Palm OS 1.0 requires Palm OS v3.5 or higher to run. According to your error message, the emulator is not running v3.5 or higher. Try to get hold of a ROM image with a later version. I've run it with v4.0 of the OS and it works.

  • SQL Developer install problems for Windows 7 Home edition

    Hi there,
    I understand Windows 7 64-bit is not supported for oracle 11gR2 but I installed it anyway.
    This is not my problem.
    I am trying to install SQL Developer and am getting this error when I click on the set up:
    Unable to launch the Java Virtual machine, located at path:
    C:\Program Files(x86)Java\jdk1.6.0_21\bin\msvcr71.dll
    When I check the version of my java it is correctly displaying 1.6.0_21 for my 64 bit.
    I read that you need the 32 bit one installed as well and I do. In my Program Files there is a java and a \jdk1.6.0_21 folder. In the bin directory it does not have this .dll:
    msvcr71.dll
    Is that the problem, because i have heard of other people getting sql developer working on their Windows 7 home laptops but they are old posts and I'm not getting any reply.
    I also changed the Environmental variable for the path, such as:
    C:\Program Files (x86)\Java\jdk1.6.0_21
    C:\Program Files (x86)\Java\jdk1.6.0_21\bin
    C:\Program Files (x86)\Java\jdk1.6.0_21 /bin
    and none of the 3 above worked for me either.
    Any suggestions are appreciated!

    I unzipped the sql developer download to C:\Windows and it unzipped fine. I went into my folder of sql developer, double clicked the sql developer.exe and it asked for the path for java. I clicked Browse and the default was C:\Program Files(x86)\Java\jdk1.6.0_21\bin so I chose the java from this folder. It accepted the argument, tried to start sql developer, and came up with the same error, so something is still not right that I am not understanding??

  • Developing Java application for windows CE based Handheld device

    Hi everybody,
    I am planning to develop the java application for windows CE
    based handheld device.I came to know that Oracle 9iLite supports
    the Developement of Java Application for windows CE devices.Can
    i use the JDeveloper IDE to develop the application on windows
    NT.If so how to deploy the application on windows CE device(Is
    there any options in Jdeveloper to deploy the application).Any
    body please give the solution.
    Regards,
    Siva mani kumar.D

    I agree. In my opinion Sun has done a horrible job documenting all this madness for the average developer just starting out with this stuff. There is the CLDC, J2ME, Personal Java, J2ME-WTK, MIDP, MIDP-FCS ... maddness. Anyway after sorting through it all for a few days, I think the answer to your question you will need to use Personal Java for WinCE and the Sharp Zaurus, and MIDP for PalmOS for the palm. Jeode seems to be the most common and best Personal Java implementation and it is basically the JDK1.2.2 (or is it 1.1.8) that is designed to run on WinCE and Embeddix (such as Lineo on the Zaurus). You program it just like you would a 1.1.8 application and then you can test it by running pjava.exe which is included in the personal java 3.1 download from Sun. There is also a program called JavaCheck that will ensure that your app will run properly in PersonalJava. As for the Palm, MIDP for PalmOS is a 574K program that installs on your palm device. You then use the J2ME-WTK (wireless toolkit) to build a JAR/JAD file and you use the MIDP API to write the code.

  • Invalid file - SQL Developer 1.2 for Windows download

    I attempted to download the latest verion(1.2) for Windows with JDK and failed.
    Download process completes downloading the file, but it then complains that its not a valid ZIP file!
    cheers.
    Manod

    It's not a bug. There can be a number of reasons why, when you attempt to download a file, you do not get the full download. One of which is just that you lose the connection and that can depend on where and when you download, another is that there can be fire wall issues on the client site. There are times when the issue is on the Oracle side and this too can be as a result of different things. In this case, there is a specific OTN forum for site issues. I have not seen any such mention of a problem or a downtime or anything else in the past few weeks. All I meant is that if you have a problem with a download, you might try again later. We have had a few thousand SQL Developer downloads in the past few days, so there is no issue on our side.
    Sue

  • Error Downloading SQL Developer 1.1 for Windows w/o Java

    I've now tried 3 times to download sqldeveloper-1.1.2.2579-no-jre.zip . WinZip cannot use it and indicates that there has been a download failure. Then, in Netscape and IE I now get the message
    Downloading the file sqldeveloper-1.1.2.2579-no-jre.zip.
    InterScan Web Security will check the file after the download is complete.
    NOTE: Do not click Refresh or Back, or navigate to another page or the download will fail.
    InterScan Web Security detected the following in HTTP traffic:
    Item: http://download-west.oracle.com/otn/java/sqldeveloper/sqldeveloper-1.1.2.2579-no-jre.zip
    Action: deleted
    Reason: Violation of a compressed file restriction
    -- File: sqldeveloper-1.1.2.2579-no-jre.zip, security warning: Exceed_File_Count_Limit
    The uncleanable file is deleted.
    Hope you can help!!

    I was able to download sqldeveloper.exe for windows which I realised later wasn't for Desktop OS. Can you suggest to me one which works on Desktop windows?

  • Developing desktop applications for windows

    Hello
    I am currently doing a final year project which is an encryption software for the company that i did my placement with. i have done the core part of the program but i need to know how to make it look professional. i need to be able to have it as an installable desktop application (Only for Windows), with an icon provided by me which is used when files are encrypted using the application. i have no idea how to achieve this effect and i seek knowledge.
    thanks in advance for your help

    There are many levels of professional software in my opinion. There is software that works, meets the requirements and doesn't crash. That's professional in the sense that it does what it is supposed to and does it well. People pay for that even if its green-screen non-GUI based. TONS of stuff still working/written for non-GUI environments and plenty pay for it.
    When related to Java and desktop applications, I feel there is only truly one real way to brag you have written a professional software suite. That is when your application not only adheres to what it should do, but provides a means to extend it without having to wait for major releases, and the UI is VERY consistent, not cluttered, not tons of buttons/menus/dialogs/windows all over the place and the underlying coce of the app is truly written well to make good use of areas of Java such as resources (properly closing files when not using them, returning DB connections when done, using WeakReference of nulling out refs to objects no longer needed). It is very very easy to cause a memory leak in a java application if you do not watch at all times for object refs that are left hanging.
    By extensibility, I mean providing some means of plugging in new pieces of code to enhance the product or fix existing issues (bugs) and providing a simple update facility that can either auto-update, or allow an install to add the update.
    It is exactly these reasons that keep me plugging away on my plugin engine (www.sourceforge.net/projects/genpluginengine) and UI framework built around plugins. While the engine is almost done and is very similar to the Eclipse plugin engine, the UI framework will be ongoing for some time. Making a very professional read-to-run-out-of-the-box free/open-source framework built on high-quality well tested plugins is not easy to accomplish with a couple hours a week and only me and one other doing it. I would love to get more help shortly, adding tons of great features that all developers could benefit from, and soon I will start asking various java boards for help, see if anyone is interested in contributing. The goal is a professional looking, solid underlying code, well/highly tested UI framework that can be used by anyone to quickly build their specifics and not worry about the more common UI application stuff such as file i/o choosers, help, preferences, authentication, access levels/rights, views and editors, and more. With a 3rd project working to add tons of Swing UI components, the final UI framework will provide a number of high-quality components like rounded/shaded/gradient filled panels with shadowing, calendar/date pickers, wizards, and more, again all highly tested to ensure ultimate quality.
    If you are interested, feel free to post back to this response with email, or join up at the above mentioned sourceforge project and start contributing to the mail list.

  • Design Premium CS3 for windows Want to download Design Premium CS3 for MAC instead

    I have design premium CS3 for windows.  My Windows machine is dying and I have a MAC now.  I'd like to download design premium CS3 for the MAC and abandon my licenses on the Windows machine, then pick it up on the MAC.  Is that possible?

    Not any more. Only CS6 is eligible for the PC to Mac swap. If you do not want to buy that all over again, the $50 monthly Creative Cloud is the best way.

  • Does any one know of a property rental software to track rents and expenses for multiple properties that works on the IMAC?  Quicken Rental Property is only supported for Windows.  Any suggestions appreciated.

    Has any one found a comparable software for IMAC that could replace the Quicken for Rental Properties that is only supported for windows?

    And Google found
    http://property-management-software.findthebest.com/d/a/Mac-OS-X

  • How to develop a Library for Windows Phone 8.1?

    Hello guys!
    I'm a quite new developer in this topic, I have never created a Library and right now, I need to create a library using this project of C because the normal OCRs cannot recognize 7 segments display:
    https://www.unix-ag.uni-kl.de/~auerswal/ssocr/
    Last year, I used a library for SQLite (in the beginning it didn't have a Nuget package) and you must add a C++ project to execute SQLite code in WP8. I hope someone might give me an idea where to read and help me with this project. Thanks a lot
    for your worthy knowledge.
    Federico Navarrete

    I need to use a special OCR that detects 7 Segments Displays. I have been reading during the week and I discovered that the most similar project is this one:
    Seven Segment Optical Character Recognition
    However it's a C project not a C# or VB and I must create a special library (or project) to integrate with my Windows Phone App. As I said before last year I used this article:
    How to use SQLite in Windows Phone
    And in the beginning it was just a C++ project that you must add to manipulate SQLite. So, I think I should create something like that for migrate those libraries and later integrate with my project but I have never worked with this kind of libraries
    or create C/C++ libraries that finally will work with a C# App. Thanks for your time.
    Federico Navarrete

  • Installing Developer Suite 10g for Windows

    As part of a prototype test for upgrading to 10g we have installed Oracle 9i database onto a Windows XP PC and are now trying to install the developer suite 10g.
    The ORACLE_HOME directory for the DB is D:\Oracle\ora92.
    The Oracle Uinversal Installer defaults to this directory for Oracle Home when we try to install the 10g software, but we then get the following error:
    Dependencies
    Oracle Developer SUite 10g cannot be installed into an existing Oracle 9i 9.2.0.1.0 or higher Oracle Home.
    Could you advise please.

    Yes, and got the message - install has encountered an error while attempting to verify your virtual memory settings....
    We have changed the paging size for the D: drive where we were trying to load to - and it has loaded OK now thanks.

  • IPod repair routines for Windows platform?

    iPod harddrive volumes running on Mac platform can be "repaired" using Disk Utility ( or Third Party apps) to, sometimes, avert the need to fully restore (and thereby erasing) an iPod to healthy functioning.
    Is there such an application or system routine to tune up flash-drive based iPods
    running on Windows platform ( or Mac for that matter)?
    Thanks in advance for any comments.

    sorry, I posted this to the wrong discussion but I will leave it here so as to not double post.
    Thanks.

  • Java Developer's kit for windows XP

    Hello.
    I just upgraded one of my computers to windows XP. I would like to start learning to program in JAVA. I have been running the program with linux but now i want to play with it under windows XP. I started to download the Java Developers kit (JDK) but i'm not sure it will work under windows XP. Any help Thanks Bill Nash.
    [email protected]
    www.wrnash.net

    Yes, it will work. Welcome to Java.

  • I need a USB Headset with Mic to use for Webinar's and Go To Meeting sessions. There looks to be very few options that work with the Mac as they seem to be designed for Windows.  Any suggestions on equipment?

    I am looking for a binaural USB headset with microphone to use during Go To Meeting sessions and Webinar's. Seems to be little that works with the iMac and most of the web searches have not been encouraging. Any suggestions on units that work.  I have a new iMac running Snow Leopard 10.6.8.
    Bob

    I am looking for a binaural USB headset with microphone to use during Go To Meeting sessions and Webinar's. Seems to be little that works with the iMac and most of the web searches have not been encouraging. Any suggestions on units that work.  I have a new iMac running Snow Leopard 10.6.8.
    Bob

  • Error: iTunes for Windows: Moving your iTunes Media folder

    I needed move this folder itunes, because my HDD is full.
    I think move this folder to new HDD.
    I made step by step, this kb:
    http://support.apple.com/kb/HT1364?viewlocale=en_US
    But have error!!!!!!
    I moved all files, but the iTunes not list (not show) my musics, my apps buy, my photos.
    I Using the Windows Eplorer (windows 7), I saw all files in new file.
    How did make process?
    Plese help me

    I figured out myself.

Maybe you are looking for

  • Enter G/L account error while uploading open contracts using lsmw

    Hi Experts, I have a flat file for Open Contracts.While trying to upload using LSMW -BAPI method(BUS2014), it is throwing error as 'Enter G/L account' though G/L is present in the flat file.I have done with the mapping in the 5th step. Checked all th

  • How do I transfer my Firefox environment to a new image?

    I losT my ability to run my Windows XP Firefox on disk A. I have Created another one on disk B. I want to have the same Firefox setup on disk B. I can get to the files and data on disk A but can't run it. Is it possible to either figure out what add-

  • What software do I need to install to get "Data Mining Framework"

    Hi, from edelivery.oracle.com I have downloaded: 1. Hyperion Essbase - System 9 Release 9.3.1.2 Server Windows Installer 2. Essbase Administration Services Release 9.3.1 Windows Installer I installed both software and I started Administration Service

  • QUESTION:  in Adobe Reader 9, i cannot shut off the pale blue color on

    my files.  it appeared one day unwanted and un-announced, like a bum on my doorstep.  i use Skype extensively.  its an extra step to click on the Adobe window to shut off the pale blue color, so i can read the page clearly when my Skype window is ope

  • Re-install iLife after MacBook factory restore ?

    Hey guys ..... after a little help please. I have just reset my MacBook to factory settings by wiping the HD and re-installing Snow Leopard. The OS has reinstalled fine and the computer is now behaving like a brand new machine (ie. the "welcome" show