window-messages

Properly using AddClipboardFormatListener and subscribing to WM_CLIPBOARDUPDATE message

我与影子孤独终老i 提交于 2021-01-28 05:25:41
问题 I am currently attempting to use the Windows clipboard and its notifications in my application. Specifically, I am attempting to subscribe to the WM_CLIPBOARDUPDATE window message by using the AddClipboardFormatListener() function. Previously, I had been using the SetClipboardViewer() function in order to add my window directly into the clipboard viewer chain. This had worked just fine, and I had received the relevant messages WM_DRAWCLIPBOARD and WM_DESTROYCLIPBOARD when expected. However, I

WM_REFLECT_NOTIFY vs WM_NOTIFY

旧街凉风 提交于 2020-01-05 06:26:27
问题 The documentation for WM_NOTIFY is easy enough to find, however I'm finding a fair amount of sample code and articles that refer to WM_REFLECT_NOTIFY , for which I can't find any documentation. What is WM_REFLECT_NOTIFY , where can I find the documentation for it and how is this message different from WM_NOTIFY ? Example references: Flickering in listview with ownerdraw and virtualmode ListViewSubItem.Bounds almost works 回答1: WM_REFLECT_NOTIFY is referred to as having value of 0x204E , that

What is the relationship of CloseWindow and WM_CLOSE

不羁的心 提交于 2020-01-03 07:24:07
问题 I'm a bit confused currently: Are WM_CLOSE and ::CloseWindow in any way "related" or are for completely different things? The docs for Closing Windows don't mention the API function CloseWindow at all. Should CloseWindow be really called "MinimizeWindow" or what am I missing? 回答1: CloseWindow and WM_CLOSE are completely unrelated. The CloseWindow function is badly named. Its inverse function, OpenWindow is similarly badly named given that it restores windows. I suspect these names dates back

Receive Keyboard Events with Window Messages in a WPF-Window (HwndSource.AddHook)

♀尐吖头ヾ 提交于 2020-01-03 06:48:24
问题 I have a Window with a TextBox. The cursor is inside the TextBox. If I press a key, then I receive a message in WndProc (for KeyUp and KeyDown). But if I set e.Handled = true in the KeyUp and KeyDown events, then I don't receive any key messages: public partial class MainWindow : Window { public MainWindow() { Loaded += MainWindow_Loaded; } private void MainWindow_Loaded(object sender, RoutedEventArgs e) { var textBox = new TextBox(); textBox.KeyDown += TextBox_KeyDown; textBox.KeyUp +=

Handling AeroSnap message in WndProc

£可爱£侵袭症+ 提交于 2019-12-28 06:24:08
问题 In my C# .NET 4 application, I use WndProc to process some messages mostly dealing with resizing the application to and from full screen. Right now I am just handling SC_MAXIMIZE and WM_NCLBUTTONDBLCLK to determine if the window is being resized to or from a maximized state (I know I don't need WndProc to handle SC_MAXIMIZE , but Form_Resize didn't seem to fire for a WM_NCLBUTTONDBLCLK message when I double-click on the application's title bar. Now I noticed that if I Aero Snap the window to

WM_MSO_BROADCASTCHANGE value

扶醉桌前 提交于 2019-12-12 01:34:28
问题 What's the value for WM_MSO_BROADCASTCHANGE, and how would I figure it out for myself next time? 回答1: A late answer, I know, but as it happens I was recently looking for the answer to this question myself, so this may help other errant Googlers... Turns out that "WM_MSO_BROADCASTCHANGE" has no set value. You obtain a value for it dynamically by calling RegisterMessage . See http://msdn.microsoft.com/en-us/library/ms644947(v=vs.85).aspx Note that in this particular case MS Office appears to

C++ Builder XE, Passing and handling user-defined messages

早过忘川 提交于 2019-12-09 01:54:34
问题 I am trying to learn how to pass and handle messages in a VCL forms app. I've been digging the internet for some time and found this Suppose I have a progress bar I want to update using messages (btw if there's any other better way, I am eager to hear it) So I made a simple project to test the stuff and here's what I have (RECEIVER is a name of a form with progress bar, SENDER is a button used to send messages, updBar is a function to update progress bar, and 123456 is a message ID I want to

How does Spy++ construct its process list?

試著忘記壹切 提交于 2019-12-06 07:14:04
问题 TL;DR - How does the Spy++ tool really construct its process list? Stage We have an MFC desktop application (running on Windows XP) that is hanging in that it doesn't react to any user input anymore. It is redrawn when switching to it via alt-tab however. (It does receive WM_SETFOCUS , WM_ACTIVATE , etc. It apparently does not receive any mouse or keyboard messages.) Since the app is hanging in some limbo, we pulled a few process dumps, but these were of little help so far. Enter: Spy++ We

How does Spy++ construct its process list?

会有一股神秘感。 提交于 2019-12-04 11:37:58
TL;DR - How does the Spy++ tool really construct its process list? Stage We have an MFC desktop application (running on Windows XP) that is hanging in that it doesn't react to any user input anymore. It is redrawn when switching to it via alt-tab however. (It does receive WM_SETFOCUS , WM_ACTIVATE , etc. It apparently does not receive any mouse or keyboard messages.) Since the app is hanging in some limbo, we pulled a few process dumps, but these were of little help so far. Enter: Spy++ We used Spy++ to find the information I gave above about the window messages this application seems to be

Win32: How to post message to a process run by a different user in Windows?

我与影子孤独终老i 提交于 2019-12-02 12:22:46
问题 We run two application, each of them register the same message using RegisterWindowMessage(): application A as a regular user and application B as administrator in the same user's session on the machine, and those applications would send this message one to another. When A and B were run as a same user everything was fine and we were able to communicate using PostMessage() messaging. Now as application B is run as administrator messages do not come through any more. What can we do about it?