r/dotnet•
patrik-rydzik

Problem with showing widget after adding window to progmem as child .NET 8 win forms

I tried to make widget but i have problem with visibility after setting window as child, window disapear.
I tried anything like timing or using workerw but nothing worked. Can someone help me with this?
This is short version of my code: <DllImport("user32.dll")>

Public Shared Function FindWindow(lpClassName As String, lpWindowName As String) As IntPtr

End Function

<DllImport("user32.dll")>

Public Shared Function SetParent(hWndChild As IntPtr, hWndNewParent As IntPtr) As IntPtr

End Function

Private Async Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

Me.TopMost = False

Me.Opacity = 0.8

Me.FormBorderStyle = FormBorderStyle.None

Centering()

startupInit()

StatusChecker()

LoadDgv()

Dim progman As IntPtr = FindWindow("Progman", Nothing)

SetParent(Me.Handle, progman)

End Sub

Posted Jul 4, 2025, 1:33 AM UTC

01
Loading comments…