()
| 593 | } |
| 594 | |
| 595 | func (fb *FormBase) SaveState() error { |
| 596 | if err := fb.clientComposite.SaveState(); err != nil { |
| 597 | return err |
| 598 | } |
| 599 | |
| 600 | var wp win.WINDOWPLACEMENT |
| 601 | |
| 602 | wp.Length = uint32(unsafe.Sizeof(wp)) |
| 603 | |
| 604 | if !win.GetWindowPlacement(fb.hWnd, &wp) { |
| 605 | return lastError("GetWindowPlacement") |
| 606 | } |
| 607 | |
| 608 | state := fmt.Sprint( |
| 609 | wp.Flags, wp.ShowCmd, |
| 610 | wp.PtMinPosition.X, wp.PtMinPosition.Y, |
| 611 | wp.PtMaxPosition.X, wp.PtMaxPosition.Y, |
| 612 | wp.RcNormalPosition.Left, wp.RcNormalPosition.Top, |
| 613 | wp.RcNormalPosition.Right, wp.RcNormalPosition.Bottom) |
| 614 | |
| 615 | if err := fb.WriteState(state); err != nil { |
| 616 | return err |
| 617 | } |
| 618 | |
| 619 | return nil |
| 620 | } |
| 621 | |
| 622 | func (fb *FormBase) RestoreState() error { |
| 623 | if fb.isInRestoreState { |
nothing calls this directly
no test coverage detected