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

^#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. python 抓取request信息,各种cookie,user-agent类的信息,只调试到http可以抓取,https貌似不行。

    import pcap # 安装的是pypcap,本博客有安装方法,不过也比较乱,试试吧.import dpktimport socketimport datetime def sniffer(str ...

  2. mysql server查询客户端连接数

    SELECT substring_index(HOST, ) AS host_name, state, count(*) FROM information_schema. PROCESSLIST GR ...

  3. 添加MyEclipse WebSphere Portal Server支持(一)

    [周年庆]MyEclipse个人授权 折扣低至冰点!立即开抢>> [MyEclipse最新版下载] 一.支持WebSphere Portal Server 本文档介绍了如何支持和开发 We ...

  4. 关于send message 函数

    Windows是一个消息驱动模式的系统,SendMessage 是应用程序和应用程序之间进行消息传递的主要手段之一.由于 SendMessage 函数的参数选项过于繁多,因此很有必要作一个汇总,分门别 ...

  5. STL标准库-Move对容器效率的影响

    技术在于交流.沟通,本文为博主原创文章转载请注明出处并保持作品的完整性 C++11新增move()语法(我暂时交错右值引用),在前面我有一篇文章叫 C++11_右值引用 简单的介绍了右值引用类的实现, ...

  6. [转载]三款SDR平台对比:HackRF,bladeRF和USRP

    这篇文章是 Taylor Killian 13年8月发表在自己的博客上的.他对比了三款平价的SDR平台,认为这三款产品将是未来一年中最受欢迎的SDR平台.我觉得这篇文章很有参考价值,简单翻译一份转过来 ...

  7. webpack 添加 jquery 插件

    webpack.base.config.js 加入以下配置: , plugins: [ new webpack.ProvidePlugin({ jQuery: 'jquery', $: 'jquery ...

  8. Vue.js中用webpack合并打包多个组件并实现按需加载

    对于现在前端插件的频繁更新,所以多多少少要对组件化有点了解,下面这篇文章主要给大家介绍了在Vue.js中用webpack合并打包多个组件并实现按需加载的相关资料,需要的朋友可以参考下.   前言 随着 ...

  9. Tomcat必会的企业级配置调优

    Tomcat服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP程序的首选. ======== 完美的分割线 ...

  10. nodejs tutorials

    设置npm的镜像为淘宝镜像 npm config list npm config set registry " https://registry.npm.taobao.org "