Click here to Skip to main content
15,886,137 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [C++] How to change the mouse position in Mouse Hook Pin
Rex Miao24-Jul-13 17:49
Rex Miao24-Jul-13 17:49 
QuestionPer CPU Cycle Times Pin
Richard Andrew x6421-Jul-13 9:07
professionalRichard Andrew x6421-Jul-13 9:07 
AnswerRe: Per CPU Cycle Times Pin
leon de boer13-Aug-13 8:09
leon de boer13-Aug-13 8:09 
QuestionPhysical drive size Pin
john563219-Jul-13 23:32
john563219-Jul-13 23:32 
SuggestionRe: Physical drive size Pin
Richard MacCutchan20-Jul-13 0:09
mveRichard MacCutchan20-Jul-13 0:09 
GeneralRe: Physical drive size Pin
john563220-Jul-13 0:14
john563220-Jul-13 0:14 
SuggestionRe: Physical drive size Pin
Richard MacCutchan20-Jul-13 0:15
mveRichard MacCutchan20-Jul-13 0:15 
GeneralRe: Physical drive size Pin
john563220-Jul-13 0:24
john563220-Jul-13 0:24 
Below is WMI call
C++
VariantClear(&vtProp);
hr = pclsObj->Get(L"Size", 0, &vtProp, 0, 0);   


Below is IOCTL call
C++
bResult = DeviceIoControl(hDevice,                       // device to be queried
                            IOCTL_DISK_GET_DRIVE_GEOMETRY, // operation to perform
                            NULL, 0,                       // no input buffer
                            pdg, sizeof(*pdg),            // output buffer
                            &junk,                         // # bytes returned
                            (LPOVERLAPPED) NULL);          // synchronous I/O

  CloseHandle(hDevice);

		ULONGLONG DiskSize = 0;    // size of the drive, in bytes

  DiskSize = pdg->Cylinders.QuadPart * (ULONG)pdg->TracksPerCylinder *
               (ULONG)pdg->SectorsPerTrack * (ULONG)pdg->BytesPerSector;
    wprintf(L"Disk size       = %I64d (Bytes)\n"
            L"                = %.2f (Gb)\n", 
            DiskSize, (double) DiskSize / (1024 * 1024 * 1024));


But both gives same result. pdg->Cylinders.QuadPart is coming 1.
GeneralRe: Physical drive size Pin
john563220-Jul-13 1:36
john563220-Jul-13 1:36 
GeneralRe: Physical drive size Pin
Jochen Arndt20-Jul-13 2:02
professionalJochen Arndt20-Jul-13 2:02 
GeneralRe: Physical drive size Pin
john563220-Jul-13 3:53
john563220-Jul-13 3:53 
GeneralRe: Physical drive size Pin
Jochen Arndt20-Jul-13 23:35
professionalJochen Arndt20-Jul-13 23:35 
GeneralRe: Physical drive size Pin
Richard MacCutchan20-Jul-13 2:42
mveRichard MacCutchan20-Jul-13 2:42 
AnswerRe: Physical drive size Pin
Chris Losinger20-Jul-13 11:27
professionalChris Losinger20-Jul-13 11:27 
GeneralRe: Physical drive size Pin
dusty_dex21-Jul-13 3:31
dusty_dex21-Jul-13 3:31 
QuestionWhat does (need to clear the background) mean? Pin
JoneLe8619-Jul-13 8:33
JoneLe8619-Jul-13 8:33 
QuestionRe: What does (need to clear the background) mean? Pin
David Crow19-Jul-13 9:25
David Crow19-Jul-13 9:25 
AnswerRe: What does (need to clear the background) mean? Pin
JoneLe8619-Jul-13 10:28
JoneLe8619-Jul-13 10:28 
GeneralRe: What does (need to clear the background) mean? Pin
David Crow19-Jul-13 10:39
David Crow19-Jul-13 10:39 
GeneralRe: What does (need to clear the background) mean? Pin
JoneLe8619-Jul-13 13:46
JoneLe8619-Jul-13 13:46 
GeneralRe: What does (need to clear the background) mean? Pin
David Crow19-Jul-13 13:51
David Crow19-Jul-13 13:51 
AnswerRe: What does (need to clear the background) mean? Pin
Jochen Arndt19-Jul-13 22:04
professionalJochen Arndt19-Jul-13 22:04 
GeneralRe: What does (need to clear the background) mean? Pin
JoneLe8620-Jul-13 11:14
JoneLe8620-Jul-13 11:14 
GeneralRe: What does (need to clear the background) mean? Pin
Jochen Arndt20-Jul-13 23:26
professionalJochen Arndt20-Jul-13 23:26 
GeneralRe: What does (need to clear the background) mean? Pin
JoneLe8624-Aug-13 9:34
JoneLe8624-Aug-13 9:34 

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.