Click here to Skip to main content
15,887,436 members
Home / Discussions / C#
   

C#

 
GeneralRe: Before Resize Pin
Heath Stewart1-Jul-04 4:56
protectorHeath Stewart1-Jul-04 4:56 
GeneralRe: Before Resize Pin
bouli1-Jul-04 5:00
bouli1-Jul-04 5:00 
GeneralRe: Before Resize Pin
Dave Kreskowiak1-Jul-04 5:24
mveDave Kreskowiak1-Jul-04 5:24 
GeneralRe: Before Resize Pin
bouli1-Jul-04 5:35
bouli1-Jul-04 5:35 
GeneralRe: Before Resize Pin
Dave Kreskowiak1-Jul-04 5:49
mveDave Kreskowiak1-Jul-04 5:49 
GeneralRe: Before Resize Pin
bouli1-Jul-04 5:44
bouli1-Jul-04 5:44 
GeneralRe: Before Resize Pin
Anonymous1-Jul-04 8:18
Anonymous1-Jul-04 8:18 
GeneralRe: Before Resize Pin
bouli1-Jul-04 9:33
bouli1-Jul-04 9:33 
Hi,

I would not do that. One possible way I have done is the following:
- 1) when loading
* a) initialize the default value of the state, size, location of the window
* b) try to read values from the saving location (ini file, xml file, registry...)
* c) if succeed to read the values, assign these values to the current window
- 2) when closing
* a) save the state of the window to the saving location
* b) if the window is not minimized or not maximized (set to normal),
save the current size and location to the saving location
else
save the size and location that was read just before maximize or minimize.

to save the size and location of the window just before being maximize, as Heath suggested, I override the WinProc method and processed the WM_SYSCOMMAND message if the WParam of the WM_SYSCOMMAND is SC_MAXIMIZE or SC_MINIMIZE then we save the size and location of the window before calling the base.WinProc method.
And it works just fine.
This is the usual way in C++, so it's the same logic in C#.

Best regards.


There is no spoon.
GeneralWMI problem on Windows 98 Pin
sachinkalse30-Jun-04 22:12
sachinkalse30-Jun-04 22:12 
GeneralRe: WMI problem on Windows 98 Pin
Heath Stewart1-Jul-04 4:45
protectorHeath Stewart1-Jul-04 4:45 
GeneralRe: WMI problem on Windows 98 Pin
sachinkalse1-Jul-04 20:24
sachinkalse1-Jul-04 20:24 
GeneralRe: WMI problem on Windows 98 Pin
Heath Stewart2-Jul-04 2:06
protectorHeath Stewart2-Jul-04 2:06 
GeneralMouse Click Pin
Antonius_r330-Jun-04 19:59
Antonius_r330-Jun-04 19:59 
GeneralRe: Mouse Click Pin
Dave Kreskowiak1-Jul-04 4:36
mveDave Kreskowiak1-Jul-04 4:36 
GeneralRe: Mouse Click Pin
Antonius_r31-Jul-04 5:13
Antonius_r31-Jul-04 5:13 
GeneralRe: Mouse Click Pin
ezak1-Jul-04 5:35
ezak1-Jul-04 5:35 
GeneralRe: Mouse Click Pin
Dave Kreskowiak1-Jul-04 5:56
mveDave Kreskowiak1-Jul-04 5:56 
Generalxml Pin
cmarmr30-Jun-04 17:00
cmarmr30-Jun-04 17:00 
GeneralRe: xml Pin
Heath Stewart30-Jun-04 18:11
protectorHeath Stewart30-Jun-04 18:11 
GeneralRe: xml Pin
Nick Parker30-Jun-04 18:16
protectorNick Parker30-Jun-04 18:16 
GeneralRe: xml Pin
Nick Parker30-Jun-04 18:15
protectorNick Parker30-Jun-04 18:15 
GeneralCheckedListBox Pin
ahmed mohamed abdelhameed30-Jun-04 16:13
ahmed mohamed abdelhameed30-Jun-04 16:13 
GeneralRe: CheckedListBox Pin
saud_a_k30-Jun-04 23:39
saud_a_k30-Jun-04 23:39 
GeneralRe: CheckedListBox Pin
Robert Rohde1-Jul-04 19:26
Robert Rohde1-Jul-04 19:26 
GeneralUpdating access file Pin
benglish7230-Jun-04 15:22
benglish7230-Jun-04 15:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.