当前位置:网站首页>Restore the subtlety of window position
Restore the subtlety of window position
2022-07-04 04:11:00 【Topomeyer - long development road】
Many applications implement such a feature : They record the last position on the screen when the window is closed , And try to restore these locations when the application restarts . If you simply implement this function , Then most developers will unconditionally record the last display position of the window , And when the program restarts, restore the window to this position .
however , This may cause usability problems for your program , How to say this? ?
If the user runs two instances of your program , Then the two windows will eventually appear in exactly the same position on the screen . Unless the user looks at the taskbar carefully , Otherwise, when running the second instance , It doesn't seem to have any effect .
Now things are starting to get interesting . Depends on what the program does , The second instance may encounter sharing conflicts , Or it may just open the second copy of the document for editing , Or you may start playing two copies of the song , Which leads to strange echo effect , Because these two instances are not synchronized in time .
More interesting , If the user clicks the stop button , Instead, the music continues to play ! Why? ? Because only the playback of the second instance is stopped , The first instance is still running . I know that a user often runs up to four instances of multimedia titles , This will cause terrible noise , Because they all play attractive music at the same time , Then it causes a lot of confusion when users try to solve the problem , This usually includes tapping on the top instance “ stop it ” Button .
however , This will only stop the top-level instance , But the other three are still running …… If you open the second copy of the document , Users may switch from editor , Then switch back to the first instance , And think all the changes are lost . Or the user may not notice this and make a set of conflicting changes to the first instance . then , When saving two copies of the same document , All kinds of interesting things will happen .
The moral of the story : If your program saves and restores its screen position , You may need to check whether another instance of the program is already running at this screen location . If so , Then move the second window to another location , So that it does not occupy exactly the same coordinates .
summary
Don't worry ,TopomelBox Only one instance can be opened in the whole process , If the user clicks the program icon for the second time , The previous instance will be automatically activated .
Why not support multiple instances , In fact, my younger brother is incompetent , Wait until the wings are hard .
Last
Raymond Chen Of 《The Old New Thing》 It's one of my favorite blogs , There's a lot about Windows Little knowledge , For the vast Windows For platform developers , It's really helpful .
This article is from :《A subtlety in restoring previous window position》

边栏推荐
- Go 语言入门很简单:Go 实现凯撒密码
- SQL語句加强練習(MySQL8.0為例)
- I was tortured by my colleague's null pointer for a long time, and finally learned how to deal with null pointer
- Mindmanager2022 efficient and easy to use office mind map MindManager
- Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
- 【罗技】m720
- [paddleseg source code reading] paddleseg custom data class
- 1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
- Huawei cloud Kunpeng engineer training (Guangxi University)
- How to dynamically cache components in Vue multi-level route nesting
猜你喜欢

函数计算异步任务能力介绍 - 任务触发去重
![[untitled]](/img/b5/bf76783aa428222623d760756a14d9.jpg)
[untitled]

Detailed explanation of PPTC self recovery fuse

Rhcsa-- day one

Es network layer

Introduction to asynchronous task capability of function calculation - task trigger de duplication

Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption

【CSRF-01】跨站请求伪造漏洞基础原理及攻防

JVM family -- monitoring tools

ctf-pikachu-XSS
随机推荐
Is it safe to buy insurance for your children online? Do you want to buy a million dollar medical insurance for your children?
还原窗口位置的微妙之处
【微服务|openfeign】使用openfeign远程调用文件上传接口
JDBC 进阶
Flink学习7:应用程序结构
Simple dialogue system -- text classification using transformer
02 specific implementation of LS command
SQL语句加强练习(MySQL8.0为例)
Balance between picture performance of unity mobile game performance optimization spectrum and GPU pressure
【罗技】m720
vim正确加区间注释
Confession code collection, who says program apes don't understand romance
Introduction to asynchronous task capability of function calculation - task trigger de duplication
10 reasons for not choosing to use free virtual hosts
[PaddleSeg 源码阅读] PaddleSeg计算Dice
潘多拉 IOT 开发板学习(HAL 库)—— 实验6 独立看门狗实验(学习笔记)
My opinion on how to effectively telecommute | community essay solicitation
Pytest multi process / multi thread execution test case
三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO