#!/usr/bin/perl
'
	Program :	WinStRes Module (Windows Standard Resources)
	Author  :	H. Piske
	Written :	2001-03-08
	Purpose :	provide standard icons and cursors for Win32::GUI

	History :

';

package WinStRes;

BEGIN
{
	use Win32::API;
	use Exporter;
	use vars qw(@ISA @EXPORT);
	@ISA = qw(Exporter);
	@EXPORT = qw(WinCursor WinIcon WinBitmap);
	$LoadImage = new Win32::API ('user32', 'LoadImage', [N,N,I,I,I,I], N)
		or die 'can\'t find LoadImage function';
}
END {undef $LoadImage;}

%cursors =
(
	'NORMAL'      => 32512,
	'IBEAM'       => 32513,
	'WAIT'        => 32514,
	'CROSS'       => 32515,
	'UP'          => 32516,
	'SIZE'        => 32640,
	'ICON'        => 32641,
	'SIZENWSE'    => 32642,
	'SIZENESW'    => 32643,
	'SIZEWE'      => 32644,
	'SIZENS'      => 32645,
	'SIZEALL'     => 32646,
	'ICOCUR'      => 32647,
	'NO'          => 32648,
	'HAND'        => 32649,
	'APPSTARTING' => 32650,
);
%icons = 
(
	'SAMPLE'      => 32512,
	'HAND'        => 32513,
	'QUES'        => 32514,
	'BANG'        => 32515,
	'NOTE'        => 32516,
	'WINLOGO'     => 32517,
	'WARNING'     => 32515,
	'ERROR'       => 32513,
	'INFORMATION' => 32516,
);
%bitmaps =
(
	'CLOSE'       => 32754,
	'UPARROW'     => 32753,
	'DNARROW'     => 32752,
	'RGARROW'     => 32751,
	'LFARROW'     => 32750,
	'REDUCE'      => 32749,
	'ZOOM'        => 32748,
	'RESTORE'     => 32747,
	'REDUCED'     => 32746,
	'ZOOMD'       => 32745,
	'RESTORED'    => 32744,
	'UPARROWD'    => 32743,
	'DNARROWD'    => 32742,
	'RGARROWD'    => 32741,
	'LFARROWD'    => 32740,
	'MNARROW'     => 32739,
	'COMBO'       => 32738,
	'UPARROWI'    => 32737,
	'DNARROWI'    => 32736,
	'RGARROWI'    => 32735,
	'LFARROWI'    => 32734,
	'OLD_CLOSE'   => 32767,
	'SIZE'        => 32766,
	'OLD_UPARROW' => 32765,
	'OLD_DNARROW' => 32764,
	'OLD_RGARROW' => 32763,
	'OLD_LFARROW' => 32762,
	'BTSIZE'      => 32761,
	'CHECK'       => 32760,
	'CHECKBOXES'  => 32759,
	'BTNCORNERS'  => 32758,
	'OLD_REDUCE'  => 32757,
	'OLD_ZOOM'    => 32756,
	'OLD_RESTORE' => 32755,
);
return 1;

sub WinCursor
{
	local $_ = $cursors{$_[0]} or $cursors{'NORMAL'};
	return $LoadImage->Call (0, $_, 2, 0, 0, 0x8040);
}
sub WinIcon
{
	local $_ = $icons{$_[0]} or $icons{'SAMPLE'};
	return $LoadImage->Call (0, $_, 1, 0, 0, 0x8040);
}
sub WinBitmap
{
	local $_ = $bitmaps{$_[0]} or return 0;
	return $LoadImage->Call (0, $_, 0, 0, 0, 0x8040);
}
