I'm trying to send the Ctrl + C command (Copy text) to a custom handle, so it doesn't get the focus.
I looked the messages in Spy++ up:
<000001> 00540824 S WM_GETDLGCODE wParam:00000011 lParam:0018D218
<000002> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS [lResult:00000001]
<000003> 00540824 S WM_GETDLGCODE wParam:00000043 lParam:0018D218
<000004> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS [lResult:00000001]
<000005> 00540824 S WM_GETDLGCODE wParam:00000003 lParam:0018D218
<000006> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTALLKEYS [lResult:00000004]
So I tried to reproduce this C# (WM_GETDLGCODE = 0x0087):
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);
...
SendMessage(new IntPtr(0x00540824), 0x0087, 0x00000011, 0x0018D218);
SendMessage(new IntPtr(0x00540824), 0x0087, 0x00000043, 0x0018D218);
SendMessage(new IntPtr(0x00540824), 0x0087, 0x00000003, 0x0018D218);
But, as a result, Spy++ is telling me:
<000001> 00540824 S WM_GETDLGCODE wParam:00000011 lParam:0018D3C4
<000002> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS [lResult:00000001]
<000003> 00540824 S WM_GETDLGCODE wParam:00000043 lParam:0018D3C4
<000004> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTARROWS [lResult:00000001]
<000005> 00540824 S WM_GETDLGCODE wParam:00000003 lParam:0018D3C4
<000006> 00540824 R WM_GETDLGCODE fuDlgCode:DLGC_WANTALLKEYS [lResult:00000004]
I don't understand the change in the lParam. The Ctrl + C command does not execute. A PostMessage with a mouse click succeeds. Am I missing something?
User contributions licensed under CC BY-SA 3.0