一键拖动生成快速启动工具栏

^#x:: ;自动添加快速启动工具栏
if had_added()
ExitApp ql_add()
Sleep,
if (is_locked())
{
lock_unlock()
}
Sleep,
clear()
Sleep,
control_move()
control_set()
Sleep,
lock_unlock()
blockinput,off ;===================================================== ql_add()
{ winactivate,ahk_class Shell_TrayWnd
WinGetPos, x, y, w, h, ahk_class Shell_TrayWnd
ControlClick, % "x" " y" h, ahk_class Shell_TrayWnd,, R
blockinput,on
while(!menu1_hwnd := waitmenu(click_x, click_y))
Sleep,
ControlSend, ahk_parent, t, ahk_id %menu1_hwnd%
ControlSend, ahk_parent, {Right}, ahk_id %menu1_hwnd%
WinGetPos, m1x, m1y, m1w, m1h, ahk_id %menu1_hwnd%
while(!menu2_hwnd := waitmenu(m1x+m1w, m1y, menu1_hwnd))
Sleep,
ControlSend, ahk_parent,n, ahk_id %menu2_hwnd%
WinWait, 新工具栏 - 选择文件夹
ControlClick, Edit1, 新工具栏 - 选择文件夹,, L
ControlSetText, Edit1, %APPDATA%\Microsoft\Internet Explorer\Quick Launch, 新工具栏 - 选择文件夹
ControlSend, Edit1, {Enter}, 新工具栏 - 选择文件夹
ControlClick, Button1, 新工具栏 - 选择文件夹
ControlGetPos,xs,ys,,,Button1,新工具栏 - 选择文件夹 Loop
{ IfWinExist, 新工具栏 - 选择文件夹
{
WinActivate,新工具栏 - 选择文件夹
MouseMove,xs+,ys+,
Send {LButton}
}
else
{
break
}
Sleep,
}
} is_locked()
{
RegRead, Status, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, TaskbarSizeMove
return !Status
} lock_unlock()
{
WinGetPos, x, y, w, h, ahk_class Shell_TrayWnd
ControlClick,% "x" x " y" y+h, ahk_class Shell_TrayWnd,, R
while(!Menu_hwnd := waitmenu(Click_x, Click_y))
Sleep,
ControlSend, ahk_parent, l, ahk_id %Menu_hwnd%
}
clear()
{
WinGet, ctr_list, ControlList, ahk_class Shell_TrayWnd
Loop, Parse, ctr_list, `n, `r
{
if InStr(A_LoopField,"ToolbarWindow32")
{
ControlGetText, txt, % A_LoopField, ahk_class Shell_TrayWnd
if (txt="Quick Launch")
{
ql_ctr := A_LoopField
break
}
}
}
if ql_ctr
{
ControlGet, ql_ctr_hwnd, Hwnd, , % ql_ctr, ahk_class Shell_TrayWnd
WinGetPos, x, y, w, h, ahk_id %ql_ctr_hwnd%
ControlClick, % "x" " y" h, ahk_id %ql_ctr_hwnd%,, R
while(!Menu1_hwnd := waitmenu(x, y+h))
Sleep,
ControlSend, ahk_parent, v, ahk_id %Menu1_hwnd%
ControlSend, ahk_parent, {Right}, ahk_id %Menu1_hwnd%
WinGetPos, m1x, m1y, m1w, m1h, ahk_id %Menu1_hwnd%
while(!Menu2_hwnd := waitmenu(m1x+m1w, m1y, Menu1_hwnd))
Sleep,
ControlSend, ahk_parent, g, ahk_id %Menu2_hwnd%
WinWaitClose, ahk_id %Menu2_hwnd% WinGetPos, x, y, w, h, ahk_id %ql_ctr_hwnd%
ControlClick, % "x" " y" h, ahk_id %ql_ctr_hwnd%,, R
while(!Menu3_hwnd := waitmenu(x, y+h))
Sleep,
ControlSend, ahk_parent, x, ahk_id %Menu3_hwnd%
WinWaitClose, ahk_id %Menu3_hwnd% WinGetPos, x, y, w, h, ahk_id %ql_ctr_hwnd%
ControlClick, % "x" " y" h, ahk_id %ql_ctr_hwnd%,, R
while(!Menu4_hwnd := waitmenu(x, y+h))
Sleep,
ControlSend, ahk_parent, w, ahk_id %Menu4_hwnd%
WinWaitClose, ahk_id %Menu4_hwnd%
}
} control_move()
{
Loop,
{
ControlGetPos,x2,y2,,,MSTaskListWClass1,ahk_class Shell_TrayWnd
ControlGetPos,x,y,,,ToolbarWindow323,ahk_class Shell_TrayWnd
if (x>x2)
{
WinActivate,ahk_class Shell_TrayWnd
MouseMove,x-,y+,
Send {LButton down}
Sleep,
MouseMove,,y+,
Send {LButton up}
}
else
{
break
}
}
} control_set()
{
blockinput,on
WinActivate,ahk_class Shell_TrayWnd
ControlGetPos,x,y,w,h,ToolbarWindow323,ahk_class Shell_TrayWnd
ControlGetPos,x2,y2,,,MSTaskListWClass1,ahk_class Shell_TrayWnd
MouseMove,x+w+(x2-x-w)*/,h/,
Send {LButton down}
Sleep,
ControlGetPos,,,w0,h,ToolbarWindow323,ahk_class Shell_TrayWnd
wc:=w0/
mousemove,-wc,,,r
con:=
loop
{
if (wc<)
{
break
}
wc:=wc/
ControlGetPos,,,w,h,ToolbarWindow323,ahk_class Shell_TrayWnd
if ((w0-wc*>w)and(con=))
{
con:= }
else if ((w0-wc*=w)and(con=))
{
con:=
}
else if ((w0+wc*<w)and(con=))
{
con:= }
else if ((w0-wc*=w)and(con=))
{
con:=
} if (con=)
{
w0:=w
mousemove,-wc,,,r
}
else
{
w0:=w
mousemove,wc,,,r
} }
Send {LButton up}
blockinput,off
} had_added(){
WinGet, ctr_list, ControlList, ahk_class Shell_TrayWnd
Loop, Parse, ctr_list, `n, `r
{
if InStr(A_LoopField,"ToolbarWindow32")
{
ControlGetText, txt, % A_LoopField, ahk_class Shell_TrayWnd
if (txt="Quick Launch")
{
ql_ctr := A_LoopField
break
}
}
}
if ql_ctr
return
} waitmenu(click_x, click_y, ex_hwnd:="")
{
WinGet, wins, List
a := ""
Loop % wins
{
win := wins%A_index%
WinGetPos, x, y, w, h, ahk_id %win%
WinGetTitle, title, ahk_id %win%
if (!title && (Abs(Click_y-y)< || Abs(Click_y-(y+h))<) && w< && w> && h> && (ex_hwnd ? win<>ex_hwnd : ))
{
return win
}
}
}

win7一键拖动生成快速启动栏的更多相关文章

  1. win7 系统如何设置快速启动栏

    a.在任务栏上右键 -> 工具栏 -> 新建工具栏 -> 跳出选择文件夹对话框,在文件夹里面(光标山洞处)输入这个路径,然后按回车: %userprofile%\AppData\Ro ...

  2. win7 下恢复“经典任务栏”/“快速启动栏”,关闭“窗口自动最大化” -摘自网络

    1.自动放大窗口 鼠标把窗口拖到屏幕边缘时,win7会自做聪明的把窗口放大,有时候这个很烦人. 解决办法: 运行“REGEDIT”打开注册表,找到 “HKEY_CURRENT_USER\Control ...

  3. Win7快速启动栏

    http://jingyan.baidu.com/article/456c463bbc1d140a583144cf.html 1. 在任务栏上右键 -> 工具栏 -> 新建工具栏.   在 ...

  4. win7和win8如何设置快速启动栏

    a.在任务栏上右键 -> 工具栏 -> 新建工具栏 -> 跳出选择文件夹对话框,在文件夹里面(光标山洞处)输入这个路径,然后按回车: %userprofile%\AppData\Ro ...

  5. 如何用INNO安装添加快捷启动方式到Win7的快速启动栏(超级任务栏)

    问题:如何用INNO安装添加快捷启动方式到Win7的快速启动栏(超级任务栏) 在XP下,添加方式是直接把快捷方式复制到%appdata%\Microsoft\Internet Explorer\Qui ...

  6. Delphi -- 创建 桌面、发送到...、快速启动栏、开始菜单、程序菜单、右键菜 单

    {================================================================= 功 能: 创建 桌面.发送到....快速启动栏.开始菜单.程序菜单 ...

  7. vc++ windows 快速启动栏创建快捷方式

    创建快速启动栏 在windows软件开发中,软件安装过程中总是需要在快速启动栏创建快捷方式,下面介绍一种快速启动栏创建快捷方式的方法,具体代码如下:(该方法不支持win10,目前还没有找到win10的 ...

  8. 根据权限显示隐藏SharePoint 2010快速启动栏的链接

    转:http://www.360sps.com/Item/ShowAndHiddenLink.aspx 在SharePoint 2010的快速启动栏中可以根据权限来显示或隐藏列表.库.网站的链接,如果 ...

  9. 自定义 SharePoint 2010 快速启动栏和顶部链接栏

    转:http://vickynuli.blog.163.com/blog/static/180438492201281434249486/ 在网上找到篇文章,自定义快速启动栏和顶部链接栏,以下为代码, ...

随机推荐

  1. sgu106.The equation 拓展欧几里得 难度:0

    106. The equation time limit per test: 0.25 sec. memory limit per test: 4096 KB There is an equation ...

  2. hdu4348

    题解: 因为卡空间,所以直接到spoj上面去做了 区间修改的线段树 但是加lazy会把之前的操作修改 正确的解法是lazy不下传,只是在当前计算 但是听说可以记录时间的下传,我弱弱不会 代码: #in ...

  3. [转载]java中io流关闭的顺序

    原文URL:http://blog.csdn.net/shijinupc/article/details/7191655 还是先看API void close()            Closes ...

  4. python随机数,随机选择……random

    import random from random import random, uniform, randint, randrange, choice, sample, shuffle list = ...

  5. java 引用传递和值传递

    1.为什么要分值传递和引用传递: 基本类型存在在栈中,复合类型(对象)存在堆中.操作栈的速度要快于堆,且对象的复制相比基本类型不仅浪费内存而且速度比较慢. 从这里就可以看出来:对象是按照引用传递(数据 ...

  6. 设置MyEclipse字体大小

    设置MyEclipse字体大小

  7. 增量打包DOC版

    压缩zip的命令有的系统没有的自己去下载一个,否则关闭压缩zip的命令. 有需要的自行更改,这是满足我需求的. 执行 publish.bat 即可,当然需要将文件清单写好放在 resources.tx ...

  8. anu - component

    import { extend, isFn, options, clearArray, noop } from "./util"; import { CurrentOwner } ...

  9. fullPage的使用

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  10. day16 python学习 递归

    初识递归 递归的定义——在一个函数里再调用这个函数本身 现在我们已经大概知道刚刚讲的story函数做了什么,就是在一个函数里再调用这个函数本身,这种魔性的使用函数的方式就叫做递归. 刚刚我们就已经写了 ...