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
5
votes
1 answer

Mouse-Wheel sending message to the wrong control

I am using Windows XE2, the TVirtualStringTree, and a TComboBox as an in-placed editor. When I place a TComboBox directly on the form, at run-time I can drop down the list and the mouse wheel scrolls the items in the list up and down (as desired). …
James L.
  • 9,384
  • 5
  • 38
  • 77
5
votes
1 answer

Using PostMessage/SendMessage to send keys to c# IE WebBrowser

I am trying to auto fill in values in the C# webbrowser control and tab and enter and press up and down to move through the fields. Here is my PInvoke and wrapper functions. I used Spy++ to get these in Internet Explorer. Does anyone see anything…
kyleb
  • 1,968
  • 7
  • 31
  • 53
5
votes
1 answer

Mouse Enter/Leave messages not working?

I'm trying to detect mouse enter/leave messages CM_MOUSEENTER and CM_MOUSELEAVE but it isn't catching it. What am I doing wrong here? type TMyControl = class(TCustomControl) private procedure CMMouseEnter(var Message: TMessage); message…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
5
votes
1 answer

What message I receive when I kill my program with task manager

So I have a C++ dll, that I am using in my c# application, for monitoring Windows Messages. I want to know if WM_CLOSE and WM_QUERYENDSESSION are send because I can't see that from a C# application. If I get one of these messages, I want to do some…
Thanatos
  • 1,176
  • 8
  • 18
5
votes
3 answers

PostMessage to hidden form doesn't work the first time

I have a C# WinForms application that appears in the system tray. The application is hiding the main form on load: private void MainForm_Load(object sender, System.EventArgs e) { Hide(); } For the same main form, I've overriden the WndProc to…
huysentruitw
  • 27,376
  • 9
  • 90
  • 133
4
votes
5 answers

Delphi custom message handlers

When a user double-clicks a dbgrid, I show a non-modal form. When they close that form, I want to refresh the grid. To accomplish that, I have tried the following: 1 - Define a custom message constant: const WM_REFRESH_MSG = WM_USER + 1; …
JosephStyons
  • 57,317
  • 63
  • 160
  • 234
4
votes
2 answers

Can I use my own message loop in windows?

I am building a C++ program, on windows, using Visual Studio. It relies on a COM base API, that sends windows message for notification. To process those messages, I see two possibilities: Create a windows form and call doModal on it which should…
0x26res
  • 11,925
  • 11
  • 54
  • 108
4
votes
1 answer

How to receive WM_POWERBROADCAST inside of a thread?

I've been beating my head for over a day now, going through tons of resources trying to figure out how to receive the WM_POWERBROADCAST Windows message from within a thread. Currently, I am using AllocateHWnd(WndMethod) inside of a stand-alone…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
4
votes
1 answer

how send data record using SendMessage(..) in separate process

i use to send a data on two separate process but it fails. it works only under same process... this is…
XBasic3000
  • 3,418
  • 5
  • 46
  • 91
4
votes
2 answers

How to handle lifecycle of dynamically allocated data in Windows messages?

Simple task: Send a windows message with dynamically allocated data, e.g. an arbitrary length string. How would you manage the responsibility to free this data? The receiver(s) of the windows message could be responsible to free this data. But: How…
nang
  • 421
  • 6
  • 16
4
votes
3 answers

SendMessage between WinForms Applications - form needs focus

I'm using the Windows Messages API to communicate between two Windows Forms Apps. I took out a form that was a part of the application and made it into it's own app so that when it is loading the user can still work on the other forms now in a…
Keevan
  • 95
  • 1
  • 8
4
votes
2 answers

Is there a windows message that I can hook for when an application starts?

I want to know whenever any application starts. Is there a windows message that I can set a hook for to know exactly when that happens?
Mike Pateras
  • 14,715
  • 30
  • 97
  • 137
4
votes
1 answer

How do I detect the addition of a new monitor?

I have a windowless program that handles some window management hotkeys. I'd like to provide features such as the ability to move a window between monitors. I've used EnumDisplayMonitors to enumerate all existing monitors in the system, and I've…
Wug
  • 12,956
  • 4
  • 34
  • 54
4
votes
2 answers

Receive Windows Messages in a Service

I have written a service in VC++. I followed the tutorial here. Now, I am trying to find out how to receive messages like DBT_DEVICEARRIVAL, DBT_DEVICEREMOVECOMPLETE, WM_COPYDATA etc., just like a regular application that has a top level window.…
user1699872
4
votes
3 answers

How can I listen to mouse events of other processes

Is it possible in C# to listen to mouse related windows messages sent to other windows in other processes?
Idov
  • 5,006
  • 17
  • 69
  • 106
1 2
3
20 21