Notifications
Clear all

[Closed] windows.setWindowPos

are you not bored now? do you have enough fun? good luck.

but as i said above the task doesn’t make any sense for me.

сheers man

fn showMaxTopFullScreen = if (hwnd = windows.getMAXHWND()) != undefined do 
(
	h = (dotnetclass "SystemInformation").VirtualScreen.Width   
	w = (dotnetclass "SystemInformation").VirtualScreen.Height   

	HWND_TOPMOST = -1
	User32.setWindowPos (dotnetobject "IntPtr" hwnd) HWND_TOPMOST 0 0 h w 0
)
showMaxTopFullScreen()

it’s hard to kill max’s border.

2 Replies
(@blyskawka)
Joined: 2 years ago

Posts: 0

And max is no maximized, maybe realy better is working with taskbar. Have read your post in theme about notepad and

global user32 =
(
	source = "using System;
"
	source += "using System.Runtime.InteropServices;
"
	source += "class User32
"
	source += "{
"
	source += " [DllImport(\"user32.dll\")]
"
	source += " public static extern bool ShowWindow(Int64 hWnd, int nCmdShow);
"
	source += "	static int SW_HIDE 	= 0x0;
"
	source += "	static int SW_SHOW	= 0x1;
"
  
	source += " public bool ShowWindowHide(Int64 hWnd) { return ShowWindow(hWnd, SW_HIDE); }
"
	source += " public bool ShowWindowShow(Int64 hWnd) { return ShowWindow(hWnd, SW_SHOW); }
"
	source += "}
"

	csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
	compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"

	compilerParams.ReferencedAssemblies.Add "System.dll"
	compilerParams.ReferencedAssemblies.Add "System.Drawing.dll"

	compilerParams.GenerateInMemory = on
	compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(source)
	
	compilerResults.CompiledAssembly.CreateInstance "User32"
)

 user32.ShowWindowHide TaskBarHWND

This can show or hide taskbar but all windows still snapping to it. Maybe really its better to change hide\show taskbar parameter like you said, but from max.

Found solution on stackoverflow
http://stackoverflow.com/questions/31416438/how-to-auto-hide-the-taskbar-from-the-command-line
Maybe you can help write it correctly to working?

(@denist)
Joined: 2 years ago

Posts: 0

max window has three aggressive children: communication center, quick bar, and that’s ‘icon’ in the left-top corner.
they can’t leave without max’s caption bar. so they (or one of them) prevent hiding border and caption.

the only way is to kill them first.

here is a trick how to “hide” border

fn showMaxTopFullScreen = if (hwnd = windows.getMAXHWND()) != undefined do 
(
	borderwidth = 7 -- it must be the way to it exactly
	
	w = (dotnetclass "SystemInformation").VirtualScreen.Width + borderwidth*2
	h = (dotnetclass "SystemInformation").VirtualScreen.Height + borderwidth

	HWND_TOPMOST = -1
	User32.setWindowPos (dotnetobject "IntPtr" hwnd) HWND_TOPMOST -borderwidth 0 w h 0
)
showMaxTopFullScreen()
1 Reply
(@blyskawka)
Joined: 2 years ago

Posts: 0

Thanks it works!

Have tested on 16:9 3dsmax 2011 win7 all is fine
on 4:3 3dsmax 2016 win10 remain small strip ont the right side. Have changed some parameters,but 2 or 3 pixel strip onleft or rign still visible, cant resize fully.

Anyway thank you very muchs for helping!

the only thing you need is to change in my original code the borderwidth value… make it 8 for example.

to get exactly right border width you have to… hmm … do something:

int border_thickness = GetSystemMetrics(SM_CXSIZEFRAME);
Page 2 / 2