ProcessExecutableSize := sizeof(WindowProcessExecutable); // a buffer you declare anywhere you want.
You should use Length() instead of Sizeof(). QueryFullProcessImageName() wants a character count, not a byte count. If you compile with a Unicode buffer, Sizeof() will report twice the size, thus risking a buffer overflow by telling QueryFullProcessImageName() there is room for more characters than there really is.
You're right. I'm used to using sizeof because I do everything in
ansi (extended) ascii(single byte characters), with
ansi ascii, that works but, it wouldn't work with non-sbcs. When I use unicode I define the buffers a different way that spares me from using sizeof.
Interesting. I bookmarked it, maybe I can use it someday.
Thank you for sharing it.
You're welcome Handoko.
Thanks. Do you have a little more complete version? My WinAPI knowledge sucks.
You're welcome. I attached a complete example to this post (including executable). It might be a little more complete than you were asking for. It's an example about how to use qsort that uses the steps I outlined in the previous post.
Suggestion: make a directory where you'll expand the archive, there is about a half dozen files.
HTH.