3 messages in net.java.dev.jna.users[jna-users] Re: Hello friend
FromSent OnAttachments
Timothy WallOct 8, 2008 8:36 am 
Timothy WallOct 8, 2008 10:58 am 
Timothy WallOct 8, 2008 11:45 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:[jna-users] Re: Hello friendActions...
From:Timothy Wall (twal@dev.java.net)
Date:Oct 8, 2008 10:58:29 am
List:net.java.dev.jna.users

Please address replies to the jna users list. If you look at the description of that list on the project page, it recomments providing the C declarations that your are trying to map into Java.

In addition, a detailed description of what exactly is not working would help. Does the function never return? does it crash your program? Does it return data you don't expect?

On Oct 8, 2008, at 11:50 AM, D.Ulzii-Orshikh wrote:

Dear Timothy Wall,

Thank you for your quick reply.

Sorry I wrote my commented line, Last line was :

kernel32.Process32First( hProcessSnap, pe)

So what is wrong with my code ? It is not working.

Sincerely, Olzii

-----Original Message----- From: Timothy Wall [mailto:twal@dev.java.net] Sent: Wednesday, October 08, 2008 11:37 PM To: D.Ulzii-Orshikh Cc: use@jna.dev.java.net Subject: Re: Hello friend

All structure parameters are passed by reference unless explicitly passed by value by using the ByValue interface.

On Oct 8, 2008, at 11:31 AM, D.Ulzii-Orshikh wrote:

Dear Timothy Wall,

I am writing simple Java application that detects foreground window. And I need to get EXE filename of current window. But I can not pass by reference my PROCESSENTRY32 structure to function Process32First function. Please help me friend ?

Here is my code : public class PROCESSENTRY32 extends Structure {

public static class ByReference extends PROCESSENTRY32 implements Structure.ByReference {};

public int dwSize; public int cntUsage; public int th32ProcessID; public Pointer th32DefaultHeapID; //ULONG_PTR public int th32ModuleID; public int cntThreads; public int th32ParentProcessID; public NativeLong pcPriClassBase; public int dwFlags; public char[] szExeFile;

public PROCESSENTRY32() { szExeFile = new char[250]; } } .

boolean Process32First(HANDLE hSnapshot, PROCESSENTRY32 lppe);

. Kernel32.PROCESSENTRY32.ByReference pe; pe = new Kernel32.PROCESSENTRY32.ByReference(); . kernel32.Process32First( hProcessSnap, pe32 )

Thank you , Please help me friend.

Olzii