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

边栏推荐
- SQL語句加强練習(MySQL8.0為例)
- Katalon框架测试web(二十一)获取元素属性断言
- 如何远程办公更有效率 | 社区征文
- 【读书会第十三期】视频文件的封装格式
- Typical applications of minimum spanning tree
- Activiti7 task service - process variables (setvariable and setvariablelocal)
- pytest多进程/多线程执行测试用例
- ctf-pikachu-CSRF
- JVM family -- monitoring tools
- [PaddleSeg 源码阅读] PaddleSeg Transform 的 Normalize操作
猜你喜欢

如何远程办公更有效率 | 社区征文

深度优先搜索简要讲解(附带基础题)

Two commonly used graphics can easily realize data display

There is a problem that the package cannot be parsed in the like project

Pytest multi process / multi thread execution test case

Katalon中控件的参数化

渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密

logistic regression

Es network layer

1289_ Implementation analysis of vtask suspend() interface in FreeRTOS
随机推荐
Why is the probability of pod increasing after IPtable
[paddleseg source code reading] paddleseg custom data class
Exercices de renforcement des déclarations SQL (MySQL 8.0 par exemple)
Two sides of the evening: tell me about the bloom filter and cuckoo filter? Application scenario? I'm confused..
My opinion on how to effectively telecommute | community essay solicitation
Redis cluster uses Lua script. Lua script can also be used for different slots
02 specific implementation of LS command
How to dynamically cache components in Vue multi-level route nesting
Calculate the odd sum of 1~n (1~100 as an example)
“软硬皆施”,助力建成新型云计算数据中心
The difference between bagging and boosting in machine learning
Wechat official account web page authorization
10 reasons for not choosing to use free virtual hosts
[paddleseg source code reading] normalize operation of paddleseg transform
【读书会第十三期】视频文件的封装格式
idea修改主体颜色
Perf simple process for multithreaded profile
量子力学习题
Tcpclientdemo for TCP protocol interaction
Typical applications of minimum spanning tree