6 messages in net.java.dev.jna.users[jna-users] Fw: GetWindowModuleFileNa...
FromSent OnAttachments
Dominik JallJul 23, 2008 12:17 pm 
Michael Brewer-DavisJul 23, 2008 1:53 pm 
Michael Brewer-DavisJul 23, 2008 2:16 pm 
Dominik JallJul 23, 2008 4:23 pm 
Michael Brewer-DavisJul 23, 2008 4:50 pm 
Daniel KaufmannJul 26, 2008 1:15 pm 
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:[jna-users] Fw: GetWindowModuleFileName() callActions...
From:Dominik Jall (DJA@de.ibm.com)
Date:Jul 23, 2008 12:17:46 pm
List:net.java.dev.jna.users

Hi guys,

I am trying to get a list of all windows and print out all the corresponding module names for them using this code:

User32 user32 = User32.INSTANCE; Kernel32 kernel32 = Kernel32.INSTANCE;

user32.EnumWindows(new User32.WNDENUMPROC() { int count; public boolean callback(HWND hWnd, Pointer userData) { System.out.println("Found window " + hWnd + ", total " + ++count);

User32 user32 = User32.INSTANCE; byte text[] = new byte[1024];

user32.GetWindowModuleFileName(hWnd, text, 1024);

String test = Native.toString(text);

System.out.println(test);

return true; } }, null);

But apparently. only the first character (i.e. "C:\Program Files\myexe.exe" --> "C") ist printed out. What am I doing wrong?

Greetings, dom