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

边栏推荐
- [paddleseg source code reading] paddleseg custom data class
- MySQL one master multiple slaves + linear replication
- Msgraphmailbag - search only driveitems of file types
- Value transfer communication between components (parent to child, child to parent, brother component to value)
- Graduation summary
- The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
- Pytest multi process / multi thread execution test case
- 投资深度思考
- Two commonly used graphics can easily realize data display
- Spa in SDP
猜你喜欢

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

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

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.

Brief explanation of depth first search (with basic questions)

Select sorting and bubble sorting template

渗透实战-SQLServer提权

用于TCP协议交互的TCPClientDemo

SQL statement strengthening exercise (MySQL 8.0 as an example)

'2'>' 10'==true? How does JS perform implicit type conversion?

Detailed explanation of PPTC self recovery fuse
随机推荐
Support the first triggered go ticker
【罗技】m720
laravel admin里百度编辑器自定义路径和文件名
Storage of MySQL database
SQL语句加强练习(MySQL8.0为例)
Cesiumjs 2022^ source code interpretation [0] - article directory and source code engineering structure
functools下的reduce函数
Objective-C description method and type method
Evolution of MySQL database architecture
MySQL maxscale realizes read-write separation
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。
Brief explanation of depth first search (with basic questions)
STM32外接DHT11显示温湿度
[book club issue 13] packaging format of video files
指针数组和数组指针
Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool
Go 语言入门很简单:Go 实现凯撒密码
[Huawei cloud IOT] reading notes, "Internet of things: core technology and security of the Internet of things", Chapter 3 (I)
[PaddleSeg 源码阅读] PaddleSeg Transform 的 Normalize操作
新型数据中心,助力加快构建以数据为关键要素的数字经济