This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Releases
 Downloads
 Version 2.1.7 (32-bit and 64-bit)
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Rob

USA
2615 Posts

Posted - 07/05/2012 :  13:49:12  Show Profile  Visit Rob's Homepage
32-bit:

Portable/ZIP Download - Full Application:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x86.zip

Portable/ZIP Download - Changed Files Only:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x86_chg.zip

Setup Package Download:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x86.msi
(simple install; creates program group with shortcuts to StrokesPlus and Help page)

64-bit:

Portable/ZIP Download - Full Application:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x64.zip

Portable/ZIP Download - Changed Files Only:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x64_chg.zip

Setup Package Download:
http://www.strokesplus.com/files/StrokesPlus_2.1.7_x64.msi
(simple install; creates program group with shortcuts to StrokesPlus and Help page)

Change Log:
- Removed duplicate gsx declaration in gestureComplete function (internal)
- Added code to change any pure white color passed into acDisplayText to 254,255,255 since pure white is the transparency color key
- Added a new parameter to the end of acActivateWindow named method. This allows you to try different methods of activating a window since Microsoft has made it very difficult.
Passing 0 uses the default SetForegroundWindow call
Passing 1 uses a method which calls AttachThreadInput to temporarily bind S+ to the target window
Passing 2 presses the Alt key temporarily during the SetForegroundWindow call (a known hack/workaround)

cyberalex4life

53 Posts

Posted - 07/06/2012 :  05:47:12  Show Profile
nice, I know have what to play with :D
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  06:22:46  Show Profile
nope, still don't work or didn't try enough. But this workaround works pretty fine:

local x = acGetMouseLocationX()
local y = acGetMouseLocationY()
acMouseClick(gsx, gsy, 0, 1, 1)
acSendKeys("{ESCAPE}%{F_4}")
acMouseMove(x, y)
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/06/2012 :  06:29:34  Show Profile  Visit Rob's Homepage
I simply don't know what to tell you, I don't have the issue at all, figured maybe some other tweaks would help. Without being able to reproduce this, there's not much I can do.
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  06:43:29  Show Profile
It closes those windows (the one with no maximize function) when I change this code
function sp_before_action(gnm, gsx, gsy, gex, gey, gwd, gapp, gact)
acActivateWindow(nil, gsx, gsy,0)
end
--acActivateWindow(nil, gsx, gsy,1)
acSendKeys("%{F_4}")

in this

function sp_before_action(gnm, gsx, gsy, gex, gey, gwd, gapp, gact)
acActivateWindow(nil, gsx, gsy,0)
end
--acActivateWindow(nil, gsx, gsy,0)
acSendKeys("%{F_4}")

and viceversa (but only with mouse Configure Actions tab opened or minimized, not closed. Otherwise doesn't work at all)

The ideea is, that altghough it should activate the window, acActivateWindow does the oposite. It's the same change of transparency as when you select desktop, or another window. I'm guessing it does not manage to find the correct handle to the window.

This code works fine if you first click on the window:
acSendKeys("%{F_4}")

acActivateWindow deactivates the windows with problems, although they are active at first. That's why the gesture does not succeed.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/06/2012 :  06:51:14  Show Profile  Visit Rob's Homepage
Ok, so it's not a matter of S+ not activating a window, but activating the wrong window.

Put this before your acActivateWindow call and see what it shows:
local sMsg = "Window Title: "..acGetWindowTitle(acGetOwnerWindowByPoint(gsx, gsy),0,0)
sMsg = sMsg.."\nClass Name: "..acGetClassName(acGetOwnerWindowByPoint(gsx, gsy),0,0)
acMessageBox(sMsg,"Title/Class",nil)
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  07:19:11  Show Profile
On Mouse Control Panel Settings:

Window Title:
Class Name: run.dll

Same on Audio Devices Control Panel Settings.

But on Realtek HD Audio Driver:

Window Title: HD Audio CPL for Vista
Class Name: Afx:0000000140000000:0

(every zeros group has 7 zeros, not last - only one)

For Windows Explorer (Computer)

Window Title: Computer
Class Name: CabinetWClass

It seems that every other window that has names in both window title and class name activate just fine..
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/06/2012 :  08:08:03  Show Profile  Visit Rob's Homepage
Most (if not all) Control Panel windows are owned by RunDLL, which doesn't exactly have an interface..though it does have a hidden window. By default, calling:

acActivateWindow(nil,gsx, gsy)

Is going to activate the OWNER window (most of the time that's fine). But for these windows (on my system, Windows 7 64-bit), it would have to be changed to this:

acActivateWindow(acGetWindowByPoint(gsx, gsy),0,0)

Since I want to send the activate directly to the window, NOT the owner.

There's is no perfect solution to these situations, I had to use Spy++ to find out the ownership and adjust.

Note that changing it to fix the Control Panel applet may not work for other windows as expected, which would mean you'd need to build in conditional statements to check the owner first, if it's Rundll, then call acActivateWindow using the different method above, otherwise use the default call.
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  08:23:38  Show Profile
I thought about these test conditions, sadly I don't know Lua... yet...
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  08:48:26  Show Profile
I may have found a new solution:

local handle = acGetWindowByPoint(gsx,gsy)
local x = acGetWindowTop(handle, 0,0)
local y = acGetWindowLeft(handle, 0,0)
acActivateWindow(acGetWindowBottom(nil, x, y),0,0)
acSendKeys("%{F_4}")

With your solution S+ first closes the inner window of the dialog and then the outer. But with this new one it just seems to work perfectly on any window. Thanks for the ideas.

(as you may have noticed instead of usin gsx, gsy, i used the left top corner)
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/06/2012 :  08:50:41  Show Profile  Visit Rob's Homepage
Something like this works (on my system, probably would have to change "RunDLL" to "run.dll"..but I can't say for sure how it will work for you:
local sRunDLL = "RunDLL"
local sOwnerClass = acGetClassName(acGetOwnerWindowByPoint(gsx, gsy),0,0) 
if sOwnerClass == sRunDLL then
	local iWindow = acGetWindowByPoint(gsx, gsy)
	local iParentWindow = acGetParentWindowByPoint(gsx, gsy)
	if acGetClassName(iParentWindow,0,0) == sRunDLL then --see if we're over a child control within the window
		acActivateWindow(iWindow,0, 0)
	else 
		acActivateWindow(iParentWindow,0, 0)
	end
else
	acActivateWindow(nil,gsx, gsy)
end

I just saw your other posting, that's another way to do it
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  13:22:20  Show Profile
iParentWindow = acGetParentWindowByPoint(gsx, gsy)
acActivateWindow(iParentWindow,0, 0)
acSendKeys("%{F_4}")

this does not close programs like zoom player when drawing gesture on playlist or equilizer, but works for main window. Prety fine for 3 rows..
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/06/2012 :  13:38:04  Show Profile  Visit Rob's Homepage
Another way which seems to work well is this.

Put this in your Global Lua:
alien = alien.core
user32 = alien.load("user32.dll")

-- ************ GetAncestor ************

gGetAncestor = user32.GetAncestor
gGetAncestor:types{ ret = 'long', abi = 'stdcall', 'long', 'uint'}
GA_PARENT = 1
GA_ROOT = 2
GA_ROOTOWNER = 3

function aGetAncestor(iWnd, iFlags)
	return gGetAncestor(iWnd, iFlags)
end

Then in your action:
acActivateWindow(aGetAncestor(acGetWindowByPoint(gsx, gsy), GA_ROOT), 0, 0)

Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  14:02:05  Show Profile
Actually I have this tendency for as much as general code... This is why I like the simple one. And, to be honest, I kind of like that it only closes programs only when performed on main windows.
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/06/2012 :  14:13:03  Show Profile
I've integrated it in almost every gesture on windows and it's incredibly fast now
Go to Top of Page

cyberalex4life

53 Posts

Posted - 07/08/2012 :  01:58:40  Show Profile
iParentWindow = acGetParentWindowByPoint(gsx,gsy)
acActivateWindow(nil, gsx, gsy)
acSendKeys("%{F_4}")

iParentWindowTest = acGetParentWindowByPoint(gsx,gsy)
if iParentWindow == iParentWindowTest then
-- test if window is still open
acActivateWindow(iParentWindow,0, 0)
acSendKeys("%{F_4}")
end

solved zoom player problem...
Go to Top of Page

Rob

USA
2615 Posts

Posted - 07/08/2012 :  08:20:05  Show Profile  Visit Rob's Homepage
Good job!

There's always a way
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000