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 8:36:25 am
List:net.java.dev.jna.users

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