in reply to Re: How to detect that a Windows DLL has a version resource, and pull data from it.
in thread How to detect that a Windows DLL has a version resource, and pull data from it.

The trick was getting the language code once I got the Win32::Exe object - and it isn't exactly the cleanest code in the world. I had to poke into the object to get it, because there isn't a documented interface for it.
my $language; my $exe = Win32::Exe->new( $name[$object_id] ); my $vi = $exe->version_info(); if (defined $vi) { # To load the variable used below. $vi->get('OriginalFilename'); $language = hex substr $vi->{'cur_trans'}, 0, 4; # $language is now the language IN DECIMAL. # To get a hex number, drop the 'hex' before the substr. } # use $language if it's defined. ...
  • Comment on Re^2: How to detect that a Windows DLL has a version resource, and pull data from it.
  • Download Code