Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm sorry if this is a bad question, please let me know how to fix it if necessary.

A glitch with many windows(In windows 10) is that if you hold the X button or the minis button the page will freeze until you let go. This glitch is partially visual,but actually changes how the software acts too. The part I am asking for help on is what is actually happening(Or where to look to find out) when I hold down that X button and what I can look up to find more information on it. I am asking for this help so I can then work on some code to do what

What I have tried:

I want and do more research on my own, I am just having a hard time finding knowing what is going on when I press and hold that button. I have been trying to find out myself, I've looked on the microsoft website but I may have missed something. Any ideas on where to look, or any answers of what is happening?
Posted
Updated 13-May-23 5:07am
v2
Comments
Dave Kreskowiak 13-May-23 11:33am    
What you're calling a "glitch", isn't. What happens between the mouse clicking on the button and releasing it is entirely up to the application or, more precisely, the people that wrote the application code. If they do things that prevent the rest of the application from doing its processing or processing the applications messages, you get the appearance of a "hang".

1 solution

When you press any button, menu item etc., the application receives a message fromn the Windows system. When you release the button it receives a second message. In all cases it is up to the application to decide what action to take for each message. That is an oversimplification of what happens as there is more to the Windows messaging system. In most C# applications the programmer will connect an event handler to each message type. IN Win32 (c and C++) the application writer will create a message handler that actions the mesages they are interested in.

See About Messages and Message Queues - Win32 apps | Microsoft Learn[^]
 
Share this answer
 
Comments
G Schulz 13-May-23 11:41am    
What is the message being sent when I hold the button(the close/minimize), and then what is the message when I move my mouse away and let go?

This happens on several windows.
Richard MacCutchan 13-May-23 12:09pm    
Sorry, I am not sure of the actual sequence. You would need to use Spy++ or similar to see each message passed by the system as you action each control.

I just ran a test and this is the sequence when I clicked the Close button:
<001152> 089F04CC R WM_NCACTIVATE fDeactivateOK:True
<001153> 089F04CC S WM_ACTIVATE fActive:WA_INACTIVE fMinimized:False hwndPrevious:(null)
<001154> 089F04CC R WM_ACTIVATE
<001155> 089F04CC S WM_ACTIVATEAPP fActive:False dwThreadID:00003C58
<001156> 089F04CC R WM_ACTIVATEAPP
<001157> 089F04CC S WM_KILLFOCUS hwndGetFocus:(null)
<001158> 089F04CC R WM_KILLFOCUS
<001159> 089F04CC S WM_IME_SETCONTEXT fSet:0 iShow:C000000F
<001160> 089F04CC S WM_IME_NOTIFY dwCommand:IMN_CLOSESTATUSWINDOW dwCommand:00000001 dwData:00000000
<001161> 089F04CC R WM_IME_NOTIFY
<001162> 089F04CC R WM_IME_SETCONTEXT
<001163> 089F04CC S WM_DESTROY
<001164> 089F04CC R WM_DESTROY
<001165> 089F04CC S WM_NCDESTROY
<001166> 089F04CC R WM_NCDESTROY
<001167> 089F04CC R WM_CLOSE
<001168> 089F04CC R WM_SYSCOMMAND
G Schulz 13-May-23 16:10pm    
Hi I'm having trouble getting any messages to show up? What am I doing wrong? Even when I choose to get messages from all window in system, they only come from one window and its one I don't see.
G Schulz 13-May-23 16:17pm    
Hey I actually found out what I was doing wrong! Thank you, I was using 32 instead of 64 version.
G Schulz 13-May-23 15:42pm    
Thank you!! I will look into this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900