Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.08.04;
Скачать: CL | DM;

Вниз

Как найти ресурс   Найти похожие ветки 

 
-=mixir=- ©   (2003-06-02 21:00) [0]

Подскажите пожайлуста как найти ресурс иконки,
и как найти ресурс по его ID


 
AlexRush ©   (2003-06-03 11:13) [1]

Нашел кусочек своего старго кода...

function ResourceExtractToFile(hInst:DWORD;resName,resType,FullFileName:string):DWORD;stdcall;
var hFile,dw_writed:DWORD;
hRes,hResData:DWORD;
ptrResLock:pointer;
begin
hRes:=FindResourceA(hInstance,PChar(resName),PChar(resType));
if (hRes=0)
then begin
{$ifdef DISPLAY_DEBUG_ERRORS}
ErrorMessage("FindResourceA()");{}
{$endif}
result:=1;
exit;
end;
hResData:=LoadResource(hInstance,hRes);
if (hResData=0)
then begin
{$ifdef DISPLAY_DEBUG_ERRORS}
ErrorMessage("LoadResource()");
{$endif}
result:=2;
exit;
end;
ptrResLock:=nil;
ptrResLock:=LockResource(hResData);
if not Assigned(ptrResLock)
then begin
{$ifdef DISPLAY_DEBUG_ERRORS}
ErrorMessage("LockResource()");
{$endif}
result:=3;
exit;
end;

hFile:= CreateFile(PChar(PathName),
GENERIC_WRITE,
FILE_SHARE_WRITE or FILE_SHARE_READ,
nil,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
0);
if(hFile=INVALID_HANDLE_VALUE)
then begin
{$ifdef DISPLAY_DEBUG_ERRORS}
ErrorMessage("CreateFile()");
{$endif}
result:=4;
exit;
end;
dw_writed:=SizeofResource(hInstance,hRes);
if not LongBool(WriteFile(hFile,ptrResLock^,dw_writed,dw_writed,nil))
then begin
{$ifdef DISPLAY_DEBUG_ERRORS}
ErrorMessage("WriteFile()");
{$endif}
CloseHandle(hFile);
result:=5;
exit;
end;
CloseHandle(hFile);
result:=0;
end;




Страницы: 1 вся ветка

Текущий архив: 2003.08.04;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.012 c
4-10507
Pashik
2003-06-01 13:36
2003.08.04
Добавление юзера к файлу


14-10454
Denister
2003-07-18 07:05
2003.08.04
А как же VCL?


4-10528
mod
2003-06-03 16:56
2003.08.04
Раскладка клавиатуры


1-10195
lovres
2003-07-23 10:01
2003.08.04
Child - окна MDI


4-10505
nstyx
2003-05-30 00:09
2003.08.04
картинку на форму