StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 General Discussion
 General Discussion
 Close window

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Surenpahlav Posted - 01/30/2019 : 12:36:05
Close window stroke randomly causes explorer to crash (restart) when stroked on an explorer window (not any program other than windows).

I use this code to close the current window:
acCloseApplication(nil, gsx, gsy)


both:
acSendControlDown()
acSendKeys("w")
acSendControlUp()


and:
acSendKeys("%{F_4}")


only work if the current window is focused, so I don't use those.

What can cause this?
5   L A T E S T    R E P L I E S    (Newest First)
Surenpahlav Posted - 01/31/2019 : 11:14:33
Mmm okay the 2nd code has no effect on anything. Also the first code only works half the time when alt+f4 is used for closing window, the other half it will bring up the shutdown dialog as usual.

But anyway if it works with acCloseApplication(nil, gsx, gsy) without crashing explorer.exe then I'm happy. It only happens randomly anyway so I haven't had the time to fully test it yet.
Rob Posted - 01/31/2019 : 09:47:46
First, make sure you only have on instance of sp_before_action in your Global Lua. If you copied and pasted the above in and the default placeholder was already there, it wouldn't work right.

Also, it looks like I expanded the parameter list at some point. So, find any sp_before_action functions in Global Lua and remove them, replace with this and see what happens.

function sp_before_action(gnm,gsx,gsy,gex,gey,gwd,gapp,gact,gbl,gbt,gbr,gbb)
acActivateWindow(nil, gsx, gsy)
end
Surenpahlav Posted - 01/31/2019 : 09:36:44
Thanks the first code worked!

But the 2nd code "for all actions" did not work on its own without the first code. I tried putting it in global Lua and sending alt+f4 on the close action when the window was not focused, it just brought up the shutdown dialog of Windows 7.
Rob Posted - 01/31/2019 : 06:36:57
Oh, and the reason is because you're sending a message to the shell (Explorer, which is Taskbar, Start, etc) to close since it would be the active/foreground window.
Rob Posted - 01/31/2019 : 06:33:17
See this thread to activate the window first:
https://www.strokesplus.com/forum/topic/316/dyk-acsendkeys-and-window-focus?SearchTerms=acactivatewindow

Also, you can set this to happen for all actions, as described from this thread:
https://www.strokesplus.com/forum/topic/314/actions-occur-to-focused-window

quote:
Don't forget you can utilize the sp_before_action function in Global Lua to always activate the window below where the gesture began:
function sp_before_action(gnm, gsx, gsy, gex, gey, gwd)
acActivateWindow(nil, gsx, gsy)
end
It will fire before all actions (not those defined in the Hotkey tab, though)

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000