Using Win32 functions in Visual FoxPro Image Gallery
Setup API functions
..msdn
SetupCloseInfFile
SetupDiDestroyClassImageList
SetupDiGetClassImageIndex
SetupDiGetClassImageListEx
SetupGetInfFileList
SetupGetInfInformation
SetupOpenInfFile
Code examples:
Returning some basic information for the specified INF file
Returning some basic information for the specified INF file

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
#DEFINE INFINFO_INF_SPEC_IS_HINF        1
#DEFINE INFINFO_INF_NAME_IS_ABSOLUTE    2
#DEFINE INFINFO_DEFAULT_SEARCH          3
#DEFINE INFINFO_REVERSE_DEFAULT_SEARCH  4
#DEFINE INFINFO_INF_PATH_LIST_SEARCH    5

#DEFINE INF_STYLE_NONE     0
#DEFINE INF_STYLE_OLDNT    1
#DEFINE INF_STYLE_WIN4     2

*| typedef struct _SP_INF_INFORMATION {
*|   DWORD InfStyle;     //the style of the INF file
*|   DWORD InfCount;     //number of constituent INF files
*|   BYTE  VersionData[ANYSIZE_ARRAY];
*|                       //array to store the INF information
*| } SP_INF_INFORMATION, *PSP_INF_INFORMATION;


    DECLARE SHORT SetupGetInfInformation IN Setupapi;
        STRING    InfSpec,;
        INTEGER   SearchControl,;
        STRING  @ ReturnBuffer,;
        INTEGER   ReturnBufferSize,;
        INTEGER @ RequiredSize

    * put valid INF file name here
    lcFilename = "c:\a\Homepage.inf"

    ReturnBuffer = SPACE(250)
    RequiredSize = 0

    = SetupGetInfInformation ( lcFilename,;
        INFINFO_INF_NAME_IS_ABSOLUTE,;
        @ReturnBuffer, Len(ReturnBuffer),;
        @RequiredSize)

    ReturnBuffer = LEFT(ReturnBuffer, RequiredSize)

    ? "INF Style:",;
        getInfStyle (buf2dword (SUBSTR(ReturnBuffer, 1,4)))
    ? "Number of INF files:", buf2dword (SUBSTR(ReturnBuffer, 5,4))
    ? "Version Data:", SUBSTR(ReturnBuffer, 9)

* end of main


FUNCTION  getInfStyle (lnStyle)
    DO CASE
    CASE lnStyle = INF_STYLE_NONE
        RETURN "Unrecognized"
    CASE lnStyle = INF_STYLE_OLDNT
        RETURN "Old WinNT"
    CASE lnStyle = INF_STYLE_WIN4
        RETURN "Win4"
    ENDCASE
RETURN "#unknown INF style#"

FUNCTION  buf2dword (lcBuffer)  
RETURN;  
    Asc(SUBSTR(lcBuffer, 1,1)) + ;  
    Asc(SUBSTR(lcBuffer, 2,1)) * 256 +;  
    Asc(SUBSTR(lcBuffer, 3,1)) * 65536 +;  
    Asc(SUBSTR(lcBuffer, 4,1)) * 16777216  


User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1772 bytes  
Created: 2001-08-27 12:00:00  
Modified: 2001-09-28 16:45:36  
Visits in 7 days: 50  
Listed functions:
SetupGetInfInformation
Printer friendly API declarations
Word Index links for this example:
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.226.33.117)
19 sec.Example: 'Copying files as a transacted operation (Vista)'
37 sec.Function: 'OpenClipboard'
56 sec.Login
1.33 min.Function: 'CeDeleteDatabase'
Function group: 'Remote Application Programming (RAPI)'
1.63 min.Function: 'CeFindFirstFile'
Function group: 'Remote Application Programming (RAPI)'
1.93 min.Banners
2.27 min.Function: 'waveOutGetNumDevs'
Function group: 'Windows Multimedia'
2.58 min.
Function group: 'Metafile'
2.9 min.Example: 'Validating URLs using moniker functions'
3.2 min.Function: 'AVIStreamReadFormat'
Function group: 'Windows Multimedia'
Google
Advertise here!