Permalink
Browse files

As of 1.30.2

  • Loading branch information...
bgbennyboy committed Nov 22, 2011
1 parent 0ac10df commit 9bcd0497dc5c59937d70372fa17021d18e7bacf0
Showing with 86 additions and 53 deletions.
  1. +8 −3 Readme/USB Disk Ejector.html
  2. +48 −20 USBDiskEject.dpr
  3. BIN USBDiskEject.res
  4. +12 −17 USB_Disk_Eject.cfg
  5. +2 −2 formMain.dfm
  6. +9 −5 formMain.pas
  7. +5 −3 uDiskEjectConst.pas
  8. +2 −3 uDriveEjector.pas
@@ -218,7 +218,7 @@
<div class="logo">
<h1>USB Disk Ejector<br/>
By Bgbennyboy<br/>
- Version 1.3.0.1<br/>
+ Version 1.3.0.2<br/>
Http://quick.mixnmojo.com</h1>
</div>
<div class="clearfloat"></div>
@@ -228,8 +228,13 @@ <h1>USB Disk Ejector<br/>
<div class="content">
<h1>New in this version</h1>
<p>
- Fixed tooltip bug that slipped through testing - if you hovered the mouse over the program when there was no drives inserted it would create an error. Many thanks to Bruce Lightfoot for spotting this.
+ Improved error reporting, if a disk cant be ejected now - it should give a more appropriate response. (If a disk cant be ejected 99% of the time the reason is that a file or process is using the disk).
</p>
+ <h1>New in version 1.3.0.1</h1>
+ <p>
+ Fixed tooltip bug that slipped through testing - if you hovered the mouse over the program when there was no drives inserted it would create an error. Many thanks to Bruce Lightfoot for spotting this.
+ </p>
+
<h1>New in version 1.3</h1>
<p>There's been a huge number of changes since the last stable version. Most elements of the program have been rewritten. Many bugs have been fixed and there are some significant new features. You can see the<a href="#FullChangelog"> full list</a> of changes at <a href="#FullChangelog">the end.</a> The most important ones are listed below:</p>
<ul>
@@ -453,7 +458,7 @@ <h1 id="FullChangelog">New In This Version (The Full List of Changes)</h1>
</ul>
</div>
<div class="footer">
- <p><span class="smalltext">Bgbennyboy 16/11/11</span></p>
+ <p><span class="smalltext">Bgbennyboy 21/11/11</span></p>
</div>
</div>
</body>
View
@@ -120,13 +120,20 @@ begin
if options.UseWindowsNotifications=false then //if its true then windows shows its own message
begin
case EjectErrorCode of
- REMOVE_ERROR_UNKNOWN_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_NONE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_Remove_Error_None + inttostr(GetLastError), bfError);
+ REMOVE_ERROR_UNKNOWN_ERROR:
+ begin
+ if GetLastError > 0 then
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError)
+ else
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError)
+ end
else
- Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLetter + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError);
end;
Sleep(4000); // Give notification time to be shown
end;
@@ -200,13 +207,20 @@ begin
if options.UseWindowsNotifications=false then //if its true then windows shows its own message
begin
case EjectErrorCode of
- REMOVE_ERROR_UNKNOWN_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ') ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
- REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ') ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
- REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ') ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
- REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ') ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
- REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ') ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
+ REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
+ REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
+ REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_NONE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_Remove_Error_None + inttostr(GetLastError), bfError);
+ REMOVE_ERROR_UNKNOWN_ERROR:
+ begin
+ if GetLastError > 0 then
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError)
+ else
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError)
+ end
else
- Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveMountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError);
end;
Sleep(4000); // Give notification time to be shown
end;
@@ -288,13 +302,20 @@ begin
if options.UseWindowsNotifications=false then //if its true then windows shows its own message
begin
case EjectErrorCode of
- REMOVE_ERROR_UNKNOWN_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ') ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
- REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ') ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
- REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ') ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
- REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ') ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
- REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ') ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
+ REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
+ REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
+ REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_NONE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_Remove_Error_None + inttostr(GetLastError), bfError);
+ REMOVE_ERROR_UNKNOWN_ERROR:
+ begin
+ if GetLastError > 0 then
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError)
+ else
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ end
else
- Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveName + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError);
end;
Sleep(4000); // Give notification time to be shown
end;
@@ -375,13 +396,20 @@ begin
if options.UseWindowsNotifications=false then //if its true then windows shows its own message
begin
case EjectErrorCode of
- REMOVE_ERROR_UNKNOWN_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ') ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
- REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ') ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
- REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ') ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
- REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ') ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
- REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ') ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
+ REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
+ REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
+ REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_NONE: Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_Remove_Error_None + inttostr(GetLastError), bfError);
+ REMOVE_ERROR_UNKNOWN_ERROR:
+ begin
+ if GetLastError > 0 then
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError)
+ else
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ end
else
- Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
+ Communicator.DoMessage( '(' + options.CommandLine_Param_RemoveLabel + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError);
end;
Sleep(4000); // Give notification time to be shown
end;
View
Binary file not shown.
View
@@ -25,48 +25,43 @@ ShowPartitionsAsOne=0
MaxWidth=0
[Hotkeys]
-NumHotkeys=8
+NumHotkeys=6
[Cardreaders]
-NumCardreaders=0
+NumCardreaders=1
[Hotkey0]
-Hotkey=116
-HotKeyType=0
-HotKeyParam=
-
-[Hotkey1]
Hotkey=117
HotKeyType=1
HotKeyParam=BEN'S USB
-[Hotkey2]
-Hotkey=118
-HotKeyType=2
-HotKeyParam=A
-
-[Hotkey3]
+[Hotkey1]
Hotkey=119
HotKeyType=2
HotKeyParam=G
-[Hotkey4]
+[Hotkey2]
Hotkey=121
HotKeyType=3
HotKeyParam=G:\dsfsd
-[Hotkey5]
+[Hotkey3]
Hotkey=122
HotKeyType=4
HotKeyParam=SKYMEDI USB_DRIVE
-[Hotkey6]
+[Hotkey4]
Hotkey=113
HotKeyType=4
HotKeyParam=SKYMEDI USB_DRIVEdsfds
-[Hotkey7]
+[Hotkey5]
Hotkey=114
HotKeyType=4
HotKeyParam=USB DISK Pro
+[Cardreader0]
+VendorID=SKYMEDI
+ProductID=USB_DRIVE
+ProductRevision=1.00
+
View
@@ -142,7 +142,7 @@ object Mainfrm: TMainfrm
Left = 16
Top = 112
Bitmap = {
- 494C01010700D001500130003000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
+ 494C01010700D001580130003000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000C00000006000000001002000000000000020
0100000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
@@ -2531,7 +2531,7 @@ object Mainfrm: TMainfrm
Left = 80
Top = 112
Bitmap = {
- 494C010109003802400210001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
+ 494C010109003802480210001000FFFFFFFF2110FFFFFFFFFFFFFFFF424D3600
0000000000003600000028000000400000003000000001002000000000000030
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
View
@@ -518,15 +518,19 @@ procedure TMainfrm.GUIRemoveDrive(MountPoint: String; RemoveCard: boolean);
if options.UseWindowsNotifications = false then //If true then windows shows its own error messagebox
begin
case EjectError of
- REMOVE_ERROR_UNKNOWN_ERROR: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError);
REMOVE_ERROR_DRIVE_NOT_FOUND: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_DRIVE_NOT_FOUND, bfError);
REMOVE_ERROR_DISK_IN_USE: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_DISK_IN_USE, bfError);
REMOVE_ERROR_NO_CARD_MEDIA: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_NO_CARD_MEDIA, bfError);
- REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError)
- else
- if EjectError = 0 then Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR, bfError) //error code 0 means successful!
+ REMOVE_ERROR_WINAPI_ERROR: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_WINAPI_ERROR, bfError);
+ REMOVE_ERROR_NONE: Communicator.DoMessage( '(' + MountPoint + ':) ' + str_Remove_Error_None + inttostr(GetLastError), bfError);
+ REMOVE_ERROR_UNKNOWN_ERROR: //No point showing if windows error code is just 0. 0= no problems
+ begin
+ if GetLastError > 0 then Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError)
+ else
+ Communicator.DoMessage( '(' + MountPoint + ':) ' + str_Remove_Error_Unknown_Error, bfError);
+ end
else
- Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(EjectError), bfError);
+ Communicator.DoMessage( '(' + MountPoint + ':) ' + str_REMOVE_ERROR_UNKNOWN_ERROR_REPORT_CODE + inttostr(GetLastError), bfError);
end;
end;
View
@@ -26,7 +26,7 @@
interface
const
- str_App_Version: string = '1.3.0.1';
+ str_App_Version: string = '1.3.0.2';
str_Ini_FileName: string = 'USB_Disk_Eject.cfg';
str_No_Drive: string = 'No disks found.';
str_Temp_Folder_Write_Error: string = 'Could not write to windows temp dir!' + #13 + 'The program will now exit';
@@ -49,14 +49,16 @@ interface
;
- str_Remove_Error_Unknown_Error = 'The disk could not be ejected - an unknown error was encountered.' + #13#13 + 'Please report this.';
+
str_Remove_Error_Drive_Not_Found = 'The disk could not be ejected - the corresponding drive letter/mountpoint could not be found.';
str_Remove_Error_Name_Not_Found = 'The disk could not be ejected - the corresponding drive name could not be found.';
str_Remove_Error_Label_Not_Found = 'The disk could not be ejected - the corresponding drive label could not be found.';
str_Remove_Error_Disk_In_Use = 'The disk could not be ejected because it is in use.' + #13 + 'Close any programs that might be using the disk and try again.';
str_Remove_Error_No_Card_Media = 'No memory card was found in the specified drive.';
- str_Remove_Error_Winapi_Error = 'The disk could not be ejected - a winapi error was encountered.' + #13#13 + 'Please report this.';
+ str_Remove_Error_Winapi_Error = 'The disk could not be ejected - a winapi error was encountered.' + #13#13 + 'This shouldn''t happen!';
str_Remove_Error_Unknown_Error_Report_Code = 'The disk could not be ejected - an unknown error was encountered.' + #13#13 + 'Error code: ';
+ str_Remove_Error_Unknown_Error = 'The disk could not be ejected.' + #13 + 'Close any programs that might be using the disk and try again.';
+ str_Remove_Error_None = 'The disk could not be ejected - but no errors were detected.' + #13#13 + 'The last error code was: ';
str_Remove_Successful = 'The disk was ejected successfully!';
View
@@ -609,7 +609,6 @@ function TDriveEjector.RemoveDrive(MountPoint: string;
else
if EjectDevice(MountPoint, EjectErrorCode, ShowEjectMessage) then
begin
- //DeleteArrayItem(DriveIndex); //On devices with multiple partitions only 1 item would get deleted
FindRemovableDrives;
result:=true;
end;
@@ -772,7 +771,7 @@ function TDriveEjector.EjectDevice(MountPoint: string; var EjectErrorCode: integ
if GetLastError = 32 then
EjectErrorCode:=REMOVE_ERROR_DISK_IN_USE
else
- EjectErrorCode:=GetLastError; //REMOVE_ERROR_UNKNOWN_ERROR;
+ EjectErrorCode:=REMOVE_ERROR_UNKNOWN_ERROR;
exit;
end;
@@ -848,7 +847,7 @@ function TDriveEjector.EjectDevice(MountPoint: string; var EjectErrorCode: integ
if GetLastError = 32 then
EjectErrorCode:=REMOVE_ERROR_DISK_IN_USE
else
- EjectErrorCode:=GetLastError;//REMOVE_ERROR_UNKNOWN_ERROR;
+ EjectErrorCode:=REMOVE_ERROR_UNKNOWN_ERROR;
end;
end;

0 comments on commit 9bcd049

Please sign in to comment.