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:Michael Brewer-Davis (mich@tech4learning.com)
Date:Sep 2, 2008 10:38:41 am
List:net.java.dev.jna.users

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.)

michael