 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tekl
Joined: 24 Sep 2004 Posts: 814 Location: Germany
|
Posted: Sat Oct 30, 2004 11:15 am Post subject: Eject a CD-Rom like on Mac OS X |
|
|
Hello,
I've made a small script, which ejects a drive an shows a transparent symbol like in OS X. Download the Image and place it in the same folder of the script: http://www.rumborak.de/bilddaten/forum/Eject.bmp
| Code: |
ScrollLock::
transparent = 150 ; starting transparency
; calculate position
distY = %A_ScreenHeight%
posY = %A_ScreenHeight%
distY /= 4
posY -= %distY%
; create OSD
Gui, Add, pic,x0 y0, %A_ScriptDir%\eject.bmp
DetectHiddenWindows on
WinWait, %A_ScriptName% ; Set the "last found" window to GUI window.
WinSet, TransColor,0000FF %transparent%
WinSet, AlwaysOnTop, On
Gui, -Caption
Gui, Show, w150 h150 y%posY%
Sleep, 100 ; a short sleep, so the image will always be shown
Drive, Eject,F:, ; Eject the drive
if A_TimeSinceThisHotkey < 1000 ; Adjust this time if needed.
{
Drive, Eject,F:, 1 ; Close the drive if ejecting fails
}
; fade down the OSD
Loop, %transparent%
{
transparent -= 1
WinSet, TransColor,0000FF %transparent%
}
Gui, Destroy
return |
Regards, Tekl |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Sat Oct 30, 2004 11:42 am Post subject: |
|
|
Cool !
Thx, for sharing it
[@ Tekl]  |
|
| Back to top |
|
 |
Gre
Joined: 12 Oct 2004 Posts: 74 Location: São Paulo ,Brazil
|
Posted: Tue Nov 02, 2004 4:26 pm Post subject: |
|
|
Nice, an eye-candy.
Thanks |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Jan 31, 2005 11:04 pm Post subject: |
|
|
| Are you by any chance Wolfgang from C't magazine? |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Tue Feb 01, 2005 12:26 am Post subject: |
|
|
I sure hope you mean Tekl, not BoBo....  |
|
| Back to top |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 130 Location: Darmstadt, Germany
|
Posted: Tue Feb 01, 2005 9:15 am Post subject: |
|
|
| Anonymous wrote: | | Are you by any chance Wolfgang from C't magazine? |
He is, indeed. I asked myself the same question and did a bit of research, it was not too hard to find out.
Thanks to Tekl and his article in the german computer magazine c't, I now spend a bit more time on AHK after seeing what is possible with it... |
|
| Back to top |
|
 |
Bucky3006 Guest
|
Posted: Sat Mar 22, 2008 4:28 pm Post subject: Eject CDRom |
|
|
I am very new to this and I don't know how to activate this script. Do I set my own command to activate or what?
Thanks,
Bucky |
|
| Back to top |
|
 |
BoBo¨ Guest
|
Posted: Sat Mar 22, 2008 5:05 pm Post subject: |
|
|
Execute the script. Nothing happens.
Press the ScrollLock key at your keyboard, because the script is assigned to a "Hotkey". One reason why AutoHotkey is named AutoHotkey. |
|
| Back to top |
|
 |
widow Guest
|
Posted: Sat Mar 22, 2008 7:57 pm Post subject: |
|
|
| Code: | | Drive, Eject,F:, ; Eject the drive |
Also you might want to change "F" to the drive you want to eject.
There is a API to check for what kind of drive is there, but the problem comes when it is a virtual CD drive. Some virtual drivers dont like to be ejected i think. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|