Getting (WHND) of windows applications

Hi,
I am trying to develop an application that on windows retrives the handles of a couple of native windows applications, to see if I can remote controll them using the message quea. I am not sure this is the right forum, but the one that seems to match most. I have unsuccesfully tried a couple of other forums.
Does some one know how to retrieve a handle from another application please?
Even without using J/Direct please?
Thanks in advance.
Michael (fairly inexperienced)

Getting the HWND of a Win32 application depends largely on your understanding of the Windows architecture. There are two main approaches from a total-solution perspective. BOTH perspectives rely on Java Native Interface API, but they use it differently. After you decide which of these two options to choose, you need to ask yourself, What input parameters can I provide to determine which Window's HWND I need?
1. Use the JNI, or a third-party library based upon it, to map individual Win32 API calls (like EnumWindows) into a Java class. Then write a Java program that calls these Win32 methods tagged as native in Java. This is the strategy used to implement the Standard Widget Toolkit, by the way...
2. Use the JNI, but in a different way, to call a more complicated Win32 procedure (rather than just the basics of JNI, which allow you to call a DLL which was written in C.) You could use Njawin, for example, to call into a COM DLL (like a Visual Basic application) which itself provides a more complete solution to the problem. APIs like Jawin, JIntegra, Njawin, and JacobGen will take a complicated Win32 binary module (a DLL, TLB, etc. depending upon which solution we're talking about) and interoperate it with Java, allowing you to retrieve Pure Java return types, call methods synchronously or asynchronously, etc.
If you are going to be invoking further native functionality after you get the HWND (as you hinted with the message queue), you will probably want to go with Solution 2; coding directly to the Win32 API is not necessary in many situations. If you need to use JAVA as the front end to your program, but you want a lot of native functionality, then:
1. Write all your native functionality in a high-level, object-oriented, COM-enabled Win32 programming language like Delphi, VB, C++, etc.
2. Code the main native procedure into a public object inside a COM DLL, and use JacobGen or Njawin to be able to call that method from inside Java.

Similar Messages

  • Can I get the Write window in the foreground when called from another application?

    When windows applications create a new message through thunderbird (quickbooks wants to send an invoice for example) the new message appears in the background and bothers the user who prefered the way outlook would pop up newly created messages in the foreground. The foreground popup is the preferred work flow as the operator clicks 'send invoice' and then the message pops up for review and for the operator to hit send. Now migrating to Thunderbird, in frustration the user is creating many drafts but not always sending the invoice.
    How can I set Thunderbird to popup a new message window in the foreground in this case?
    Thanks in advance.

    Hi, I have the same problem, any version of TB, win7x64 or winXP32... for me is not a problem, but less experienced users, or old people, get puzzled by not seeing the expected window, and usually keep trying, ending with multiple "compose" windows, until they realize they're open in the background...
    I'm trying to get around this using a small free utility I already have in my windows startup folder: Deskpins (see http://www.snapfiles.com/get/deskpins.html). This little app, which sits in the taskbar icon area, can force any window stay on top, (visually) "pinning" it also. Very handy. This little gem also has an optional "autopin" feature, which can "intercept" a new window by class & title (with wildcards). Which windows to intercept,y ou define creating specific rules, from its help:
    <<
    You can configure DeskPins to automatically pin certain windows as soon as they are created. This should be useful in case you always want to make an application topmost (e.g. Calculator, console windows, etc).
    Rules
    You can specify which windows will be auto-pinned by adding auto-pin rules (see Autopin options). Every time a window is created, DeskPins will check whether it satisfies any rules, and if so, it will pin it. A rule consists of two parameters: a title and a class, which are explained below. Both parameters can contain DOS-style wildcards (* and ?) and they are not case sensitive.
    >>
    I tried, and it seems to work.
    when a new "compose" window is created, even when "sending a file to recipient" using windows standard tools (eg: right click on file and send>mail recipient) now I see the window "on top" and is "pinned"... of course it would have been much, much better to have a native better behaviour, but in the meanwhile... this could work. Maybe similar solutions are available for other OSes...
    Marco

  • I'm trying to load photoshop elements 12 on my mac os x and when i click setup.exe i get :    You can't open the application "Setup.exe" because Microsoft Windows applications are not supported on OS X.

    i'm trying to load photoshop elements 12 on my mac os x and when i click setup.exe i get : You can’t open the application “Setup.exe” because Microsoft Windows applications are not supported on OS X.  The premiere elements 12 out of the same box loaded just fine.

    An .exe file means you have the windows version. Go get the mac version:
    Download Photoshop Elements products | 12, 11, 10
    but I hope you have a mac serial number.

  • Compressor 4 crashes on opening keep getting this warning: The application "Compressor" unexpectedly quit while trying to restore its windows.  Do you want to try to restore its windows again? Tried Restoring windows. It crashes again.  Tried not = Same r

    Compressor 4 crashes on opening keep getting this warning: The application “Compressor” unexpectedly quit while trying to restore its windows.  Do you want to try to restore its windows again? Tried Restoring windows. It crashes again.  Tried not = Same result.  This is the first time I've actually used the app although I purchased it back in April (I think).  I had my first longform project completed in FCPX and tried sending it to Compressor 4 and got this result over and over again. 

    Steve,
    Sorry to say I've not had any success in getting Compressor 4 to work.  I've tried every suggestion mentioned earlier on this topic to no avail.  Compressor 4 is dead in the water.  On the last two projects I had to go back to Compressor 3.x.xx to complete the projects.  The only hint that I have of wha may have happened concerns something I did early on.  When I bought this computer I decided to replace the hard drive with a larger one.  Since I already had my software up and working on the drive that came with the computer I decided to clone everything to the new larger drive.  As I recall, Compressor 4 worked on the original drive but it doesn't work on this cloned version.  So maybe there is a relationship there.  I haven't had a chance yet to reinstall my old drive and see if C 4 works on it.  If it does work then I know the source of the problem but not how to fix it on the new drive.  Did you do anything like cloning your drive recently too?  It's just a thought and may not lead anywhere but later this week when I catch a break I'll give the old drive a try and will post my results.
    Thanks,
    Peter

  • Get LNK2005 error when use cvi.lib in windows application VC++

    The typical error is:
    libcmtd.lib(fflush.obj):error LNK2005 _fflush already defined in cvi.lib(cvirte.dll)
    The errors do not occur in a console application.

    The libcmtd.lib is not my own library. It is VC++ windows library. There are some conflicts between cvi.lib and MS libcmtd.lib. The errors do not occur in console application. I used nivxi.lib in my windows application but the linker gave errors of lnk2001 unresolved external symbols which I found in the cvi.lib. So I also used cvi.lib. Then the linker gave LNK2005.
    My question is what libraries should I use to control vxi instruments in my VC++ windows application? In my application, I use functions such as initVXIlibrary(), closeVXIlibrary(), WScmd(), WSwrt(), VXIinReg(), etc.
    Attachments:
    vxitest.cpp ‏1 KB
    VXIDevice.h ‏1 KB
    VXIDevice.cpp ‏2 KB

  • How can I get back into my application aftermath invoking Start up page of index.htm ?

    Gorgeous Hello All,
    If anyone of you can please provide me a solution for the following, will help me in plentious and galore.
    Am using Adobe RoboHelp, Version 10 and IE version being 10.
    A hurdle :-
    I have a application which has been developed in ASP .NET, Version 4.0. Help link has been created in this application wherein here the Start up page of index.htm has been linked to be read from the RoboHelp local project folder\!SSL!\Multiscreen_HTML5\desktop. All are working absolutely fine except when
    I login into the above-said application -> click on the Help page -> the index.htm opens with Contents, Index, Glossary -> Am able to successfully perform any task by respective clickings
    -> But I am not able to get back into my application when I click on the IE provided Back button (Alt+Left) -> Any amount of invoking Back button makes the system getting looped into this Start up page of index.htm only -> When I Close Tab (Ctrl + W) or Close ( X ) -> The window session gets closed and I have to repeat all by relogin once again.
    How can I get back into my application aftermath invoking Start up page of index.htm ?
    (I can always get back into the application easily by erasing those parts in the url which refers to this RoboHelp linkages – but this certainly looks non-polished work)
    Help Please
    Cheese – Vipin Nambiar, Bangalore

    Hey Jeff, I used Internet Explorer 10.0.9200 and Google Chrome 26.0.1410. Alas - it is the same behavior.
    (But Jeff : When I used Microsoft HTML Help as primary layout to generate chm file , My Help when launched from my Application opened in a new browser window and when I closed this Help browser window did not close my application. Looks like need to write few liner code to get this issue settled )
    Thanks Indeed of lots for your concerns Jeff !!!

  • Can Bootcamp and Parallels share the same Windows applications and data?

    I'm looking at getting an Intel iMac which will let me throw away my old PC - Yeah!
    I will have a couple of Win apps that I will need to hang on to (Quicken - Quicken for Mac is horrible, but that's another tghread). Anyway, can Bootcamp and Parallels share the same Windows applications and data?
    My thought would be to allow my wife to access Quicken from Parallels and not have to reboot. She will only need lightweight access and the overhead of running virtualization wouldn't impact her. I, on the other hand, would want to occasionally boot natively into Windows and run the same application with the same datafile. Is this possible?
    Thanks and looking forward to joining the MacIntel world!

    Thanks for all of the freplies. I suspected that BootCamp and Parallels could not shar ethe same partition, but wanted to verify. To address some of the other posts:
    Re: Quicken vs MoneyDance - I looked at MoneyDance a while back and while it is comparable to Quicken for Mac, it isn't comparable to Quicken for Windows (ergo, Quicken for Mac isn't comparable to Quicken for Windows!). But, as I said, that is a topic for another thread!
    Re: Using Bootcamp/Parallels for only one app: I actually have several apps that I still need access to on Windows. I work with many business applications than only run/are supported on Windows as well as receive some complex Office documents which Office for Mac cannot handle. Quicken (for Windows 2007) was just the best example of a consumer app where I could see wanting access from both OS X and Windows.

  • Installing windows application with crystal reports runtime on 64 bit

    I have a windows application created on 32 bit windows xp platform using visual studio 2005 with oracle 10g as database and crystal reports XI as reporting tool. The platform on which the application was created has Oracle 10g 32 bit Client, Crystal Reports Developer XI R2 and Crystal Reports XI Server Client. The application has to be installed on 64 bit Windows 7 machine. The application fails with following error
    An error has occured while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient or Crystal Reports runtime is not installed correctly.
    Please install the appropriate Crystal Reports redistributable (CRRedist.msi) containing correct version of Crystal Reports runtime (x86, x64, or Itanium) is required. Please go to http://www.businessobjects.com/support for more information.*

    We have an Windows Forms apps developed in VB.NET 2005 using Reports Documents from Crystal Reports XI R2 Server. The application is running fine on 32 bit Windows XP machine. We are trying to install the application on 64 bit Win 7 machine. We are getting following error while doing so
    An error has occured while attempting to load the Crystal Reports runtime. Either the Crystal Reports registry key permissions are insufficient or Crystal Reports runtime is not installed correctly.
    Please install the appropriate Crystal Reports redistributable (CRRedist.msi) containing correct version of Crystal Reports runtime (x86, x64, or Itanium) is required. Please go to http://www.businessobjects.com/support for more information.*
    We have installed "Crystal reports XI R2 SP4 full build" and "SP6 incremental". We have also installed "CrystalReports11_5_NET.MSI from CR XI R2 FP 6.4 .NET Server Install" as well as "CRRedist2005_X64.msi".
    We are still getting the same error.

  • How do I get home page window to appear when opening FF?

    How do I get my homepage window to appear when I open FF?
    When I go to the dock and click on the FF icon,
    ''Firefox ''appears in the menu bar but there is no home page window showing. I have to go to ''File'' and select ''New Window'' to get to my home page window.
    In FF Preferences I have selected:
    "Show my home page" and the correct home page address is shown.
    I deleted FF application/program (dragged to trash can) and then re-installed it. That did not help.
    I occasionally use Safari and there is no problem with the home page showing right away when I open Safari.

    The file you need toi backup is name domain.sites2 and is located in your Users/Home() /Library/Application Support/iWeb folder.  Without that file you won't be able to continue to edit and maintain your website.
    However, remember this:
    NOTE: In Lion and Mountain Lion the Home()/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    So if you're running Lion or Mt Lion you'll need to make that library visible before you can find and backup the domain.sites2 file.

  • How can I get rid of windows 8.1 in my new lenovo and get windows 7 put in?

    How can I get rid of Windows 8.1 on my new Lenovo laptop and install Windows 7?

    Hi,
    I'll assume your laptop was upgraded from Windows 7 to Windows 8.1
    1. Start by copying all your personal folders (Documents, Pictures, Music, Videos, Favourites, local databases,
    hosts files, etc) into an external disk, DVD, tape, whatever.
    2. If I were you, I wouldn't use Windows 8.1 backup tool, I'm not sure Windows 7 Restore applet will be able
    to read a Windows 8.1 backup.
    3. Check that you have all the necessary licenses, CDs and executables to reinstall your former Windows 7
    applications, components, browsers, plugins, Java, .NET Frameworks, etc. Be aware that some applications require
    to keep same hostname and/or same IP and/or or same local username (or all of them) as they were on the original
    Windows 7 machine.
    4. Check that you have your Windows 7 CD and license handy.
    5. Do you have a Windows 7 image backup of your laptop (prior to the Windows 8 upgrade)?
    5.a Yes? Then restore that image and restore your personal folders on top. You might need to
    install or reinstall some of the applications I mentioned on #3
    5.b No? You'll have to format your laptop, install Windows 7 from scratch, create your local
    user with administrative rights, install SP1, install necessary updates, reinstall all your
    applications and finally restore your personal folders.
    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

  • KEEP GETTING "Unsupported 16-Bit Application" when trying to download Blackberry Link-I need music on my device!!

    KEEP GETTING  "Unsupported 16-Bit Application" when trying to download Blackberry Link.  Im trying to sync music into my new Z10.  here is the whole error message:
    "\??\C:\User.....................cannot start or run due to incompatibity with 64-bit versions of Windows.  Please contact software vendor to ask if a 64-bit Windows comapatible version is available
    Any know how to transfer music without using this Blackberry link?  Is there a quick fix to my problem? Any help would be appreciated.  Thanks

    Just download the Link application directly to your PC, not with your BlackBerry connected.
    There's no need for the connection while your simply downloading the install file.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Uploaded document via windows application does not show in document library, but as checked out Document

    Hi,
    A windows application uploads document to a document library programatically. Although they get added to the document library but are not shown there. Only when I go to the "Managed file that have no checked in verison" I see all the documents.
    This happens even though I have set "No Versioning" in the library settings. This is probably happening because I have added a few custom columns to the library.
    How can I avoid this situation and get to upload document which can directly be seen on the document library rather than first taking control of the doc and then checking it in?

    Hi,
    When uploading files without filling in some required columns, the files would appear in “Checked Out Files” page.
    To avoid this situation, you can modify that windows application to force users fill in the required columns or just define default values for those columns.
    You can take a look at the link below for more information:
    http://dlairman.wordpress.com/2013/03/13/favorite-sharepoint-feature-this-week-manage-files-which-have-no-checked-in-version/
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • How to use original java VM in microsoft windows applications

    I have seen few applications like of Oracles, They use Java Beans and classes in the windows applications.
    Can any one of you tell me how can i use java classes in Windows applications(through oroginal java VM only, not by microsoft Java VM).

    actually i think they use the same way i use in my applications:
    i have Microsoft Visual C++ 6.0 by which i write a windows program interface (like oracle) then create from inside it, in reflection to a button event for example, a procedure which runs "javaw.exe -cp ... MyJavaProgram.class" this java program executes in its own work space and i can terminate it from within my C++ program, but i can't get data from within it directly, i use the DBMS as a way to get data from within it.
    but i'm not tried for example to run java bean directly in my VC++ program, emaple, not run swing component inside my VC++ main window Created by Visual C++
    that is what i'm doing. i hope there is a better way to do so because i don't like it that way i do.

  • Windows application design methods?

    New to Java I'm having the same problems as others... totally incomprehensible behaviours and jargon. I need to get Windows application made.   Is there a graphical, drag&drop  layout tool in which I can place 'controls' such as buttons, panels, toolbars onto a window then write the code to respond to them? It seems to be commonplace in other systems.

    New to Java I'm having the same problems as others... totally incomprehensible behaviours and jargon. I need to get Windows application made.   Is there a graphical, drag&drop  layout tool in which I can place 'controls' such as buttons, panels, toolbars onto a window then write the code to respond to them? It seems to be commonplace in other systems.
    I suggest that the FIRST skill you learn is how to find information on the internet.
    IMHO that is FAR MORE IMPORTANT than any other single skill you might acquire.
    The NetBeans IDE is a popular one for Java and The Java Tutorials has trails specifically for it.
    "Hello World!" for the NetBeans IDE (The Java™ Tutorials > Getting Started > The "Hello World!" Appli…
    For more advanced application work involving web applications Oracle provides JDeveloper.
    Oracle JDeveloper - Official Home Page
    Both of those products can be freely downloaded.

  • Windows Application Starting Point

    Does a basic (and best practice) framework (or netbeans like project) exist for a java windows application that would include menuing and initial windows classes?
    I have decided to create a application in java and it will be a windows gui application. I understand how to do this but it seems like this would be something someone else has already done. Kind of a starting point for an application. Does something like this exists? I searched online but didn't find anything. Maybe this is because I'm not sure what I'm asking for.

    I haven't seen any nice GUI frameworks for Java, beyond what Java already gives you. It would depend somewhat on what the app does. And you have to decide if you want to use Swing or SWT. Based on a previous thread, it would seem there are also some GUI builder tools out there, if you don't want to hand code it, but they won't produce very nice code; they just help prevent you from having to write it yourself. If this is your first jump into Java GUI, here is a quick Hello World app I just threw together in using Swing; it's a starting point anyway, and might help you get going:
    import java.awt.FlowLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowEvent;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    public class HelloWorld {
         public static void main(String[] args) {
              // Code that affects the GUI should be run on the Event Dispatch thread;
              // Calling launchUI() using SwingUtilities.invokeLater(...) takes care of this.
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        launchUI();
         private static void launchUI() {
              final JFrame frame = new JFrame("Hello World");
              JPanel panel = new JPanel(new FlowLayout());
              JLabel label = new JLabel("Hello World!");
              panel.add(label);
              panel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
              JMenuBar menuBar = new JMenuBar();
              JMenu menu = new JMenu("File");
              JMenuItem menuItem = new JMenuItem("Exit");
              menuItem.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent event) {
                        // This action will be fired when the Exit menu item is selected;
                        // firing off a Window Closing event is basically the same thing
                        // pressing the window close button in the corner does.
                        WindowEvent windowClosingEvent = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING);
                        frame.getToolkit().getSystemEventQueue().postEvent(windowClosingEvent);
              menu.add(menuItem);
              menuBar.add(menu);
              frame.setJMenuBar(menuBar);
              frame.setContentPane(panel);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setLocationRelativeTo(null);     // this centers the frame
              frame.setVisible(true);
    }

Maybe you are looking for