matelindonesia
asked on
Shutdown and Eject USB Disk
Hi all,
Anyone can help me how to create a function to shutdown/eject USB Disk just what windows done by click Safely Remove Hardware Icon in systray. I wonder there's a function with drive parameter, examp: ShutDownUSB(driveletter: char)
Sirro
Anyone can help me how to create a function to shutdown/eject USB Disk just what windows done by click Safely Remove Hardware Icon in systray. I wonder there's a function with drive parameter, examp: ShutDownUSB(driveletter: char)
Sirro
I've try the example code, and installed the JEDI component(JVCL and JCL), but why it always ask the JwaDbt unit?
FYI I used Jedi component ver 3.00
Thanks
FYI I used Jedi component ver 3.00
Thanks
Because this is the Jedi-Apilib which is a conversion of the Win32 API.
Add the path to the directory where you unpacked the jedi-apilib files to the library path of Delphi.
Also to the Setup API conversion.
Sorry, these files have no installer yet.
Add the path to the directory where you unpacked the jedi-apilib files to the library path of Delphi.
Also to the Setup API conversion.
Sorry, these files have no installer yet.
ASKER
Oke, I've add the library path for win32 api and Setup API Conversion, It works, but why whe it entered the FillDriveList procedure, excatly on GetDriveInstanceID procedure it raised EAccessViolation.
FYI I've code on WinXP OS with SP2, is it make any influence?
FYI I've code on WinXP OS with SP2, is it make any influence?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to robert_marquardt,
I finally got solution after looking for it since last year,
BRAVO ...!!!
:)
Regards
Sirro
I finally got solution after looking for it since last year,
BRAVO ...!!!
:)
Regards
Sirro
For other readers:
The problem with the demo program was that i tested it only under Win 2000.
The bug in the Setup API conversion was Win XP specific. That resulted in the demo not being able to access the Setup API at all when compiled for Win XP.
I do know more about CM_Request_Device_Eject. Better not try to use it from a service.
There are numerous quirks in that API resulting in unwanted Surprise Removal dialogs popping up.
The problem with the demo program was that i tested it only under Win 2000.
The bug in the Setup API conversion was Win XP specific. That resulted in the demo not being able to access the Setup API at all when compiled for Win XP.
I do know more about CM_Request_Device_Eject. Better not try to use it from a service.
There are numerous quirks in that API resulting in unwanted Surprise Removal dialogs popping up.
I got the same problem, how do I solve it? Please help.
Regards,
Maciek
Regards,
Maciek
The bug is in cfgmgr32.pas. I converted CM_Is_Version_Available and CM_Is_Version_Available_Ex , but these functions are not in cfgmgr32.dll.
Search for "CM_Is_Version_Available" and comment out *all* occurrences.
These functions are in fact a bad trick of MS Visual Studio. It uses cfgmgr.lib instead of cfmgr32.lib to link to the DLL and these functions
are implemented in the lib whereas most other functions are delegated to the DLL as usual.
Search for "CM_Is_Version_Available" and comment out *all* occurrences.
These functions are in fact a bad trick of MS Visual Studio. It uses cfgmgr.lib instead of cfmgr32.lib to link to the DLL and these functions
are implemented in the lib whereas most other functions are delegated to the DLL as usual.
Get both Zips from http://www.sf.net/projects/jedi-apilib
In "Setup and Config Manager API" you will find an example precisely for what you want to do.