Questions tagged [windows-messages]

Questions about various messages in a Windows system.

Windows is an event driven operating system basically only responding to messages.

Message-identifier values are used as follows:

  • The system reserves message-identifier values in the range 0x0000 through 0x03FF (the value of WM_USER – 1) for system-defined messages. Applications cannot use these values for private messages.

  • Values in the range 0x0400 (the value of WM_USER) through 0x7FFF are available for message identifiers for private window classes.

  • If your application is marked version 4.0, you can use message-identifier values in the range 0x8000 (WM_APP) through 0xBFFF for private messages.

  • The system returns a message identifier in the range 0xC000 through 0xFFFF when an application calls the RegisterWindowMessage function to register a message. The message identifier returned by this function is guaranteed to be unique throughout the system. Use of this function prevents conflicts that can arise if other applications use the same message identifier for different purposes.

312 questions
0
votes
0 answers

Pyton Matplotlib How to remove mouse listeners on plot window?

I have a python program listening to windows messages in a loop. Getting some live data from this loop. Loop syntax https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessagew BOOL bRet; while( (bRet = GetMessage( &msg,…
Xentios
  • 84
  • 1
  • 10
0
votes
0 answers

MFC: Not getting WM_CHAR in CDialogEx dialog?

I have a dialog with no controls derived from CDialogEx. I receive OnKeyDown() messages but never receive a OnChar() ? I even tried overriding PreTranslateMessage() and just returning 0 when receiving a WM_KEYDOWN message as a test, still no…
df234987
  • 513
  • 2
  • 13
0
votes
1 answer

How to gracefully close this simple Windows GUI program? Because it doesn't (sometimes)

I'm having an issue with my Windows application where upon closing it from the taskbar or via hotkey it will occasionally hang. I'm wondering how to gracefully exit the following program: LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM…
Nux
  • 31
  • 1
  • 5
0
votes
2 answers

SendMessage WM_COPY not working when sent to chrome window DELPHI

I've been trying to resolve this for weeks now. I'm trying to create an app in Delphi that runs in the background and catches any hot key and executes Ctrl + c. So what I did is I catch the hot key for example ALT + right arrow then simulate Ctrl +…
0
votes
0 answers

Using messages to notify TFrames they should refresh underlying datasets

I am using TFrames to split different parts of a form (visual elements and code) into different units. For example, if my form is an invoice, I have Frame#1 showing the client, invoice date and total amount and Frame#2 containing a list of products…
JC Boggio
  • 367
  • 1
  • 11
0
votes
1 answer

Get Windows commands to start and stop a service in LabVIEW?

I would like to know (I). what commands the Windows sends to services to stop or start them and (II). how can I get those messages/command in LabVIEW? Thanks in advance!
Henrik
  • 159
  • 1
  • 15
0
votes
1 answer

How to determine which window was moved/resized from WM_EXITSIZEMOVE message?

I've been processing all the numerous individual WM_MOVE, WM_SIZING, and WM_SIZE messages for a multiple-GUI/window application, but I've just learned of the WM_EXITSIZEMOVE message and would like to use it if it lets me avoid all those intermediate…
Amby131
  • 81
  • 1
  • 6
0
votes
1 answer

Why isn't WM_NCACTIVATE message sent to a Window with its SizeToContent set to Height

I've written a WndProc to know if current Window is flashing. It is as follows: private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { var retVal = IntPtr.Zero; switch (msg) { …
Javid
  • 2,755
  • 2
  • 33
  • 60
0
votes
0 answers

Confused by windows keyboard event lParam

Part of the code: LRESULT CALLBACK WindowProc( _In_ HWND hwnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam) { ... switch(uMsg) { ... case WM_SYSKEYDOWN: case WM_SYSKEYUP: case…
oNion
  • 125
  • 3
  • 9
0
votes
2 answers

Windows system message constants in C++

I was looking at some various sample code for processing mouse click events in C++ using a Windows system message hook, and thought that this would be a great way to process key presses that are usually only sent to the system, such as CTRL, ALT,…
Nate Koppenhaver
  • 1,676
  • 3
  • 21
  • 31
0
votes
1 answer

Cannot get program to process WM_POWERBROADCAST message

I have a program that I want to automatically terminate on a WM_POWERBROADCAST message. For some reason, however, it is not terminating when I cause the computer to sleep. The program should have more than enough time to respond to this call, but I…
0
votes
1 answer

Why can't I detect Windows messages that are being sent to my CommonDialog? What is the right way of intercepting them?

I am trying to detect when the user clicks on a Form and a CommonDialog. Forms are fairly straightforward. I create a MessageFilter class that intercepts messages: class MessageFilter : IMessageFilter { private const int WM_LBUTTONDOWN =…
pushkin
  • 9,575
  • 15
  • 51
  • 95
0
votes
2 answers

Capturing WndProc messages in Windows Vista and above using .NET

I have a .net 2.0 windows forms application. I have overridden the WndProc method to capture the user activities on the form Ex: const int HTCLOSE = 0x0014; bool m_bCloseButtonActive = false; if (m.Msg == WM_NCHITTEST) { …
this-Me
  • 2,139
  • 6
  • 43
  • 70
0
votes
1 answer

WM_SETTEXT writes Chinese letters

I want to set the text of my Edit Control. When I do, the new content is Chinese. For example, this: [DllImport("user32.dll")] public static extern int SendMessageW([InAttribute] System.IntPtr hWnd, int Msg, int wParam, string…
0
votes
0 answers

When should we override WindowProc and when should we override DefWindowProc?

My doubt is that, in what all situations we should override WindowProc? in what all situations we should override DefWindowProc? Environment: VC++, MFC
TuneFanta
  • 157
  • 2
  • 10