AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add a control to an application window

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
zorglups



Joined: 04 Feb 2005
Posts: 24

PostPosted: Wed Feb 16, 2005 10:43 pm    Post subject: Add a control to an application window Reply with quote

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
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Wed Feb 16, 2005 11:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Thu Feb 17, 2005 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
jonny



Joined: 13 Nov 2004
Posts: 2951
Location: Minnesota

PostPosted: Thu Feb 17, 2005 12:06 am    Post subject: Reply with quote

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
View user's profile Send private message
Watcher



Joined: 27 Dec 2004
Posts: 60

PostPosted: Thu Feb 17, 2005 12:41 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Tester
Guest





PostPosted: Sat Mar 04, 2006 10:33 am    Post subject: Reply with quote

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

PostPosted: Sat Mar 04, 2006 11:59 am    Post subject: Reply with quote

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
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6836
Location: France (near Paris)

PostPosted: Sat Mar 04, 2006 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group