Categories

fat file system information

#include
#include

void main(void)
{
struct fatinfo fat;

getfatd(&fat);

printf(“Sectors per cluster %dn”, fat.fi_sclus);
printf(“Clusters per disk %un”, fat.fi_nclus);
printf(“Bytes per cluster %dn”, fat.fi_bysec);
printf(“Disk type %xn”, fat.fi_fatid & 0xFF);
}

Bookmark It

exe file information

#include
struct EXEHEAD

{
char id[2]; // ‘M’ & ‘Z’
unsigned lastpg; // no of bytes on last page
unsigned size; // total no of 512 byte pages
unsigned reloc; // no of relocation table items
unsigned headersize; // header size in [...]

enumeration example

#include

typedef enum{Sun,Mon,Tue,Wed,Thu,Fri,Sat}days;

int main()
{
days number;
printf(“Please enter the number of the day of the week.n”);
scanf(“%d”,&number);
switch(number)
{
case 0 : printf(“the day is Sunday.n”); break;
case 1 : printf(“the day is Monday.n”); break;
case 2 : printf(“the day is Tuesday.n”); break;
case 3 : printf(“the day is Wednesday.n”); break;
case 4 : printf(“the day is thursday.n”); break;
case 5 : printf(“the day is Friday.n”); [...]

english to french dictionary

#include
#include

char dict[][2][40] = {
“hello”,”bonjour” ,
“year”,”annee” ,
“good”,”bon” ,
“car”,”voiture” ,
“house”,”maison” ,
“yes”,”oui” ,
“friend”,”ami” ,
“road”,”rue” ,
“”,””
};

int main(void)
{
int i = 0;
char word[80];

printf(“Enter a word in English to search for.n”);
gets(word);
while(strcmp(dict[i][0],””))
{
if(!strcmp(word,dict[i][0]))
{
printf(“French equivalent is : %sn”,dict[i][1]);
break;
}
i++;
}

if(!strcmp(dict[i][0], “”))
printf(“Word not found.n”);

return 0;
}

Bookmark It

empty recent documents folder

#include
#include
#define WIN32_LEAN_AND_MEAN

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{

if(MessageBox(NULL, “Press ok to empty the Recent documents folder.”, “recycler”, MB_YESNO | MB_ICONINFORMATION) != IDYES)
return FALSE;

SHAddToRecentDocs(SHARD_PATH, NULL);

return FALSE [...]