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
 General Discussion
 General Discussion
 How to make a window stays on top?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

neo

17 Posts

Posted - 02/23/2012 :  08:49:19  Show Profile
acSetTopmost not work, I am wrong?
[url=http://www.freeimagehosting.net/bie5d][/url]

Rob

USA
2615 Posts

Posted - 02/23/2012 :  09:05:53  Show Profile  Visit Rob's Homepage
I can't see your picture, it's too small. Perhaps just paste the script here instead. I tested acSetTopmost and it works for me. Of course, there's always the possibility that some apps create windows in a way which makes it difficult to perform this. Try with Notepad to see if it's working...though post the script here first.
Go to Top of Page

neo

17 Posts

Posted - 02/23/2012 :  21:12:17  Show Profile
acSetTopmost(hwndTarget, x, y)

x, y must specify it? sometime I need set current active window to top.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/23/2012 :  21:14:28  Show Profile  Visit Rob's Homepage
acSetTopmost(nil, gsx, gsy)
Go to Top of Page

neo

17 Posts

Posted - 02/23/2012 :  21:21:53  Show Profile
ok, thanks!
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/23/2012 :  21:35:41  Show Profile  Visit Rob's Homepage
On my phone, that's the short response. You may want to use acToggleTopmost(nil,gsx,gsy). This will switch between topmost and normal. acSetTopmost makea it topmost only, doesn't turn topmost off.
Go to Top of Page

neo

17 Posts

Posted - 02/23/2012 :  21:53:01  Show Profile
UnTop = acClearTopmost(nil, gsx, gsy) also be used.
acToggleTopmost much better, thanks a lot!
Go to Top of Page

Rob

USA
2615 Posts

Posted - 02/23/2012 :  23:07:38  Show Profile  Visit Rob's Homepage
Ok, I'm back home now and can explain in more detail about the action function usage.

The Insert button only inserts a template of the function, not one that is code-ready as I cannot know what you're intending to do. For example, acSetTopmost can accept either the handle to a window (hwndTarget, a number) OR the X,Y coordinates to locate the window. If hwndTarget (target window handle) is NULL, which in Lua is represented as nil, that tells StrokesPlus to use the X,Y coordinates to find the window handle and perform the action.

But in your call, nothing was specified, hwndTarget, x, and y weren't a number nor assigned any value at all. When S+ fires an action, several variables are automatically passed into every script, such as gsx (Gesture Start X) and gsy (Gesture Start Y).

So acSetTopmost(nil, gsx, gsy) instructs the action to locate the window under the mouse where the gesture started and set it to topmost.

Make sense?
Go to Top of Page

neo

17 Posts

Posted - 02/24/2012 :  08:41:54  Show Profile
Very detailed =) I set down in the notebook.
Thank you again.

Oh man
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000