Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Resursi - runtime kreiranje i zamene

[es] :: Pascal / Delphi / Kylix :: Resursi - runtime kreiranje i zamene

[ Pregleda: 3008 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Resursi - runtime kreiranje i zamene08.07.2005. u 15:04 - pre 228 meseci
Da li postoji nacin da kreiram resurse u runtime-u?
Hocu da kreiram nove resurse i da postojece zamenim kreiranim.
 
Odgovor na temu

Srki_82
Srdjan Tot
Me @ My Home
Ljubljana

Član broj: 28226
Poruke: 1403
82.208.201.*

ICQ: 246436949


+10 Profil

icon Re: Resursi - runtime kreiranje i zamene08.07.2005. u 15:36 - pre 228 meseci
Na kakve resurse mislis? One koji se nalaze u *.res fajlu pa se linkuju sa exeom ili na nesto drugo?
 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Resursi - runtime kreiranje i zamene08.07.2005. u 23:36 - pre 228 meseci
Da, bas te...
 
Odgovor na temu

Srki_82
Srdjan Tot
Me @ My Home
Ljubljana

Član broj: 28226
Poruke: 1403
82.208.201.*

ICQ: 246436949


+10 Profil

icon Re: Resursi - runtime kreiranje i zamene09.07.2005. u 08:46 - pre 228 meseci
Naravno da moze :)

Imas 3 funkcije koje su za rad sa tim stvarima. Kada pocinjes sa menjanjem resursa pozoves

BeginUpdateResource
Citat:
Delphi help:

The BeginUpdateResource function returns a handle that can be used by the UpdateResource function to add, delete, or replace resources in an executable file.

HANDLE BeginUpdateResource(

LPCTSTR pFileName, // pointer to file in which to update resources
BOOL bDeleteExistingResources // deletion option
);


Parameters

pFileName

Pointer to a null-terminated string that specifies a Windows executable file in which to update resources. An application must be able to obtain write access to this file; it cannot be currently executing. If pFileName does not specify a full path, Windows searches for the file in the current directory.

bDeleteExistingResources

Specifies whether to delete the pFileName parameter's existing resources. If this parameter is TRUE, existing resources are deleted and the updated executable file includes only resources added with the UpdateResource function. If this parameter is FALSE, the updated executable file includes existing resources unless they are explicitly deleted or replaced by using UpdateResource.



Return Values

If the function succeeds, the return value is a handle that can be used by the UpdateResource and EndUpdateResource functions. The return value is NULL if the specified file is not an executable file, the executable file is already loaded, the file does not exist, or the file cannot be opened for writing. To get extended error information, call GetLastError.


Sledeca je

UpdateResource
Citat:
Delphi help:

The UpdateResource function adds, deletes, or replaces a resource in an executable file.

BOOL UpdateResource(

HANDLE hUpdate, // update-file handle
LPCTSTR lpType, // address of resource type to update
LPCTSTR lpName, // address of resource name to update
WORD wLanguage, // language identifier of resource
LPVOID lpData, // address of resource data
DWORD cbData // length of resource data, in bytes
);


Parameters

hUpdate

Specifies an update-file handle. This handle is returned by the BeginUpdateResource function.

lpType

Points to a null-terminated string specifying the resource type to be updated. This parameter can also be an integer value passed to the MAKEINTRESOURCE macro, or it can be one of the following predefined resource types:

Value Meaning
RT_ACCELERATOR Accelerator table
RT_ANICURSOR Animated cursor
RT_ANIICON Animated icon
RT_BITMAP Bitmap resource
RT_CURSOR Hardware-dependent cursor resource
RT_DIALOG Dialog box
RT_FONT Font resource
RT_FONTDIR Font directory resource
RT_GROUP_CURSOR Hardware-independent cursor resource
RT_GROUP_ICON Hardware-independent icon resource
RT_ICON Hardware-dependent icon resource
RT_MENU Menu resource
RT_MESSAGETABLE Message-table entry
RT_RCDATA Application-defined resource (raw data)
RT_STRING String-table entry
RT_VERSION Version resource


lpName

Points to a null-terminated string specifying the name of the resource to be updated. This parameter can also be an integer value passed to the MAKEINTRESOURCE macro.

wLanguage

Specifies the language identifier of the resource to be updated. For a list of the primary language identifiers and sublanguage identifiers that make up a language identifier, see the MAKELANGID macro

lpData

Points to the resource data to be inserted into the executable file. If the resource is one of the predefined types, the data must be valid and properly aligned. Note that this is the raw binary data stored in the executable file, not the data provided by LoadIcon, LoadString, or other resource-specific load functions. All data containing strings or text must be in Unicode format; lpData must not point to ANSI data.
If lpData is NULL, the specified resource is deleted from the executable file.

cbData

Specifies the size, in bytes, of the resource data at lpData.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

An application can use UpdateResource repeatedly to make changes to the resource data. Each call to UpdateResource contributes to an internal list of additions, deletions, and replacements but does not actually write the data to the executable file. The application must use the EndUpdateResource function to write the accumulated changes to the executable file.


I na kraju pozivas

EndUpdateResource

Citat:
Delphi help:

The EndUpdateResource function ends a resource update in an executable file.

BOOL EndUpdateResource(

HANDLE hUpdate, // update-file handle
BOOL fDiscard // write flag
);


Parameters

hUpdate

Specifies an update handle. This handle is returned by the BeginUpdateResource function.

fDiscard

Specifies whether to write resource updates to an executable file. If this parameter is TRUE, no changes are made to the executable file. If it is FALSE, the changes are made.



Return Values

If the function succeeds and the accumulated resource modifications specified by calls to the UpdateResource function are written to the specified executable file, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.


Nadam se da je pomoglo.
 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: Resursi - runtime kreiranje i zamene

[ Pregleda: 3008 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.