Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Load AVI from resource (https://www.delphipraxis.net/181542-load-avi-resource.html)

WojTec 23. Aug 2014 12:28

Delphi-Version: XE4

Load AVI from resource
 
Just lame question, how to load AVI from resource of another file to TAnimate component? I have this and don't working:

Delphi-Quellcode:
var
  Handle: THandle;
begin
  Handle := CreateFile('C:\Windows\System32\shell32.dll', GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

  Animate1.ResHandle := Handle;
  Animate1.ResName := '165';
end;
:?:

Sir Rufo 23. Aug 2014 13:19

AW: Load AVI from resource
 
Did you have had a look at the docs?

Delphi-Referenz durchsuchenTAnimate.ResName

WojTec 23. Aug 2014 14:24

Re: Load AVI from resource
 
Yes, this is resource name, aren't they? I checked that in this DLL sample AVI is identified by 165, and I don't know if it's numeric name or real integer :?

Delphi-Quellcode:
if StrToIntDef(ResName, -1) <> -1 then
  Animate.ResId := StrToInt(ResName)
else
   Animate.ResName := ResName
;
This still don't working :(

Sir Rufo 23. Aug 2014 14:50

AW: Load AVI from resource
 
You have to get a ModuleHandle and not a FileHandle.

To do so load the library MSDN-Library durchsuchenLoadLibrary and pass that handle to the component.
TAnimate Sample
(But first you have to set the handle and then the Id or Name)

WojTec 23. Aug 2014 15:16

Re: Load AVI from resource
 
Acha! Library handle, not file handle. This was main reason it want not to work. Thanks :-D


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:25 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz