Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delphi 2006 - Is it possible to find out if a resource name exists?

What it the best way to find out if a resource name exists - other than seeing if

LoadFromResourceName (HInstance, 'FOOBAR')

causes an exception?

like image 766
rossmcm Avatar asked Jul 31 '12 03:07

rossmcm


1 Answers

You can use the FindResource function (remember pass the proper resource type)

 if FindResource(hInstance, 'FOOBAR', RT_RCDATA) <> 0 then
  // do something
like image 162
RRUZ Avatar answered Oct 14 '22 02:10

RRUZ