0

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?

York's
  • 164
  • 10
  • Are you trying to change the position that it will un-minimize to later or are you trying to move it and un-minimize it at the same time? Or something else I've not thought of? – Damien_The_Unbeliever Sep 26 '14 at 13:25
  • @Damien_The_Unbeliever, I'm trying to change position without unminimizing. But when it will be unminized by user, it will appear in other position. – York's Sep 26 '14 at 13:29

1 Answers1

2

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.

Community
  • 1
  • 1
kennyzx
  • 12,845
  • 6
  • 39
  • 83