AutoHotkey Community

It is currently May 27th, 2012, 10:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: October 12th, 2011, 9:02 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
I ran into a need for this a few days ago. It surprised me that windows can be added... but not deleted. Without this I can't see using groups on any serious project.

The case was only including Windows on a certain monitor, in which the bottom needed to be activated. The script would then move that window to the main monitor requiring it to be removed from the group. I had to recommend calling WinGet to get a list of all windows and filter them out from there; it was ugly.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 9:19 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
To be honest I don't see the point in groups when you can just use an array and a loop around each command that needs to work with groups. It's just one of those language features that are only useful in very special cases and add bloat otherwise.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 9:27 pm 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
perhaps window "groups" could just be reimplemented as objects, that way they can be changed by the script directly.

A group would just be an array of matching window texts.

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 9:53 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
+1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 12th, 2011, 10:23 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
That would not be feasible since window groups must be thread-safe. They are accessed by the keyboard/mouse hook thread and main thread simultaneously. This is also the reason GroupRemove or similar hasn't been implemented yet. Aside from that, objects are slow to access and window groups are not just arrays of text; ahk_class, ahk_id, etc. are pre-parsed when GroupAdd is called.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group