Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to get the free system resources Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
10-Oct-02
Category
System
Language
Delphi 2.x
Views
89
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Jonas Bilinkevicius 

How to get the free system resources

Answer:

1   unit Sysresources;
2   
3   interface
4   
5   uses
6     Windows, Sysutils;
7   
8   const
9     GFSR_SYSTEMRESOURCES = 0;
10    GFSR_GDIRESOURCES = 1;
11    GFSR_USERRESOURCES = 2;
12  
13  function GetSystemResources(typ: Word): Integer;
14  
15  implementation
16  
17  var
18    hDll: HMODULE;
19    pProc: function(typ: word): Integer; stdcall;
20  
21  function GetSystemResources(typ: word): Integer;
22  begin
23    result := pProc(typ);
24  end;
25  
26  function InternalGetSystemresources(typ: Word): Integer; stdcall;
27  begin
28    result := -1;
29  end;
30  
31  initialization
32    pProc := InternalGetSystemresources;
33    if Win32Platform <> VER_PLATFORM_WIN32_NT then
34    begin
35      hdll := LoadLibrary('rsrc32.dll');
36      if hdll <> 0 then
37      begin
38        @pProc := getProcAddress(hdll, '_MyGetFreeSystemResources32@4');
39        if @pProc = nil then
40          pProc := InternalGetSystemresources;
41      end;
42    end;
43  finalization
44    if hDLL <> 0 then
45      FreeLibrary(hdll);
46  end.


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC