Вниз
Скачать: 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.44 MB
Время: 0.015 c
3-10117
yurez
2003-07-14 13:10
2003.08.04
не могунормально установить ib server


1-10227
AGAMEMNUM
2003-07-17 15:13
2003.08.04
Как послать проге CTRL+DEL?


1-10222
stimm
2003-07-20 22:00
2003.08.04
Вопрос о единицах возврщаемых FileSize-ом


6-10345
TCrash
2003-05-28 17:57
2003.08.04
траблы с сокетами


1-10219
abc
2003-07-20 20:23
2003.08.04
как под переменную типа Variant выделить 100kb?




   Наверх