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?

2
  • 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? Commented Sep 26, 2014 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
    Commented Sep 26, 2014 at 13:29

1 Answer 1

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.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.