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
7
votes
3 answers

how to send a message from one windows console application to another?

I have a windows console application which starts child process. How can I send a message to child process? I found functions like PostMessage()/PeekMessage() - that's what I need, but as I understand, it is used inside one application, and uses…
diana-pure
  • 161
  • 3
  • 16
7
votes
1 answer

How to stop the automatic scrolling of a Memo control?

In Windows 7, a memo control (TMemo) will scroll automatically after text is insterted (Memo.Lines.Add(Path);), which I do not want, because scrolling is done by myself. How can I stop the automatic scrolling?
HamiD
  • 197
  • 1
  • 2
  • 11
6
votes
2 answers

There is any quick way to, while debuging, to stop at a specific Windows Message or API?

So I want to put a Breakpoint in a specific API or Windows message. I don't find any easy way to do that without writing code in any Delphi version. Is there a way to do that similar as I can put a breakpoint in memory access?
EMBarbosa
  • 1,473
  • 1
  • 22
  • 76
6
votes
3 answers

How does the message queue work in Win32?

I read some stuff on Win32 and how the message loop works, and there's something that is still unclear to me: What exactly is stored in the message queue? The integer value that corresponds to a message (WM_COMMAND, WM_CREATE, etc) or a pointer to a…
user1091856
  • 3,032
  • 6
  • 31
  • 42
6
votes
3 answers

How can a thread notify an object that doesn't have a window handle?

I'm new to multithreading, but not a complete novice. I need to perform a call to a webservice in a worker thread. In the main thread I have a form (TForm) with a private data member (private string) that only the worker thread will write to (I pass…
Sam
  • 2,663
  • 10
  • 41
  • 60
6
votes
7 answers

Preventing Windows shut down

To detect and prevent shutdown the computer I use very simple program. It has only one form and one private procedure like below: TForm3 = class(TForm) private procedure WMQueryEndSession(var Msg : TWMQueryEndSession) ; message…
SimaWB
  • 9,246
  • 2
  • 41
  • 46
5
votes
0 answers

PreTranslateMessage in C# for hosted MFC window

We developped an MFC application where the main window was implemented in a DLL. In an attempt to revamp it, we are thinking of changing this to a WPF-application where the "old" native window gets rehosted in a Wpf-Window. So far so…
Seb
  • 143
  • 2
  • 10
5
votes
1 answer

Get Name of Message registered by RegisterWindowMessage

I am debugging an old application, where the WndProc is overridden. There I got a message with ID=0xC1B0 which means, that this is a system wide unique message according to this msdn article. As described by microsoft for the…
scher
  • 1,813
  • 2
  • 18
  • 39
5
votes
3 answers

How can a child window respond to a change in its parent

In a Win32 app is there a Windows message or some other notification that will get sent to a child window when it is placed into a different parent
solsberg
  • 7,875
  • 4
  • 22
  • 12
5
votes
1 answer

Is there a such thing as a double right-click in Win32?

I haven't found anything mentioning a double right-click windows message but am curious if anybody knows of events that fire for a double right-click. Any ideas?
Jared
  • 5,977
  • 10
  • 38
  • 48
5
votes
1 answer

What format is the time member of a MSG structure?

The windows messaging system assigns the post time as a DWORD to every message. typedef struct tagMSG { HWND hwnd; UINT message; WPARAM wParam; LPARAM lParam; DWORD time; // <--- POINT pt; } MSG, *PMSG, *LPMSG; But I can find no…
Kenneth Cochran
  • 11,954
  • 3
  • 52
  • 117
5
votes
1 answer

Should I free a Delphi object auto-instantiated from a web services call?

Newbie question: I have a forms application. It has a separate thread which makes a web services call, and then posts the results of the call to the main form. In my thread, after X seconds have passed (using a TTimer), I call: procedure…
Duncan
  • 858
  • 1
  • 11
  • 29
5
votes
4 answers

why not to send WM_PAINT manually

I have read that I should never send WM_PAINT manually and should call InvalidateRect instead but didn't found anything about why not, however. So why not? update works with InvalidateRect but not with SendMessage(WM_PAINT) LRESULT CALLBACK…
Ivars
  • 2,375
  • 7
  • 22
  • 31
5
votes
3 answers

SetCursor doesn't work until mouse moves/clicks (Win32 Api)

While processing the WM_SETCURSOR windows message I call SetCursor to a certain cursor. If I set the cursor to something different then what it is, it waits until the mouse gets input via moving or clicking to actually set it. Is there a way to…
Ryan Madsen
  • 51
  • 2
  • 4
5
votes
1 answer

Why doesn't EM_SETTEXTMODE work?

I'm trying to use EM_SETTEXTMODE on a RichEdit control in Delphi 7. Just create a new project, add a TRichEdit control and a TButton control and add the following code to the button's click handler: SendMessage(RichEdit1.Handle, WM_SETTEXT, 0,…
jedivader
  • 828
  • 10
  • 23
1
2
3
20 21