|
-
April 13th, 1999, 10:25 AM
#1
Format disk programmatically
How do I bring up the format disk dialog box from my program?
-
April 14th, 1999, 02:13 AM
#2
Re: Format disk programmatically
SHFormatDrive pops the standard Windows format dialog.
extern "C" {
WINBASEAPI
LONG
WINAPI SHFormatDrive( HWND hParent , LONG drive, LONG p3, LONG p4);
}
from SHELL32.DLL
hParent = parent window hwnd
drive = A: 0, B: 1, C: 2, etc.
you have to experiment with it a little.
Have in mind that it is undocumented (you will not find it in header files or documentation). And returns different values on 95 and NT:
Under NT it returns nonzero on success. The third and fourth paramters are not used on NT (or i do not know what they are used for - however NT's WinDisk calls it with p3=0xFFFF, p4 = 0)
Under 95 it returns 0 on success. The p3 (or p4) parameter tell the system to format the disk with system files (quick format etc.)
By all means you should investigate the problem because right now I do not have my sources to be more specific.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|