winres.inc 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. function SysEnumResourceTypes(hModule : TFPResourceHMODULE; lpEnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceTypesA';
  2. function SysEnumResourceNames(hModule : TFPResourceHMODULE; lpszType : PChar; lpEnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceNamesA';
  3. function SysEnumResourceLanguages(hModule : TFPResourceHMODULE; lpType : PChar; lpName : PChar; lpEnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool; stdcall; external 'kernel32' name 'EnumResourceLanguagesA';
  4. function SysFindResource(hModule:TFPResourceHMODULE; lpName:Pchar; lpType:Pchar):TFPResourceHandle; stdcall; external 'kernel32' name 'FindResourceA';
  5. function SysFindResourceEx(hModule:TFPResourceHMODULE; lpType:Pchar; lpName:Pchar; Language : WORD):TFPResourceHandle; stdcall; external 'kernel32' name 'FindResourceExA';
  6. function SysLoadResource(hModule:TFPResourceHMODULE; hResInfo:TFPResourceHandle):TFPResourceHGLOBAL; stdcall; external 'kernel32' name 'LoadResource';
  7. function SysSizeofResource(hModule:TFPResourceHMODULE; hResInfo:TFPResourceHandle):DWORD; stdcall; external 'kernel32' name 'SizeofResource';
  8. function SysLockResource(hResData:TFPResourceHGLOBAL):Pointer; stdcall; external 'kernel32' name 'LockResource';
  9. function SysFreeResource(hResData:TFPResourceHGLOBAL):Longbool; stdcall; external 'kernel32' name 'FreeResource';
  10. var
  11. SysInstance : PPtrUInt;external name '_FPC_SysInstance';
  12. Function IntHINSTANCE : TFPResourceHMODULE;
  13. begin
  14. IntHINSTANCE:=sysinstance^;
  15. end;
  16. Function IntEnumResourceTypes(ModuleHandle : TFPResourceHMODULE; EnumFunc : EnumResTypeProc; lParam : PtrInt) : LongBool;
  17. begin
  18. IntEnumResourceTypes:=SysEnumResourceTypes(ModuleHandle,EnumFunc,lParam);
  19. end;
  20. Function IntEnumResourceNames(ModuleHandle : TFPResourceHMODULE; ResourceType : PChar; EnumFunc : EnumResNameProc; lParam : PtrInt) : LongBool;
  21. begin
  22. IntEnumResourceNames:=SysEnumResourceNames(ModuleHandle,ResourceType,EnumFunc,lParam);
  23. end;
  24. Function IntEnumResourceLanguages(ModuleHandle : TFPResourceHMODULE; ResourceType, ResourceName : PChar; EnumFunc : EnumResLangProc; lParam : PtrInt) : LongBool;
  25. begin
  26. IntEnumResourceLanguages:=SysEnumResourceLanguages(ModuleHandle,ResourceType,ResourceName,EnumFunc,lParam);
  27. end;
  28. Function IntFindResource(ModuleHandle: TFPResourceHMODULE; ResourceName, ResourceType: PChar): TFPResourceHandle;
  29. begin
  30. IntFindResource:=SysFindResource(ModuleHandle,ResourceName,ResourceType);
  31. end;
  32. Function IntFindResourceEx(ModuleHandle: TFPResourceHMODULE; ResourceType, ResourceName: PChar; Language : word): TFPResourceHandle;
  33. begin
  34. IntFindResourceEx:=SysFindResourceEx(ModuleHandle,ResourceType,ResourceName,Language);
  35. end;
  36. Function IntLoadResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): TFPResourceHGLOBAL;
  37. begin
  38. IntLoadResource:=SysLoadresource(ModuleHandle,Reshandle);
  39. end;
  40. Function IntSizeofResource(ModuleHandle: TFPResourceHMODULE; ResHandle: TFPResourceHandle): LongWord;
  41. begin
  42. IntSizeofResource:=SysSizeofResource(ModuleHandle,Reshandle);
  43. end;
  44. Function IntLockResource(ResData: TFPResourceHGLOBAL): Pointer;
  45. begin
  46. IntLockResource:=SysLockResource(ResData);
  47. end;
  48. Function IntUnlockResource(ResData: TFPResourceHGLOBAL): LongBool;
  49. begin
  50. IntUnlockResource:=SysFreeResource(ResData);
  51. end;
  52. Function IntFreeResource(ResData: TFPResourceHGLOBAL): LongBool;
  53. begin
  54. IntFreeResource:=SysFreeResource(ResData);
  55. end;
  56. const
  57. InternalResourceManager : TResourceManager =
  58. (
  59. HINSTANCEFunc : @IntHINSTANCE;
  60. EnumResourceTypesFunc : @IntEnumResourceTypes;
  61. EnumResourceNamesFunc : @IntEnumResourceNames;
  62. EnumResourceLanguagesFunc : @IntEnumResourceLanguages;
  63. FindResourceFunc : @IntFindResource;
  64. FindResourceExFunc : @IntFindResourceEx;
  65. LoadResourceFunc : @IntLoadResource;
  66. SizeofResourceFunc : @IntSizeofResource;
  67. LockResourceFunc : @IntLockResource;
  68. UnlockResourceFunc : @IntUnlockResource;
  69. FreeResourceFunc : @IntFreeResource;
  70. );