| View previous topic :: View next topic |
| Author |
Message |
zorglups
Joined: 04 Feb 2005 Posts: 24
|
Posted: Wed Feb 16, 2005 10:43 pm Post subject: Add a control to an application window |
|
|
Hi,
Every regular window owns a minimize, restore and a maximize button.
I would like to add 3 small buttons close to those 3 buttons.
Is there a way to do this ?
In my case, I would like to put a check box but a button would be already fine.
e.g. : Some applications are doing this to 'pin' a windows always on top.
Thanks a lot,
Pierre. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Wed Feb 16, 2005 11:05 pm Post subject: |
|
|
| There is no standard way to do this in Windows, and applications that do this, like mmext and WindowBlinds, use methods of their own to do it, such as drawing the buttons themselves (usually using extra system resources in the process). I hope you haven't been fooled into thinking the titlebar is "customizable" and that real buttons can be added to it. That said, though, perhaps you could use a transparent GUI with small buttons and use a SetTimer to have it follow the active window. It wouldn't be pretty, though. |
|
| Back to top |
|
 |
Watcher
Joined: 27 Dec 2004 Posts: 60
|
Posted: Thu Feb 17, 2005 12:01 am Post subject: |
|
|
| I know TheBat does this (optionaly) and it not only doesn't look so good it causes issues. The problem is the functionality of the button they put up there is just great! Wish they had an alternate way to have the button. |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Thu Feb 17, 2005 12:06 am Post subject: |
|
|
| What does the button do? Chances are it could be replicated in AHK, and I think a button in the system tray would be more sensible than one on the titlebar. (You can do this by making the tray button single-click and assigning a custom menu item to it; I'll demonstrate if you're interested) |
|
| Back to top |
|
 |
Watcher
Joined: 27 Dec 2004 Posts: 60
|
Posted: Thu Feb 17, 2005 12:41 am Post subject: |
|
|
| jonny wrote: | | What does the button do? Chances are it could be replicated in AHK, and I think a button in the system tray would be more sensible than one on the titlebar. (You can do this by making the tray button single-click and assigning a custom menu item to it; I'll demonstrate if you're interested) |
Well, it probably can't be replicated, it does a search of all menu items as you type for the string you enter. eg. You type S and all menu items in the program that start with s appear, you type (Sa) and .... etc.... so if you typed Save it would give you a clickable Save to do your save without having to navigate the menus.
The code you mention sounds very cool, please do post it. |
|
| Back to top |
|
 |
Tester Guest
|
Posted: Sat Mar 04, 2006 10:33 am Post subject: |
|
|
hello,
because this topic is a almost one year old, I want to ask if is possible in current version of AHK to add custom buttons to titlebar? |
|
| Back to top |
|
 |
evl
Joined: 24 Aug 2005 Posts: 1237
|
Posted: Sat Mar 04, 2006 11:59 am Post subject: |
|
|
Only the same old way of using SetTimer to watch the co-ordinates of the active window and move a gui so that appears to stay in the titlebar (the faster the SetTimer check the better it would "stick" to the titlebar during/after moving, but the more system resource it would use).
I'm pretty sure someone posted a script a long time back to add some buttons to the titlebar in this fashion. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6836 Location: France (near Paris)
|
Posted: Sat Mar 04, 2006 12:19 pm Post subject: |
|
|
Inside an application, if I recall correctly, the way to do this is to manage the WM_NCPAINT message, sent when Windows paints the title bar.
Then you draw buttons (in the old Windows versions, some people also used it to paint gradients in the title bar).
Of course, you have to handle also the WM_NCMOUSExxx messages to detect a click on the button.
To handle foreign windows (any application) is much harder (message hook?) and probably out of reach of AutoHotkey. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|