[nvda] Re: using getWindowModuleFileName

Hi Mick,
As Will indicated, that function does not work from other processes.
There is a work-around that usually works, however, involving
enumerating processes currently running.  I don't fully understand
it, but I adapted an implementation in the PowerBasic language.  The
code is contained in the file jfw_util.bas, located in the archive
at
http://www.EmpowermentZone.com/jfw_util.zip

Hope this helps,
Jamal
works, however.  It involves
enumerating the processes currently running and checking what windows
they c
On Wed, 13 Dec 2006, Michael Curran wrote:

> Date: Wed, 13 Dec 2006 17:24:37 +1100
> From: Michael Curran <mick@xxxxxxxxxx>
> Reply-To: programming@xxxxxxxxxxxxxxxxxxxx
> To: nvda@xxxxxxxxxxxxx
> Cc: programming@xxxxxxxxxxxxxxxxxxxx
> Subject: using getWindowModuleFileName
>
> Hi all,
>
> Has anyone had problems using getWindowModuleFileName from user32.dll?
>
> I am trying to use it to get the file name of an application by passing its
> app window to getWindowModuleFileName.
>
> I am doing this with in python, using CTypes, but this has never caused me
> any issues before.
>
> I call it with the window as the first parameter, an empty buffer as the
> second parameter, and the number of chars that can fit in the buffer as the
> third.
>
> To be specific, an int, a char* (pointing to some alocated memory) and an
> int.
>
> However, every time I do it, it always returns 0 and adds nothing to the
> buffer.
>
> I have tried getWindowModuleFileName, getWindowModuleFileNameA and
> getWindowModuleFileNameW and they all return 0.
>
> This way of calling from python definitly works because things like
> getWindowText etc work totally fine.
>
> NVDA currently uses getProcessImageFileName from psapi.dll (but this does
> not exist on Windows 2000 so I would like to instead use
> getWindowModuleFileName if I can).
>
> Thanks
> Mick
>
>
> _____________________________________________________________
> For help using this list, send a blank message to 
> Programming-request@xxxxxxxxxxxxxxxxxxxxx
> Use the one word subject "help" and leave the body blank.
>
> Other blindness lists: 
> http://www.visionrx.com/library/resources/resource_int1.asp
> Web site address: http://www.BlindProgramming.com
>
To post messages to the list send email to
nvda@xxxxxxxxxxxxx
To unsubscribe from the list send a blank message to:
nvda-request@xxxxxxxxxxxxx
 with 'unsubscribe' in the Subject field.
Thank you for your continued support of Nonvisual Desktop Access, an open 
source free screen reader for Microsoft Windows:
http://www.kulgan.net/nvda/

Other related posts: