当前位置:网站首页>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》

边栏推荐
- [Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
- Katalon使用script实现查询List大小
- Two commonly used graphics can easily realize data display
- Idea modify body color
- Objective-C member variable permissions
- [Yugong series] go teaching course 002 go language environment installation in July 2022
- 疫情来袭--远程办公之思考|社区征文
- EV6 helps the product matrix, and Kia is making efforts in the high-end market. The global sales target in 2022 is 3.15 million?
- 【微服务|openfeign】feign的两种降级方式|Fallback|FallbackFactory
- mysql数据库的存储
猜你喜欢

I Build a simple microservice project

JVM family -- monitoring tools

AAAI2022 | Word Embeddings via Causal Inference: Gender Bias Reducing and Semantic Information Preserving

Storage of MySQL database

三年进账35.31亿,这个江西老表要IPO了

Typical applications of minimum spanning tree

Pytest multi process / multi thread execution test case

2022-07-03: there are 0 and 1 in the array. Be sure to flip an interval. Flip: 0 becomes 1, 1 becomes 0. What is the maximum number of 1 after turning? From little red book. 3.13 written examination.

【罗技】m720

Brief explanation of depth first search (with basic questions)
随机推荐
Objective-C description method and type method
2022-07-03:数组里有0和1,一定要翻转一个区间,翻转:0变1,1变0。 请问翻转后可以使得1的个数最多是多少? 来自小红书。3.13笔试。
Getting started with the go language is simple: go implements the Caesar password
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
图解网络:什么是热备份路由器协议HSRP?
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Evolution of MySQL database architecture
Detailed explanation of PPTC self recovery fuse
[paddleseg source code reading] normalize operation of paddleseg transform
Flink学习6:编程模型
函数计算异步任务能力介绍 - 任务触发去重
01 QEMU starts the compiled image vfs: unable to mount root FS on unknown block (0,0)
疫情来袭--远程办公之思考|社区征文
MySQL one master multiple slaves + linear replication
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
Why is the probability of pod increasing after IPtable
functools下的reduce函数
Spa in SDP
【愚公系列】2022年7月 Go教学课程 002-Go语言环境安装