NAME Win32API::Resources - Use Win32::API to retrieve popular resources from Kernel32.dll and others -------------------------------------------------------------------------------- SYNOPSIS use Win32API::Resources; my $file = "c:\\winnt\\system32\\cmd.exe"; my %DSpace = Win32API::Resources::GetDiskFreeSpace("C:\\"); my %DRVSpace = Win32API::Resources::GetDriveSpace("C:\\"); my %File = Win32API::Resources::GetFileVersion($file, 1); my %Mem = Win32API::Resources::GlobalMemoryStatus(); my $Notes = Win32API::Resources::LoadString("c:\\notes\\nstrings.dll", 1); my @list = Win32API::Resources::EnumString("c:\\notes\\nstrings.dll"); my $type = Win32API::Resources::ExeType($file); my @drives = Win32API::Resources::GetDrives(DRIVE_CDROM); my $Connections = Win32API::Resources::RasEnumConnections(); if (Win32API::Resources::IsEXE16($file)) { print "The file $file is 16-bit - ($type)\n"; } elsif (Win32API::Resources::IsEXE32($file)) { print "The file $file is 32-bit - ($type)\n"; } print "There are $Connections open RAS Connections\n"; print "The following are valid CD-Rom drives: @drives\n"; Win32API::Resources::ShowKeys("File Information:", 1, \%File); Win32API::Resources::ShowKeys("Disk Space:", 0, \%DSpace); Win32API::Resources::ShowKeys("Drive Space:", 1, \%DRVSpace); Win32API::Resources::ShowKeys("Memory Stats:", 1, \%Mem); -------------------------------------------------------------------------------- ABSTRACT With this module you can access a series of Win32 API's directly or via provided wrappers that are exported from KERNEL32.DLL, SHELL32.DLL, USER32.DLL & VERSION.DLL. The current version of Win32API::Resources is available at: http://home.earthlink.net/~bsturner/perl/index.html -------------------------------------------------------------------------------- CREDITS Thanks go to Aldo Calpini for making the Win32::API module accessible as well as some help with GetBinaryType and ExeType functions and to Dave Roth and Jens Helberg for providing direction on the GetFileVersion function. Thanks to Mike Blazer and Aldo Calpini for fixes to the GetFileVersion function and the UnpackLargeInt function that fixes a bug in the GetDiskFreeSpaceEx function -------------------------------------------------------------------------------- HISTORY 0.06 Fixed bug with GetDiskFreeSpaceEx that reported drives over 4GB incorrectly Fixed and extended functionality of GetFileVersion function to correctly view and return all available information Now runs with 'use strict qw(vars)' Added two new internal helper subroutines - UnpackLargeInt and DWORD_NULL 0.05 Added RasEnumConnections function and fixed bug with GetDrives on Win95 0.04 Added GetDrives function 0.03 Cleaned up and fixed bug with GetDiskFreeSpaceEx 0.02 Added some new EXEType functions 0.01 First release -------------------------------------------------------------------------------- INSTALLATION This module is shipped as a basic PM file that should be installed in your Perl\site\lib\Win32API dir. Written and tested for the ActivePerl 5xx distribution, but should work in any Win32 capable port that has Win32::API. REQUIRES Win32::API be installed -------------------------------------------------------------------------------- DESCRIPTION To use this module put the following line at the beginning of your script: use Win32API::Resources; Any one of the functions can be referenced by: var = Win32API::Resources::function except for Win32API::Resources::ShowKeys() which does not return a value Full HTML documentation is provided with the distribution. Brad Turner bsturner@sprintparanet.com