-1

I need to access the windows native file upload and save window using java.

Though it is not possible only using java so I try this using jacob and JNA library.

Actually I also need to handle the any type of pop up message from OS.

There are lots of any other approach using java robot,sikuli,autoit but i want to stick(learn)

on jacob or jna.

Can any body help me regarding this problem.Any code snippet on this, helpful for me not only that if some body told me how to get hwnd ID dword ID which is need to pass into the different methods that also be useful for me.

saba
  • 539
  • 1
  • 14
  • 30

1 Answers1

0

Im guessing you were referring to CFileDialog or OpenFileDialog, well that can be accomplished via JNI and a native DLL which you need to compile yourself, which is somewhat easy:

  • create a C++ DLL - project in visual studio, i'd recommend using MFC - methods which are called via C-functions, that'll make everything MUCH easier since you wont need to re-invent the wheel and create WindowProcs yourself and whatnot - MFC does all of that transparently. You could also create a CLR-DLL which uses WinForms but thats a bit more complex. Do yourself a favor and disregard anything about MinGW, GCC or even any other OSS-solution if you want to create native windows ... that'll give you headaches, trust me. Within windows, you will need to use microsoft-libraries if you want to create Microsoft-compatible user interfaces, everything else is very error-prone.
  • include jni.h which is found in your JDK-library
  • write a JNI-compatible method signature
  • compile
  • declare compatible, native methods in java
  • compile
  • try to run your java project
  • report back, i shall help you to some extent if you run into any problems

JNI howto

specializt
  • 1,913
  • 15
  • 26