5 messages in net.java.dev.jna.usersRe: [jna-users] Trouble getting start...
FromSent OnAttachments
David HampsteadSep 1, 2008 2:16 pm 
Michael Brewer-DavisSep 2, 2008 8:28 am 
David HampsteadSep 2, 2008 10:15 am.java, .java
Michael Brewer-DavisSep 2, 2008 10:38 am 
David HampsteadSep 2, 2008 11:02 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Trouble getting started with window enumerationActions...
From:David Hampstead (dave@yahoo.co.uk)
Date:Sep 2, 2008 11:02:45 am
List:net.java.dev.jna.users

I see thanks Michael. The reason I had the version of user32 was because that's
the one in the code snippet on the project homepage
https://jna.dev.java.net/#callbacks and I only found out about the examples.jar
after I'd written that test version and didn't notice that that version differed
from the actual version in the examples package.

Thanks for you help, I think I've pretty much got it now!

----- Original Message ---- From: Michael Brewer-Davis <mich@tech4learning.com> To: use@jna.dev.java.net Sent: Tuesday, 2 September, 2008 11:39:05 Subject: Re: [jna-users] Trouble getting started with window enumeration

Caused by: java.lang.UnsatisfiedLinkError: Error looking up function

'GetWindowText': The specified procedure could not be found.Native Method)CallbackReference.java:274)CallbackReference.java:296)Native Method)Function.java:282)Function.java:223)Library.java:204)Test.java:17)at com.sun.jna.Function.<init>(

Your User32 class should extend W32API, like the example version (why not just use the included example User32?)

The inside of it is that Windows defines two versions of many string functions--an ASCII version and a Unicode (wide char) version.  So user32.dll doesn't export GetWindowText, it exports GetWindowTextA and GetWindowTextW.  The W32API class takes care of these things, allowing you to call GetWindowText (and you can specify when creating the library which of these two you want, should you care.  Default is Unicode.)