Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralI want to hide command line window Pin
Cheickna6-May-03 21:07
Cheickna6-May-03 21:07 
GeneralRe: I want to hide command line window Pin
imsniper6-May-03 21:25
imsniper6-May-03 21:25 
QuestionHow to get the size of a physical disk? Pin
Maxwell Chen6-May-03 20:06
Maxwell Chen6-May-03 20:06 
AnswerRe: How to get the size of a physical disk? Pin
Xander807-May-03 1:03
Xander807-May-03 1:03 
GeneralRe: How to get the size of a physical disk? Pin
Maxwell Chen8-May-03 15:56
Maxwell Chen8-May-03 15:56 
AnswerRe: How to get the size of a physical disk? Pin
Rage7-May-03 1:06
professionalRage7-May-03 1:06 
GeneralRe: How to get the size of a physical disk? Pin
Maxwell Chen8-May-03 16:00
Maxwell Chen8-May-03 16:00 
AnswerRe: How to get the size of a physical disk? Pin
David Crow7-May-03 4:17
David Crow7-May-03 4:17 
This correctly reports that I have a (roughly) 13GB disk:

HANDLE disk;
DWORD dwNeeded;
DISK_GEOMETRY *geometry;

disk=CreateFile("\\\\.\\PHYSICALDRIVE0",
     GENERIC_READ,
     0,
     NULL,
     OPEN_EXISTING,
     0,
     NULL);
if (INVALID_HANDLE_VALUE != disk)
{
    geometry = new DISK_GEOMETRY;

    DeviceIoControl(disk,
         IOCTL_DISK_GET_DRIVE_GEOMETRY,
         NULL,
         0,
         geometry,
         sizeof(DISK_GEOMETRY),
         &dwNeeded,
         NULL);

    TRACE("      Cylinders: %I64u\n", geometry->Cylinders);
    TRACE("     Media Type: %d\n",    geometry->MediaType);
    TRACE("Tracks/Cylinder: %lu\n",   geometry->TracksPerCylinder);
    TRACE("  Sectors/Track: %lu\n",   geometry->SectorsPerTrack);
    TRACE("   Bytes/Sector: %lu\n",   geometry->BytesPerSector);

    delete [] geometry;

    CloseHandle(disk);
}

GeneralRe: How to get the size of a physical disk? Pin
Maxwell Chen8-May-03 16:10
Maxwell Chen8-May-03 16:10 
GeneralPrinting a graph Pin
summo6-May-03 20:02
summo6-May-03 20:02 
QuestionReclaim memory...? Pin
Ph@ntom6-May-03 19:40
Ph@ntom6-May-03 19:40 
AnswerRe: Reclaim memory...? Pin
David Crow7-May-03 4:19
David Crow7-May-03 4:19 
GeneralRe: Reclaim memory...? Pin
Ph@ntom7-May-03 18:58
Ph@ntom7-May-03 18:58 
GeneralRe: Reclaim memory...? Pin
David Crow8-May-03 2:18
David Crow8-May-03 2:18 
QuestionCDialog automatically deletion --- safe? Pin
lauch26-May-03 15:17
lauch26-May-03 15:17 
AnswerRe: CDialog automatically deletion --- safe? Pin
Nish Nishant6-May-03 15:43
sitebuilderNish Nishant6-May-03 15:43 
GeneralRe: CDialog automatically deletion --- safe? Pin
lauch26-May-03 15:59
lauch26-May-03 15:59 
GeneralRe: CDialog automatically deletion --- safe? Pin
Nish Nishant6-May-03 16:07
sitebuilderNish Nishant6-May-03 16:07 
GeneralRe: CDialog automatically deletion --- safe? Pin
lauch26-May-03 20:17
lauch26-May-03 20:17 
GeneralRe: CDialog automatically deletion --- safe? Pin
Nish Nishant7-May-03 3:58
sitebuilderNish Nishant7-May-03 3:58 
GeneralRe: CDialog automatically deletion --- safe? Pin
Nish Nishant7-May-03 4:01
sitebuilderNish Nishant7-May-03 4:01 
GeneralRe: CDialog automatically deletion --- safe? Pin
lauch28-May-03 16:37
lauch28-May-03 16:37 
QuestionHow to copy from clipboard to MS Word Project??? Pin
krle6-May-03 15:08
krle6-May-03 15:08 
GeneralWhy won't my CTreeCtrl work in my SDI Pin
adonisv6-May-03 11:43
adonisv6-May-03 11:43 
GeneralRe: Why won't my CTreeCtrl work in my SDI Pin
valikac6-May-03 12:46
valikac6-May-03 12:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.