| | |
I want the code of a certain function
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Here is a little Delphi code that gives you just a hint:
It uses the WinApi function:
C Syntax (Toggle Plain Text)
// get the hard drive serial number (Delphi Pascal) procedure TForm1.SerialNumberButtonClick(Sender: TObject); var VolumeSerialNumber : DWORD; MaximumComponentLength : DWORD; FileSystemFlags : DWORD; SerialNumber : string; begin GetVolumeInformation('c:\', nil, 0, @VolumeSerialNumber, MaximumComponentLength, FileSystemFlags, nil, 0); SerialNumber := IntToHex(HiWord(VolumeSerialNumber), 4) + '-' + IntToHex(LoWord(VolumeSerialNumber), 4); Memo1.Lines.Add(SerialNumber); end;
C Syntax (Toggle Plain Text)
BOOL GetVolumeInformation( LPCTSTR lpRootPathName, // address of root directory of the file system LPTSTR lpVolumeNameBuffer, // address of name of the volume DWORD nVolumeNameSize, // length of lpVolumeNameBuffer LPDWORD lpVolumeSerialNumber, // address of volume serial number LPDWORD lpMaximumComponentLength, // address of system's maximum filename length LPDWORD lpFileSystemFlags, // address of file system flags LPTSTR lpFileSystemNameBuffer, // address of name of file system DWORD nFileSystemNameSize // length of lpFileSystemNameBuffer );
May 'the Google' be with you!
![]() |
Similar Threads
- Foolproof Algorithm for inserting code into function (C#)
- taking code and changing format to function! PLEASE HELP!! (C++)
- Calling C# function(code behind) from javascript function (ASP.NET)
- SubRoutine/Function Code Split (VB.NET)
- Code Snippet: Adding Arguments to Function Objects with Curry (Python) (Python)
- Function that returns void (C++)
Other Threads in the C Forum
- Previous Thread: oop
- Next Thread: Need help in os programming
Views: 2133 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C
#include * .net append array arrays asterisks binarysearch calculate changingto char character cm command copyimagefile cprogramme creafecopyofanytypeoffileinc database directory dynamic execv feet fgets file fork forloop framework function functions givemetehcodez grade graphics gtkwinlinux hacking histogram homework include incrementoperators input intmain() iso kernel keyboard km lazy license linked linkedlist linux list lists locate logical_drives looping loopinsideloop. lowest matrix microsoft mqqueue mysql number oddnumber odf opensource overwrite owf pdf performance pointer pointers posix probleminc process program programming radix recursion recv recvblocked research reversing scanf scripting segmentationfault sequential socket spoonfeeding standard string student systemcall testing threads turboc unix user variable wab whythiscodecausesegmentationfault windowsapi






