StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
how to embed a winform in the desktop
Rank: Member
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
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,359 Location: Tampa, FL Thanks: 28 times Was thanked: 419 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.
|
|
|
|
Rank: Member
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 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-dllit'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?
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
how to embed a winform in the desktop
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.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close