注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

chunwaihome 的博客

 
 
 

日志

 
 

Barnacle 工具欄  

2009-10-17 22:04:23|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
  • 怎樣運用Barnacle

Barnacle 運行後就會在指定的程序界面上加個工具欄。當初我下載了它,覺得沒什麼用。因為被附帶的兩個例子誤導了。

下載點:http://www.donationcoder.com/Software/Skrommel/Barnacle/Barnacle.exe

 Barnacle 工具欄 - Y偉 - chunwaihome 的博客

如何指定程序呢?在 Toolbars 文件夾打開任意一個 ini 文件看看。紅色的為代碼,黑色的為註解:


[Settings]

class=Notepad

    ; 等於號後面的 Notepad 是目標程序的類名。如果獲得程序的類名?很簡單,在 Barnacle 上點擊右鍵,選擇 Show Info,就可以看到當前程序的類名了。

color=FFFFFF

[1]

    ; 表示第一個按鈕

tip=New

    ; 提示文字

image=C:WindowsSystem32Progman.exe,29

    ; 按鈕的圖片

leftaction=Send,^n

    ; 左鍵點擊該按鈕,執行的命令。具體的命令請看 Barnacle.rtf 這個幫助文件。

rightaction=Send,^n!e

    ; 同理,右鍵點擊該按鈕,執行的命令。

middleaction=Menu,File,New

    ; 滾輪點擊該按鈕,執行的命令。


看明白了之後,為你想要加工具欄的軟件創建一個這樣的 ini 文件就可以了。如果你不是Powerpro的用家下面的可以不需理會。Barnacle 工具欄 - Y偉 - chunwaihome 的博客


  • Powerpro的Barnacle

Powerpro也可以實現如此的功能,而且它的功能更加強大例如你可以把腳本加在按鈕上、改變Bar的透明度等。

運用它的方法是在Command List(CL)-->Properties-->Bar-->Position選Below Menu Bar或Below Menu Bar2。

Barnacle 工具欄 - Y偉 - chunwaihome 的博客

 

  • Powerpro的作者怎樣去理解和把該功能加進pp的,下面的文章是從討論區轉貼過來的。其實這文章也就是Autohotkey製造Baracle的工作原理

在窗口菜單下製作一個空白的空間

       It turns out that it is much simpler. All the app does is get the menu handle

of the menubar associated with the window and add a new row to that menu. Then

it draws a tool bar on that. I was very surprised that this seems to work, at

least in XP. Don't know about Vista and beyond.

To test it, I created a win plugin service

win.addmenurow(handle)

which adds a new (blank) row to that window with given window handle (must be a

top level window, I suspect). The plugin normally returns 0, but if it has to

create a new menu bar, it returns that menu handle (this resource will need to

be freed if the underlying window goes, and the caller must do that)

If you want to experiment with this, I uploaded the win plugin to the webeddie

download folder.

http://powerpro.webeddie.com/download/win.dll

將Bar的位置定位在菜單或標題之下

You could create a bar with subbars depending on the active window, and then

move it to either just below the caption (if the target window had no menubar to

start with) or otherwise to below that caption + menu bar height (available from

win.getsystemmetrics(15));

用Event去重新放置Bar的位置於不同的窗口中

As with the autokeyscript, you would have to use an event to reposition bar each

time the active window changed. If you only want to affect certain windows,

you'd have to keep a list of them somehow. You have to remember the handles of

windows which already have extra row added. Finally, you should destroy any

return hmenus if the window they are associated with is destroyed. Since you

have to keep a list of affected windows, if you find handles on the list which

are now invalid, then any associated hmenu created by the win plugin should be

destroyed.

I may look at expanding format contextif at some point to handle this, but I'd

be interested in anything you learn by scripting a solution, if you want to play

with it.
 

  评论这张
 
阅读(982)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017