If I open file in VB6 with Open statement, can I obtain it's Windows handle?
Printable View
If I open file in VB6 with Open statement, can I obtain it's Windows handle?
a file does not have a window handle, but a file handle.
Dim hFile as integer ' hold file handle
hFile =freefile
open "yourfile" for input as #hFile
close hFile
Note that this handle you get from VB cannot (!) be used with api functions who want a filehandle, this filehandle is an internal handle of VB. If you need to have a file handle that canbe used with API function, use the API to open the file.
Crazy D @ Work :-)