Show note using ShowWindow to cause "holes" in sticks

I use the following to show / hide the window by its handle:

[DllImport("user32.dll")] private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);

// Win32 API Constants for ShowWindowAsync()
private const int SW_HIDE = 0;
private const int SW_SHOW = 5;

ShowWindowAsync(_hWnd, SW_SHOW); //Show Window
ShowWindowAsync(_hWnd, SW_HIDE); //Hide Window

When I hide Sticky Notes and then show them again, it causes visual “holes” in the sticks, and I have to close Sticky Notes and open it again.

Here is a screenshot of the problem: enter image description here

I believe the problem is with Sticky Notes.
I don’t know why this is happening, but I would like to solve it somehow.

I was thinking about checking if the Sticky Notes window is, and if it is then Open / Close it will act the same instead of Show / Hide, but I don't like it - it feels hacked.

0
source share
1 answer

ShowWindowAsync() ShowWindow() .

, ShowWindowAsync() , , , , .

0

Source: https://habr.com/ru/post/1530027/


All Articles