RizlaUK
10-09-2007, 08:31 AM
ok guys, after seeing a post requesting the ability to format a users drive from a ams app, i made this small dll,
A deliberate drawback, it only shows the windows format dialog, the drive and type passed to the dll will be set the dialog, all the user has to do is click "Start" or "Close".
the reason behind this is i will not release anything that could be used to destroy a users system, so the dialog is a fail safe, you will not be able to just format a users drive with out the users conformation, that being said, heres the info
Example call
-- Requires Windows 2000 or higher.
-- Only invokes the format prompt (doesn't format automatically).
-- Return 0 if Error or Cancel / 1 if successfull
sDrive = "e"-- Drive = A: B: C: ...
nType = 0-- Type = 0 for Full Format / 1 for Quick format
result = String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\FormatDriveDLL.dll", "FormatDrive", "\""..sDrive.."\","..nType, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL));
if result == 0 then
Dialog.Message("Debug", "Format Failed", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
elseif result == 1 then
Dialog.Message("Debug", "Format Success", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
And the APZ
A deliberate drawback, it only shows the windows format dialog, the drive and type passed to the dll will be set the dialog, all the user has to do is click "Start" or "Close".
the reason behind this is i will not release anything that could be used to destroy a users system, so the dialog is a fail safe, you will not be able to just format a users drive with out the users conformation, that being said, heres the info
Example call
-- Requires Windows 2000 or higher.
-- Only invokes the format prompt (doesn't format automatically).
-- Return 0 if Error or Cancel / 1 if successfull
sDrive = "e"-- Drive = A: B: C: ...
nType = 0-- Type = 0 for Full Format / 1 for Quick format
result = String.ToNumber(DLL.CallFunction("AutoPlay\\Docs\\FormatDriveDLL.dll", "FormatDrive", "\""..sDrive.."\","..nType, DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL));
if result == 0 then
Dialog.Message("Debug", "Format Failed", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
elseif result == 1 then
Dialog.Message("Debug", "Format Success", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end
And the APZ