Reputation: 164
I'm trying to change position of window, which is minimized at the moment, under C#. I've tried to do it with SetWindowPos function, with different parameters, but it changes position only of not minimized to taskbar windows.
Is there way in which I can do this?
Upvotes: 0
Views: 998
Reputation: 12993
Use GetWindowPlacement
and SetWindowPlacement
functions.
From the legendary blog "The Old New Thing".
If you have a minimized window and want to know where it will go when you restore it, the GetWindowPlacement function will tell you. In particular, the rcNormalPosition tells you where the window would go if it were restored (as opposed to minimized or maximized).
The GetWindowPlacement and SetWindowPlacement functions are typically used by programs that wish to save/restore window positioning information across runs.
Edit:
I just find this question has been asked before, and looks like these 2 functions do not work for WinForm Window.
Upvotes: 2