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
1
vote
1 answer

Capture Window Messages (WM) in WinForms Designer using WndProc

I am writing a custom control in .NET Windows Forms. Consider the following code: protected override void WndProc(ref Message m) { base.WndProc(ref m); switch(m.Msg) { case WM_LBUTTONDOWN: // Yes, it's defined correctly. …
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
1
vote
1 answer

Handling multiple WM_USER messages (or achieving the same result)

I have a WidgetController class that controls multiple widgets (motors as it turns out, but it could be practically anything). It has a companion UI class WidgetControllerUI to do UI things representing the multiple widgets. I would like to send…
omatai
  • 3,448
  • 5
  • 47
  • 74
1
vote
2 answers

Window Not Receiving WM_KEYDOWN/WM_KEYUP Events

I am hooking onto another processes main window via SetWindowHookExA (injected from a DLL) and attaching to the WH_KEYBOARD event. However, my callback is never called but the hooking succeeds and I do get the original value in return. Upon…
atom0s
  • 485
  • 6
  • 22
1
vote
2 answers

Send a click event to a button (a child element) of a parent element by UI Automation in a program made by Qt

My Application Framework: C#.Net . Target Application Framework: Qt . My automation tools: TestStack/White Useful classes of System.Windows.Automation namespace I have a Qt application and i got one of its panels (dialer panel) by following codes…
Ramin Bateni
  • 16,499
  • 9
  • 69
  • 98
1
vote
3 answers

How do I pass a struct (or class) message back and forth between a C# service and a separate VB 6 application?

I need to pass data between a c# service and a running vb 6 application, considering using Windows Messaging. How do I pass the data back and forth between a C# service and a running vb 6 application? Shortened sample of the data I am passing back…
1
vote
0 answers

Application blocks excel DDE communication

I'm facing a strange issue here. I have a WPF application that does nothing with DDE messages. But any time I open an Excel spreadsheet that has DDE calculations referencing another application, Excel freezes completely and it only gets back again…
Rodrigo Vedovato
  • 1,008
  • 6
  • 11
1
vote
1 answer

Different RegisterWindowMessage() names appear the same

Using the C/C++ Windows API RegisterWindowMessage() I am using the name of the application as the message name. Next I call CreatMutex() using the same name so that I can tell if it already exists. If it does, I know this application is already…
Mike Trader
  • 8,564
  • 13
  • 55
  • 66
1
vote
2 answers

Stealing the contents of another application's tree view

I have an application with a very large TreeView control in Java. I want to get the contents of the tree control in a list (just strings not a JList) of XPath-like elements of leaves only. Here's an example root |-Item1 |-Item1.1 …
User1
  • 39,458
  • 69
  • 187
  • 265
1
vote
1 answer

Capture Help Button Click with Custom VCL Style

I have a VCL form that is set for bsDialog with biHelp enabled ("?" icon in application bar). The application is also using a custom VCL Style (Aqua Light Slate). However I cannot get the WMNCLBUTTONDOWN Windows Message to appear when I click the…
ikathegreat
  • 2,311
  • 9
  • 49
  • 80
1
vote
1 answer

Hosted window in WPF doesn't get mouse messages

Taking it a bit further than hosting WinForms user controls in my WPF application, I am actually hosting Delphi forms, i.e. top level windows. I am doing so through the voodoo in blog post How To Host Top-Level HWNDs In WPF. Nearly everything works…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
2 answers

Win32 Edit Control Caret Placement Offset

I gave an English explanation of my problem below but it is a visual issue so if you don't want to read it all just look at the picture at the bottom). I'm working on building a reverse polish notation calculator for my class and I just completed…
1
vote
1 answer

Message-only window not receiving messages from tray icon

I'm trying to write a simple reusable class to encapsulte the functionality for a basic tray icon. This is my first "project" with C++, and I'm having some problems: the message-only window created for the tray icon does not receive any message. The…
1
vote
2 answers

TB_GETBUTTONINFO fails on Windows 7

I have some code like this: TBBUTTONINFO mtbbi; HWND hwnd; HANDLE hProc; DWORD dwProcessID; void* lpData; ..... GetWindowThreadProcessId(hwnd, &dwProcessID); hProc = OpenProcess(PROCESS_ALL_ACCESS, 0, dwProcessID); lpData = VirtualAllocEx(hProc ,…
Ryzhehvost
  • 395
  • 1
  • 9
1
vote
0 answers

Handling WM_KEYDOWN in edit control on modal property sheet

First of all: I'm using C++ and ATL+WTL. I am trying to handle the WM_KEYDOWN for an edit control that is on a page of a modal property sheet. I'd like to get the VK_NEXT key while VK_CONTROL is down. Without success so far, I only get VK_NEXT if…
Serg
  • 131
  • 1
  • 7
1
vote
0 answers

How to prevent a specific window message from being executed?

For my customer I need to code an application that hosts several other applications of different types. One of these applications crash when it's hosted but retrieves the WM_CLOSE message from Windows (e.g. on pressing Close all apps in the Windows…
The Chris
  • 591
  • 6
  • 19