Hi
vb .net 9, Forms app, Windows 11 fully updated.
Just for completeness, here is the solution I found. It works just as I wanted, no fuss, no cuss.
I found that all Forms require this Sub, if any do not have it then it seems it will not do the job.
As I run multiple instances of this app (actually just 2, 1 on each of 2 Surface Pros), I can confirm this works fine.
' This code required on every Form (as far as I can determine).
Private Const WM_QUERYENDSESSION As Integer = &H11
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_QUERYENDSESSION Then
m.Result = CType(1, IntPtr) Return
End If
MyBase.WndProc(m)
End Sub