Вниз
Скачать: 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.013 c
3-10130
Space
2003-07-15 11:29
2003.08.04
Округление значения переменной


14-10449
KaPaT
2003-07-18 13:29
2003.08.04
Кто-нибудь сталкиваля с этим бредом???


1-10239
xRay
2003-07-20 01:56
2003.08.04
TListView


4-10515
grusty
2003-06-02 19:53
2003.08.04
Состояние принтера...


14-10409
_____
2003-07-17 12:52
2003.08.04
Популярность форума




   Наверх