AutoHotkey Community

It is currently May 27th, 2012, 10:23 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: August 4th, 2007, 3:32 pm 
Online

Joined: February 9th, 2006, 8:36 pm
Posts: 339
Dreamweaver ColorPicker 1click invoke
Helps accessing Windows ColorPicker (that big dialog).
Works for color attribute properties listed in the CSS Styles panel.

MiddleButton or Alt-Left mouse button on the list item to invoke.

Eliminates 3 clicks, 3 *precise* mouse movements, positions color picker window right where your mouse is thus not obscuring the main window.

Tested with Dreamweaver8
First version.

Image
Image
Code:
#ifwinactive ahk_class _macr_dreamweaver_frame_window_
   MButton::
   !LButton::DreamweaverColorPicker()
#ifwinactive
DreamweaverColorPicker()
{
   CoordMode,mouse,relative
   MouseGetPos,mx,my,,ctl
   ControlGetPos,cx,cy,,,%ctl%
   ifInString,ctl,SysListView
   {   sendmessage,0x101D,0,0,%ctl% ;LVM_GETCOLUMNWIDTH=LVM_FIRST+29=0x101D
      colwd=%ErrorLevel%
      ifLessOrEqual,colwd,0 ;bad winapi response
      {   traytip,,Cannot get first column width!
         return
      }
      MouseClick,L,% cx+colwd+8, %my%, 1, 0
   }
   else
      ifInString,ctl,Button
         MouseClick,L,% cx+4, % cy+4, 1, 0
      else
         return

   WinWaitActive,ahk_class #32770,,1
   ifNotEqual,ErrorLevel,0,return
   sleep,100
   MouseClick,L,180,8,1,0

   WinWait,Color ahk_class #32770,,1
   ifNotEqual,ErrorLevel,0,return
   WinGetPos,x,y,pw,ph
   mx-=pw/2, mx:=(mx<A_ScreenWidth-pw) ? mx : A_ScreenWidth-pw
   my-=ph/2, my:=(my<A_ScreenHeight-ph) ? my : A_ScreenHeight-ph
   WinMove,,,%mx%,%my%
}


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: XX0 and 25 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