In realtà è possibile... con la seguente property che ho scritto puoi ottenere ed impostare l'area di lavoro del desktop, ossia la parte di desktop che viene occupata dalle finestre massimizzate:
.codice:Module DWA Private Const SPI_SETWORKAREA As Integer = 47 Private Const SPI_GETWORKAREA As Integer = 48 Private Declare Auto Function SystemParametersInfo Lib "user32" (ByVal uiAction As Integer, ByVal uiParam As Integer, ByRef rect As Drawing.Rectangle, ByVal fWinIni As Integer) As Boolean Public Property DesktopWorkingArea() As Drawing.Rectangle Get Dim deskWorkingArea As Drawing.Rectangle If Not SystemParametersInfo(SPI_GETWORKAREA, 0, deskWorkingArea, 0) Then Throw New System.ComponentModel.Win32Exception End If Return deskWorkingArea End Get Set(ByVal Value As Drawing.Rectangle) If Not SystemParametersInfo(SPI_SETWORKAREA, 0, Value, 0) Then Throw New System.ComponentModel.Win32Exception End If End Set End Property End Module
Se ad esempio la tua finestra sta sulla destra ed è larga 30 pixel ti basterà usare la property in questo modo:
.codice:Dim tdwa As Drawing.Rectangle = DWA.DesktopWorkingArea tdwa.Width-=30 DWA.DesktopWorkingArea=tdwa

Rispondi quotando