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

^#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. js根据选中的复选框,隐藏那一行

    如图,选择复选框,点击“隐藏”按钮,隐藏选中行 1.JavaScript代码: function getCheckedIds() { var checkedSubject = $('#showSbgl ...

  2. call、apply的应用

    call方法: 语法:call([thisObj[,arg1[, arg2[,   [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象. 说明: call 方法可以用来 ...

  3. Java——使用File类递归遍历指定路劲下的所有文件

    body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...

  4. L1-002 打印沙漏

    所谓“沙漏形状”,是指每行输出奇数个符号:各行符号中心对齐:相邻两行符号数差2:符号数先从大到小顺序递减到1,再从小到大顺序递增:首尾符号数相等. 给定任意N个符号,不一定能正好组成一个沙漏.要求打印 ...

  5. LinkedStack<T>

    public class LinkedStack<T> { private static class Node<U> { U item; Node<U> next; ...

  6. 使用Query进行HQL语句查询和SQL语句查询

    HQL的语法比较简单,与普通SQL的区别之处是针对对象的不同,在查询语句中将sql中的表名替换成了sql中的持久化类名,因为hibernate机制是基于对象进行查询的. 不带参数的查询,语句是“fro ...

  7. ZOJ3180 Number Game

    ZOJ3180 Number Game 要点: 判断后三个数字能否通过上述的变换过程 推出前三个数字 ,我们可以逆向思维考虑 也就是逆着推回去 如果符合后三个数字 或其变换一次的数字(即符合其中一种组 ...

  8. MyEclipse怎么导入导出项目

    MyEclipse怎么导入导出项目 | 浏览:25271 | 更新:2012-06-06 17:48 1 2 3 4 5 6 7 分步阅读 MyEclipse,是一个十分优秀的功能强大的JavaEE的 ...

  9. hacking a friend's Linux buzzer driver in OK335xS

    /**************************************************************************** * hacking a friend's L ...

  10. 【OpenCV】Learn OpenCV

    learn opencv website: https://www.learnopencv.com/ learn opencv github:https://github.com/spmallick/ ...