MCPcopy
hub / github.com/lxn/walk / SaveState

Method SaveState

form.go:595–620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

593}
594
595func (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
622func (fb *FormBase) RestoreState() error {
623 if fb.isInRestoreState {

Callers

nothing calls this directly

Calls 3

lastErrorFunction · 0.85
WriteStateMethod · 0.80
SaveStateMethod · 0.65

Tested by

no test coverage detected