AutoHotkey Community

It is currently May 25th, 2012, 7:19 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: October 30th, 2004, 11:15 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 30th, 2004, 11:42 am 
Cool !
Thx, for sharing it :D

[@ Tekl] :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2004, 4:26 pm 
Offline

Joined: October 12th, 2004, 11:34 pm
Posts: 74
Location: São Paulo ,Brazil
Nice, an eye-candy.
Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2005, 11:04 pm 
Are you by any chance Wolfgang from C't magazine?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2005, 12:26 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
I sure hope you mean Tekl, not BoBo.... :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2005, 9:15 am 
Offline

Joined: January 30th, 2005, 11:18 pm
Posts: 133
Location: Darmstadt, Germany
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...


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Eject CDRom
PostPosted: March 22nd, 2008, 4:28 pm 
:? 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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2008, 5:05 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2008, 7:57 pm 
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.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: nightson, S0und, tkmmkt and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group