Bugzilla – Attachment 544 Details for
Bug 5096
Copy/paste issue between client and server applications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
clipboard monitor
clipmon.c (text/x-csrc), 2.33 KB, created by
Henrik Andersson
on 2014-05-22 09:29:51 CEST
(
hide
)
Description:
clipboard monitor
Filename:
MIME Type:
Creator:
Henrik Andersson
Created:
2014-05-22 09:29:51 CEST
Size:
2.33 KB
patch
obsolete
>#include <stdio.h> >#include <windows.h> >#include <winuser.h> > >static HWND g_next_clipboard_wnd; > >LRESULT CALLBACK WndProc(HWND wnd, UINT msg, > WPARAM wparam, LPARAM lparam) >{ > switch(msg) > { > case WM_CREATE: > { > fprintf(stderr, "ClipMon: window %p created.\n", wnd); > > g_next_clipboard_wnd = SetClipboardViewer(wnd); > > fprintf(stderr, "ClipMon: Monitoring clipboard, %p is next window in chain.\n", > g_next_clipboard_wnd); > return 0; > } break; > > case WM_DESTROY: > { > fprintf(stderr, "ClipMon: window %p destroyed.\n", wnd); > ChangeClipboardChain(wnd, g_next_clipboard_wnd); > PostQuitMessage(0); > return 0; > } break; > > case WM_DRAWCLIPBOARD: > { > if (g_next_clipboard_wnd) > { > fprintf(stderr, "ClipMon: Dispatching WM_DRAWCLIPBOARD down the chain through %p\n", > g_next_clipboard_wnd); > SendMessage(g_next_clipboard_wnd, msg, wparam, lparam); > } > } break; > > case WM_CHANGECBCHAIN: > { > if ((HWND) wparam == g_next_clipboard_wnd) > { > fprintf(stderr, "ClipMon: Updating our next window %p in chain, replaced with %p.\n", > g_next_clipboard_wnd, (HWND)lparam); > g_next_clipboard_wnd = (HWND)lparam; > } > else if (g_next_clipboard_wnd != NULL) > { > fprintf(stderr, "ClipMon: Window %p is removed and next is %p, dispatch down the chain\n", > (HWND)wparam, (HWND)lparam); > SendMessage(g_next_clipboard_wnd, msg, wparam, lparam); > } > } break; > > default: > return DefWindowProc(wnd, msg, wparam, lparam); > } > return (LRESULT) NULL; >} > >#define APP_NAME "ClipMon" > >int APIENTRY >WinMain(HINSTANCE instance, HINSTANCE pinstance, > LPSTR cmdline, int show) >{ > HWND wnd; > MSG msg; > WNDCLASS cls; > > /* setup and register window class */ > memset(&cls, 0, sizeof(cls)); > cls.style = CS_HREDRAW | CS_VREDRAW; > cls.lpfnWndProc = WndProc; > cls.hInstance = instance; > cls.lpszClassName = APP_NAME; > > if (!RegisterClass(&cls)) > { > MessageBox(NULL, "Failed to register window class", APP_NAME, MB_ICONERROR); > return; > } > > wnd = CreateWindow(APP_NAME, APP_NAME, > WS_OVERLAPPEDWINDOW, > CW_USEDEFAULT, CW_USEDEFAULT, > 100, 100, > NULL, NULL, instance, NULL); > > ShowWindow(wnd, show); > UpdateWindow(wnd); > while (GetMessage(&msg, NULL, 0, 0)) > { > TranslateMessage(&msg); > DispatchMessage(&msg); > } > return msg.wParam; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5096
: 544 |
545