Click here to Skip to main content
15,890,995 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionbinding an application to an application Pin
swarup30-Jun-07 4:51
swarup30-Jun-07 4:51 
AnswerRe: binding an application to an application Pin
Arman S.30-Jun-07 5:00
Arman S.30-Jun-07 5:00 
Questioncannot open include file 'res\OhMyGod.rc2'. Pin
gentleguy30-Jun-07 3:52
gentleguy30-Jun-07 3:52 
AnswerRe: cannot open include file 'res\OhMyGod.rc2'. Pin
Cyrilix30-Jun-07 10:34
Cyrilix30-Jun-07 10:34 
Questionvista security Pin
saisp30-Jun-07 3:14
saisp30-Jun-07 3:14 
AnswerRe: vista security Pin
bob1697230-Jun-07 6:59
bob1697230-Jun-07 6:59 
QuestionHow to find out on which disk (not partition) is Windows installed? Pin
Claudiu Bucur30-Jun-07 3:06
Claudiu Bucur30-Jun-07 3:06 
AnswerRe: How to find out on which disk (not partition) is Windows installed? Pin
Randor 30-Jun-07 12:21
professional Randor 30-Jun-07 12:21 
Heres what I would do:

Step 1.) Read the %WINDIR% environment variable and parse what it returns. Lets say it returns C:\Windows\...

Step 2.) Save the drive letter "C:" into a buffer lets say szDrive[3].

Step 3.) Use the QueryDOSDevice() function to see which physical drive.

char szBuf[256];<br />
BOOL bResult = QueryDosDevice(szDrive,szBuf,sizeof(szBuf));


Step 4.) If we also wanted to know partition information we could do something like:

sprintf(szPhysical,"%s%s","\\\\.\\",szDrive);<br />
hDevice = CreateFile(szPhysical,GENERIC_READ,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_FLAG_SEQUENTIAL_SCAN,NULL);<br />
if (INVALID_HANDLE_VALUE != hDevice)<br />
{<br />
	DWORD dwRet =0;<br />
	bResult = DeviceIoControl(hDevice,IOCTL_DISK_GET_PARTITION_INFO,NULL,0,&p,sizeof(p),&dwRet,NULL);<br />
	printf("PartitionNumber: 0x%x %d",p.PartitionNumber,p.PartitionNumber);<br />
}


There are plenty of other IoCtl calls you can do to get extended information such as disk geometry.

Best Wishes,
Randor (David Delaune)
AnswerRe: How to find out on which disk (not partition) is Windows installed? Pin
Claudiu Bucur1-Jul-07 1:10
Claudiu Bucur1-Jul-07 1:10 
QuestionHow to use webcam in VC++? Pin
gentleguy30-Jun-07 2:01
gentleguy30-Jun-07 2:01 
AnswerRe: How to use webcam in VC++? Pin
Mark Salsbery1-Jul-07 10:11
Mark Salsbery1-Jul-07 10:11 
QuestionRegLoadKey Privilege Problem Pin
Akin Ocal30-Jun-07 0:17
Akin Ocal30-Jun-07 0:17 
QuestionRe: RegLoadKey Privilege Problem Pin
David Crow2-Jul-07 5:05
David Crow2-Jul-07 5:05 
QuestionCString Pin
deeps_cute30-Jun-07 0:08
deeps_cute30-Jun-07 0:08 
AnswerRe: CString Pin
Christian Graus30-Jun-07 0:49
protectorChristian Graus30-Jun-07 0:49 
QuestionHow to do bluetooth programming on the computer side? Pin
followait29-Jun-07 23:13
followait29-Jun-07 23:13 
GeneralRe: How to do bluetooth programming on the computer side? Pin
shpid3r30-Aug-07 5:31
shpid3r30-Aug-07 5:31 
QuestionImplicit constructors Pin
tom groezer29-Jun-07 22:47
tom groezer29-Jun-07 22:47 
AnswerRe: Implicit constructors Pin
Sameerkumar Namdeo29-Jun-07 23:46
Sameerkumar Namdeo29-Jun-07 23:46 
AnswerRe: Implicit constructors Pin
fefe.wyx29-Jun-07 23:53
fefe.wyx29-Jun-07 23:53 
QuestionGet all controls on a form Pin
braune29-Jun-07 21:57
braune29-Jun-07 21:57 
QuestionRe: Get all controls on a form Pin
Hamid_RT30-Jun-07 0:42
Hamid_RT30-Jun-07 0:42 
AnswerRe: Get all controls on a form Pin
braune30-Jun-07 10:45
braune30-Jun-07 10:45 
AnswerRe: Get all controls on a form Pin
Mark Salsbery1-Jul-07 10:40
Mark Salsbery1-Jul-07 10:40 
QuestionRe: Get all controls on a form Pin
David Crow2-Jul-07 5:08
David Crow2-Jul-07 5:08 

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.