delphi 2006 - Is it possible to find out if a resource name exists?
-
23-06-2021 - |
Domanda
What it the best way to find out if a resource name exists - other than seeing if
LoadFromResourceName (HInstance, 'FOOBAR')
causes an exception?
Soluzione
You can use the FindResource
function (remember pass the proper resource type)
if FindResource(hInstance, 'FOOBAR', RT_RCDATA) <> 0 then
// do something
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow