Featured Posts

WP Comments Manager Today we are very proud to announce the release of our first Windows Phone 7 application that binds your Wordpress based blogs with your Windows Phone. Now you can manage your blog comments directly...

Readmore

Using IssProc with NSIS to detect files in use Although IssProc was specially designed for Inno Setup scripts, you can also use it with other setup scripts like NSIS (Nullsoft Scriptable Install System) Here is a few steps you need to do in order...

Readmore

Using IssProc with NSIS to detect files in use Although IssProc was specially designed for Inno Setup scripts, you can also use it with other setup scripts like NSIS (Nullsoft Scriptable Install System) Here is a few steps you need to do in order...

Readmore

IssProc (DLL Component) Launched IssProc is a user friendly "file in use" extension for Inno Setup (or other setup builder application like NSIS) that can be used to detect if a certain application (exe, dll module, ocx and so on) or...

Readmore

HDDPhysic v1.1.0 is released! Today we've released a new updated version of HDDPhysic (v1.1.0) Here is what’s new in this version: improved hardware serial extraction in Vista and Windows 7. you don' t need ...

Readmore

  • Prev
  • Next

HDDPhysic FoxPro example (source code sample)

Posted By : rlByte Team | In : HDDPhysic

3

 In order to get the Hard Disk serial number and other manufacturer information (NOT volume serial, only the unique one, the one that will not change after a format, physical one) using HDDPhysic library and FoxPro you need to do the following 3 easy steps:

(1) Load HDDPhysic library and declare the imported library functions:
Object: Form1 ; Procedure: Load ;

DECLARE INTEGER Init IN "HDDPhysic.dll" AS HDD_Init STRING sRegUser, STRING sRegCode
DECLARE INTEGER GetPhysicInfo IN "HDDPhysic.dll" AS HDD_Info INTEGER diskIndex, INTEGER InfoType, STRING pHddInfo

(2) Call the Init function to initialize the user computer hard drives and get the total available devices:
Object: Form1 ; Procedure: Show ;

tDiscs = HDD_Init ('your-registration-info-here', 'your-registration-info-here') && Init and get number of hdd's available
sBuffer = Space(500) && Make some room in the buffer

IF tDiscs > 0 THEN
 FOR i=0 TO tDiscs-1 STEP 1
  This.Combo1.AddItem (ALLTRIM(STR(i)))
 NEXT

 This.Text7.Value=ALLTRIM(STR(HDD_Info(0, 6, sBuffer))) && Get hdd index where Windows Is Installed
ENDIF

(3) Now that you have the total hard drives count you can query for the manufacturer information passing the disk index to the GetPhysicInfo function:
Objec: Command1 ; Procedure: Show ;

sBuffer = SPACE(500) && make some room in the buffer
iDiskNo = Form1.Combo1.ListIndex-1


    iReturn = HDD_Info(iDiskNo, 0, @sBuffer)    && 0 = serial number
    Form1.Text2.Value=sBuffer
   
    iReturn = HDD_Info(iDiskNo, 1, @sBuffer)    && 1 = hdd model
    Form1.Text3.Value=sBuffer
   
    iReturn = HDD_Info(iDiskNo, 2, @sBuffer)    && 2 = hdd revision
    Form1.Text4.Value=sBuffer
   
    iReturn = HDD_Info(iDiskNo, 3, @sBuffer)    && 3 = hdd type
    Form1.Text1.Value=sBuffer        
       
    iReturn = HDD_Info(iDiskNo, 5, @sBuffer)    && 5 = hdd buffer size
    Form1.Text5.Value=sBuffer
   
    iReturn = HDD_Info(iDiskNo, 4, @sBuffer)    && 4 = hdd size
    Form1.Text6.Value=sBuffer

A complete Visual FoxPro 9.0 project is available for download in the resource area of the project here


Tags: ,


Comments (3)

Well Done

Foxpro is one of the most popular legacy languages in the world today.

please send me the registration code for that library

Write a comment

*