
Chapter 2. Files


From:
   Java Win32 Hacks Using J/Invoke
   Gayathri Singh and Andrew Davison

Contacts: 
  Gayathri Singh
  gayathri@byteblend.com 

and

  Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th

  Web Sites for the book:
     http://fivedots.coe.psu.ac.th/~ad/winJava



If you use this code, please mention our names, and include links
to the book's Web sites.

============================
Files

There are eight hacks in this chapter.
The files and directories are: 

+---Hack 2-8 Context Menu
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---filecontextmenu
                       AddContextMenu.java

+---Hack 2-7 Associated Application
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---fileassociation
                       NewFileType.java
                       NewFileTypeUI.java

+---Hack 2-6 New File Type
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---newfiletype
                       NewFileType.java
                       NewFileTypeUI.java

+---Hack 2-5 Recycle Bin
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---recyclebin
                       RecycleBin.java
                       RecycleBinUI.java

+---Hack 2-4 File Operations
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---fileoperations
                       FileOperations.java
                       FileOperationsUI.java

+---Hack 2-3 File System Watcher
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---filesystemwatcher
                       FileSystemWatcher.java
                       FileSystemWatcherUI.java

+---Hack 2-2 Version Information
      compile.bat
      run.bat
   
   +---src
       +---jinvoke
           +---win32hacks
               +---versioninfo
                       Translation.java
                       VersionInfo.java
                       VersionInfoUI.java

+---Hack 2-1 File Information
       compile.bat
       run.bat
    
    +---src
        +---jinvoke
            +---win32hacks
                +---fileinfo
                        FileInfo.java
                        FileInfoUI.java


Each hack is in a folder that contains src folder with the source code, and compile.bat and run.bat to compile and run the code respectively.

Hack 2-1 File Information
Hack 2-2 Version Information
Hack 2-3 File System Watcher
Hack 2-4 File Operations
Hack 2-5 Recycle Bin
Hack 2-6 New File Type
Hack 2-7 Associated Application
Hack 2-8 Context Menu


Compilation and Execution
=========================

> compile
> run


Hack 2-1 File Information
> cd "Hack 2-1 File Information"
> compile
> run [ <path to file> ]
e.g.
> run C:\Windows\Notepad.exe



Hack 2-2 Version Information
> cd "Hack 2-2 Version Information"
> compile
> compile
> run [ < path to file> ]
e.g.
> run C:\Windows\Notepad.exe


Hack 2-3 File System Watcher
> cd "Hack 2-3 File System Watcher"
> compile
> run


Hack 2-4 File Operations
> cd "Hack 2-4 File Operations"
> compile
> run


Hack 2-5 Recycle Bin
> cd "Hack 2-5 Recycle Bin"
> compile
> run

Hack 2-6 New File Type
> cd "Hack 2-6 New File Type"
> compile
> run


Hack 2-7 Associated Application
> cd "Hack 2-7 Associated Application"
> compile
> run


Hack 2-8 Context Menu
> cd "Hack 2-8 Context Menu"
> compile
> run [menuText] [jarPath]
e.g.
> run "Check Version" "C:/versioninfo.jar"

-------
J/Invoke

A 30-day evaluation version of J/Invoke can be downloaded from
http://www.jinvoke.com/download. Unzip it and store in a directory.

The batch files in this directory (compile.bat and run.bat) assume 
that jinvoke.jar is located in c:\jinvoke\ 

---------
Last updated: 18th June 2008
