windows-messages

Accessing and inheriting Windows Message for other Windows Message in Delphi

回眸只為那壹抹淺笑 提交于 2019-12-10 11:55:38
问题 I am using WMSysCommand messages to modify Caption bar button ( Maximize / Minimize ) behaivor and recent update requiered to use WMNCHitTest, but I do not want to split these two related messages in multiplie procedures because of lengthy code. Can I access private declaration ( message ) from other message? And if I can - How to do it? procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest) ; begin SendMessage(Handle, HTCAPTION, WM_NCHitTest, 0); // or other wParam or lParam ???? end; procedure

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

你说的曾经没有我的故事 提交于 2019-12-10 10:18:00
问题 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 wrong with my definitions? I want to use Send and Post message instead of SendInput because I don't want to have to focus the window... [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool PostMessage(IntPtr hWnd, uint

WM_POWERBROADCAST message not caught in MFC Dlg

若如初见. 提交于 2019-12-10 00:19:48
问题 I try to catch WM_POWERBROADCAST message when the system goes into sleep mode. I'm doing like : BOOL CPowManApp::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_POWERBROADCAST || pMsg->message == WM_POWER) { CString strMessage; strMessage.Format(_T("%d WM_POWERB%s wParam %x lParam %x"), pMsg->time, pMsg->message == WM_POWER?_T(""):_T("BRAODCAST"), pMsg->wParam, pMsg->lParam); OutputDebugString(strMessage); } return CWinApp::PreTranslateMessage(pMsg); } It simply doesn't work.

Why does GetMessage not process WM_POWERBROADCAST messages?

偶尔善良 提交于 2019-12-07 22:53:30
问题 I'm creating a hidden window for the purpose of handling messages. I'm experiencing that I do not receive WM_POWERBROADCAST messages in it's GetMessage loop. I do, however, receive it via my WNDPROC. I have confirmed that I do receive other messages in both locations. Why is GetMessage not receiving WM_POWERBROADCAST? WNDCLASSEX classInfo = {0}; classInfo.cbSize = sizeof(classInfo); classInfo.style = WS_DISABLED; // CustomWndProc just outputs the message and chains to DefaultWndProc classInfo

Why does GetMessage not process WM_POWERBROADCAST messages?

假如想象 提交于 2019-12-06 11:45:49
I'm creating a hidden window for the purpose of handling messages. I'm experiencing that I do not receive WM_POWERBROADCAST messages in it's GetMessage loop. I do, however, receive it via my WNDPROC. I have confirmed that I do receive other messages in both locations. Why is GetMessage not receiving WM_POWERBROADCAST? WNDCLASSEX classInfo = {0}; classInfo.cbSize = sizeof(classInfo); classInfo.style = WS_DISABLED; // CustomWndProc just outputs the message and chains to DefaultWndProc classInfo.lpfnWndProc = CustomWndProc; classInfo.hInstance = GetModuleHandle(NULL); classInfo.hCursor = NULL;

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

谁都会走 提交于 2019-12-06 04:36:23
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 wrong with my definitions? I want to use Send and Post message instead of SendInput because I don't want to have to focus the window... [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool PostMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] static extern int SendMessage(IntPtr

What's a good way to debug Windows message content and destination?

∥☆過路亽.° 提交于 2019-12-06 04:17:20
I'm working on an application that simulates a Windows mouse based on other behavior. One example is that pressing the + or - keys on the keyboard sends the WM_MOUSEWHEEL message to a target window with an appropriate delta. The problem is that in some situations I'm having a hard time replicating the messages that i think windows is sending to the target application. Are there any ways to record windows messages sent to a specific window (hopefully with a filter for which messages I want to catch) and then review that data later? RichieHindle If you have Visual Studio, that comes with Spy++,

Delphi custom message handlers

丶灬走出姿态 提交于 2019-12-05 21:28:16
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; //defined in a globally available unit 2 - In the OnClose event of my non-modal form, I have this: procedure TMyNonModalForm.FormClose(Sender: TObject; var Action: TCloseAction); begin PostMessage(Self.Handle,WM_REFRESH_MSG,0,0); end; 3 - In the private declarations of the form that holds the dbGrid, I have this: procedure OnRefreshRequest(var Msg: TMessage);

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

我只是一个虾纸丫 提交于 2019-12-04 23:43:25
问题 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 HWND to identify the target window (I have no windows in application). Also I've read materials about ipc, for example named pipes demand HWND too. I want something like that: [program 1] int main() { CreateProcess(.., processInfo); SendMessage

How can I stop my application from receiving a certain “message”?

亡梦爱人 提交于 2019-12-04 15:17:16
问题 POSSIBLE SOLUTION FOUND! I believe I have found a solution! I will be continuing testing to make sure it DOES in fact work, but I'm hopeful :) I have detailed how I found the solution in EDIT THREE of the question! For anyone wishing to know the full background behind my problem and what I have kind of tried as a result of input from this question, see this: http://pastebin.com/nTrEAkVj I will be editing this frequently (>3 times a day most weekdays) as I progress my research and situation,