ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Powershell Script to block certain part of the screen like the taskbar

(1/3) > >>

Etanoder:
Hi,
I would like to have a code in powershell that will use the "SystemParametersInfoW" function in user32.dll from windows 10 and will set an area of the screen as a work area using the method
SPI_SETWORKAREA
0x002F

as explained here https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow

Thanks!

wraith808:
Do you really want this as a PowerShell script? It seems like a GUI to allow you to mark the area would be better than guesstimating the area to block off, IMO.

MilesAhead:
I don't code in powershell but I have written small utilities to set the desktop work area.  I am chiming in just in case you may be unaware that it is a Windows quirk that if the Taskbar is not locked, the work area reported by the system will be the same as the current screen resolution, at least for single monitor systems.

In other words, if you like to run with a disappearing taskbar, setting the work area will have no effect.  I haven't heard anything about it being fixed in Windows 11 so I doubt it ever will be.   ;D

If you wish to try setting the work area to see the effect you are welcome to download my freeware SetWorkArea



Edit:  Also this article may be of interest:
https://docs.microsoft.com/en-us/troubleshoot/windows/win32/calling-systemparametersinfo-work-incorrectly


mouser:
You could also try my Desktop Coral app:
https://www.donationcoder.com/software/mouser/other-windows-apps/desktopcoral

"DesktopCoral is an unusual program designed to "reserve" some portion of your desktop which is shielded from maximized applications..

Essentially, it acts like an invisible resizeable docking bar, which can be docked to any side of your desktop. This invisible dock acts as a barrier to maximized applications and essentially shields this area of your desktop from other applications.

Within this shielded area you might put certain application windows that you want to be always visible, or you might put one of the many desktop tools like a calendar or system information component.

Why would you need a tool like DesktopCoral?

DesktopCoral was requested by someone who uses the Samurize desktop system information utility. This fun utility and others like it draw text and graphics on top of your desktop. But when working with other programs, this information can be covered by these other windows. DesktopCoral solves this problem by reserving an area of your desktop where normal programs will not be expanded into."
--- End quote ---

Etanoder:
Do you really want this as a PowerShell script? It seems like a GUI to allow you to mark the area would be better than guesstimating the area to block off, IMO.
-wraith808 (December 09, 2021, 09:26 AM)
--- End quote ---

that's true but i must see the code involved :(

Navigation

[0] Message Index

[#] Next page

Go to full version