StrokesPlus.net
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
sunnyabcd  
#1 Posted : Monday, April 27, 2020 9:39:38 AM(UTC)
sunnyabcd

Rank: Member

Reputation:

Groups: Approved
Joined: 4/10/2020(UTC)
Posts: 22

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
hi all,
I want to embed a window into the desktop, that means a window is like a part of the wallpaper, how to realize this?

i use codes:
Code:

dp=sp.WindowFromClassOrTitle("", "Progman");
action.Window.Parent=dp;


or

Code:

dp=sp.WindowFromClassOrTitle("", "Progman");
SetParent(action.Window,dp);


it does not work.

Edited by user Tuesday, April 28, 2020 6:56:20 AM(UTC)  | Reason: Not specified

Rob  
#2 Posted : Sunday, May 3, 2020 3:35:36 PM(UTC)
Rob

Rank: Administration

Reputation:

Groups: Translators, Members, Administrators
Joined: 1/11/2018(UTC)
Posts: 1,357
United States
Location: Tampa, FL

Thanks: 28 times
Was thanked: 418 time(s) in 356 post(s)
That's well outside of the scope/functionality of S+, you might want to look around for a shell utility which does that.
sunnyabcd  
#3 Posted : Tuesday, May 12, 2020 1:51:27 AM(UTC)
sunnyabcd

Rank: Member

Reputation:

Groups: Approved
Joined: 4/10/2020(UTC)
Posts: 22

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Rob Go to Quoted Post
That's well outside of the scope/functionality of S+, you might want to look around for a shell utility which does that.


Thanks, Rob.
I have realized this inspired by liuxilu's post :
https://forum.strokesplu...ipt-for-using-native-dll

it's in some sense a litte easy.

first, place the script in load script. (Ref:https://forum.strokesplus.net/posts/t7183-My-script-for-using-native-dll)

then, in your gesture script:

Code:


//Type for return value.
var RtnT = clr.System.Type.GetType("System.Int32");

//Type array for param types.
var ParmT = host.newArr(clr.System.Type, 2);
ParmT[0] = clr.System.Type.GetType("System.IntPtr");
ParmT[1] = clr.System.Type.GetType("System.IntPtr");
//For ByRef vars, append a & after the type name.

//Object array for params.
var Parm = host.newArr(clr.System.Object, 2);
Parm[0] = action.Window.HWnd;        //window handle
Parm[1] = sp.DesktopWindowListView().HWnd;   //Desktop List View handle
//Parm[1] = sp.DesktopWindow().HWnd;   //Desktop handle
//sp.MessageBox(Parm[0],Parm[1]);

//Get SetParent method
var Mthd = MethodFromNativeDll("user32.dll", "SetParent", RtnT, ParmT);

//Invoke method: embed window in desktop
var v = Mthd.Invoke(null, Parm);



hah, success!

most program can be embed in the desktop, it would not be minimized when Win+D,always on the desktop

but some programs, like the sticky notes,calculator,it failed. i think perhaps it because that these programs are uwp app.
can someon solve this problem?
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.