当前位置:网站首页>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》
边栏推荐
- 三菱M70宏变量读取三菱M80公共变量采集三菱CNC变量读取采集三菱CNC远程刀补三菱机床在线刀补三菱数控在线测量
- Infiltration practice guest account mimikatz sunflower SQL rights lifting offline decryption
- Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
- AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving
- 还原窗口位置的微妙之处
- Pytest multi process / multi thread execution test case
- 2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
- 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
- Smart subway | cloud computing injects wisdom into urban subway transportation
猜你喜欢
[paddleseg source code reading] paddleseg custom data class
10 reasons for not choosing to use free virtual hosts
The maximum expiration time of client secret in azure ad application registration is modified to 2 years
My opinion on how to effectively telecommute | community essay solicitation
量子力学习题
Activiti7 task service - process variables (setvariable and setvariablelocal)
用于TCP协议交互的TCPClientDemo
There is a problem that the package cannot be parsed in the like project
ctf-pikachu-CSRF
还原窗口位置的微妙之处
随机推荐
The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Storage of MySQL database
Flink学习7:应用程序结构
投资深度思考
还原窗口位置的微妙之处
Pytest multi process / multi thread execution test case
[PaddleSeg 源码阅读] PaddleSeg计算Dice
Tcpclientdemo for TCP protocol interaction
Redis cluster view the slots of each node
[Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving
深入浅出对话系统——使用Transformer进行文本分类
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装
【微服务|openfeign】使用openfeign远程调用文件上传接口
idea修改主体颜色
Katalon中控件的参数化
Simple dialogue system -- text classification using transformer
laravel admin里百度编辑器自定义路径和文件名
JDBC 进阶