Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.011 c
1-10300
BOA_KAA
2003-07-22 13:15
2003.08.04
wsMaximized


7-10480
fil
2003-05-25 11:58
2003.08.04
Автозагрузка программы как сервис в win NT 2000 XP


11-10149
savva
2002-11-29 12:02
2003.08.04
Я тут совершенно недавно подсел на KOL и MCK...


4-10507
Pashik
2003-06-01 13:36
2003.08.04
Добавление юзера к файлу


1-10163
TSa
2003-07-12 14:32
2003.08.04
«Востановление» реестра




   Наверх