我有这段代码:
SELDR_WH := FindControl(FindWindow(nil,'PhoneDB Filtering')) as TForm;
if seldr_wh <> nil then
begin
SELDR_WH.ClientHeight := SELDR_WH.ClientHeight + 20;
gif := TGIFImage.Create;
with gif do begin
Parent := SELDR_WH;
Top := SELDR_WH.ClientHeight - 20;
Left := 30;
try
rs := TResourceStream.Create( hInstance, 'ajax-loader', RT_RCDATA );
gif.LoadFromStream(rs);
except on Exception do begin
rs.free;
gif.free;
end;
end
end;
end;
我认为代码很明显。没有解释...
但是 - 问题是我无法将此 GIF 资源加载到 gif 组件 -> EResNotFound ...
问题出在 hInstance 参数中,如此处所述:http: //www.codeproject.com/Messages/931171/Re-The-difference-between-HWND-and-HINSTANCE.aspx
但是 - 如何加载它?加载失败的影响是主窗体设置为 SELDR (SELDR_WH) 窗体的子窗体。
任何帮助表示赞赏。谢谢!