ReactOS 0.4.15-dev-8096-ga0eec98
clipbrd.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Clipboard Viewer
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Provides a view of the contents of the ReactOS clipboard.
5 * COPYRIGHT: Copyright 2015-2018 Ricardo Hanke
6 * Copyright 2015-2018 Hermes Belusca-Maito
7 */
8
9#include "precomp.h"
10
11static const WCHAR szClassName[] = L"ClipBookWClass";
12
15
16static void SaveClipboardToFile(void)
17{
19 LPWSTR c;
20 WCHAR szFileName[MAX_PATH];
21 WCHAR szFilterMask[MAX_STRING_LEN + 10];
22
23 ZeroMemory(&szFilterMask, sizeof(szFilterMask));
24 c = szFilterMask + LoadStringW(Globals.hInstance, STRING_FORMAT_NT, szFilterMask, MAX_STRING_LEN) + 1;
25 wcscpy(c, L"*.clp");
26
27 ZeroMemory(&szFileName, sizeof(szFileName));
28 ZeroMemory(&sfn, sizeof(sfn));
29 sfn.lStructSize = sizeof(sfn);
32 sfn.lpstrFilter = szFilterMask;
33 sfn.lpstrFile = szFileName;
34 sfn.nMaxFile = ARRAYSIZE(szFileName);
36 sfn.lpstrDefExt = L"clp";
37
38 if (!GetSaveFileNameW(&sfn))
39 return;
40
42 {
44 return;
45 }
46
47 WriteClipboardFile(szFileName, CLIP_FMT_NT /* CLIP_FMT_31 */);
48
50}
51
52static void LoadClipboardDataFromFile(LPWSTR lpszFileName)
53{
57 {
58 return;
59 }
60
62 {
64 return;
65 }
66
68 ReadClipboardFile(lpszFileName);
69
71}
72
73static void LoadClipboardFromFile(void)
74{
76 LPWSTR c;
77 WCHAR szFileName[MAX_PATH];
78 WCHAR szFilterMask[MAX_STRING_LEN + 10];
79
80 ZeroMemory(&szFilterMask, sizeof(szFilterMask));
81 c = szFilterMask + LoadStringW(Globals.hInstance, STRING_FORMAT_GEN, szFilterMask, MAX_STRING_LEN) + 1;
82 wcscpy(c, L"*.clp");
83
84 ZeroMemory(&szFileName, sizeof(szFileName));
85 ZeroMemory(&ofn, sizeof(ofn));
86 ofn.lStructSize = sizeof(ofn);
89 ofn.lpstrFilter = szFilterMask;
90 ofn.lpstrFile = szFileName;
91 ofn.nMaxFile = ARRAYSIZE(szFileName);
93
94 if (!GetOpenFileNameW(&ofn))
95 return;
96
97 LoadClipboardDataFromFile(szFileName);
98}
99
100static void LoadClipboardFromDrop(HDROP hDrop)
101{
102 WCHAR szFileName[MAX_PATH];
103
104 DragQueryFileW(hDrop, 0, szFileName, ARRAYSIZE(szFileName));
105 DragFinish(hDrop);
106
107 LoadClipboardDataFromFile(szFileName);
108}
109
110static void SetDisplayFormat(UINT uFormat)
111{
112 RECT rc;
113
117
118 if (uFormat == 0)
119 {
121 }
122 else
123 {
124 Globals.uDisplayFormat = uFormat;
125 }
126
131
133}
134
135static void InitMenuPopup(HMENU hMenu, LPARAM index)
136{
137 if ((GetMenuItemID(hMenu, 0) == CMD_DELETE) || (GetMenuItemID(hMenu, 1) == CMD_SAVE_AS))
138 {
139 if (CountClipboardFormats() == 0)
140 {
143 }
144 else
145 {
148 }
149 }
150
152}
153
154static void UpdateDisplayMenu(void)
155{
156 UINT uFormat;
157 HMENU hMenu;
158 WCHAR szFormatName[MAX_FMT_NAME_LEN + 1];
159
161
162 while (GetMenuItemCount(hMenu) > 1)
163 {
164 DeleteMenu(hMenu, 1, MF_BYPOSITION);
165 }
166
167 if (CountClipboardFormats() == 0)
168 return;
169
171 return;
172
173 AppendMenuW(hMenu, MF_SEPARATOR, 0, NULL);
174
175 /* Display the supported clipboard formats first */
176 for (uFormat = EnumClipboardFormats(0); uFormat;
177 uFormat = EnumClipboardFormats(uFormat))
178 {
179 if (IsClipboardFormatSupported(uFormat))
180 {
182 szFormatName, ARRAYSIZE(szFormatName));
183 AppendMenuW(hMenu, MF_STRING, CMD_AUTOMATIC + uFormat, szFormatName);
184 }
185 }
186
187 /* Now display the unsupported clipboard formats */
188 for (uFormat = EnumClipboardFormats(0); uFormat;
189 uFormat = EnumClipboardFormats(uFormat))
190 {
191 if (!IsClipboardFormatSupported(uFormat))
192 {
194 szFormatName, ARRAYSIZE(szFormatName));
195 AppendMenuW(hMenu, MF_STRING | MF_GRAYED, 0, szFormatName);
196 }
197 }
198
200}
201
203{
204 switch (LOWORD(wParam))
205 {
206 case CMD_OPEN:
207 {
209 break;
210 }
211
212 case CMD_SAVE_AS:
213 {
215 break;
216 }
217
218 case CMD_EXIT:
219 {
221 break;
222 }
223
224 case CMD_DELETE:
225 {
229 {
230 break;
231 }
232
234 break;
235 }
236
237 case CMD_AUTOMATIC:
238 {
240 break;
241 }
242
243 case CMD_HELP:
244 {
245 HtmlHelpW(Globals.hMainWnd, L"clipbrd.chm", 0, 0);
246 break;
247 }
248
249 case CMD_ABOUT:
250 {
252
256 break;
257 }
258
259 default:
260 {
261 break;
262 }
263 }
264 return 0;
265}
266
268{
269 HDC hdc;
270 PAINTSTRUCT ps;
271 COLORREF crOldBkColor, crOldTextColor;
272 RECT rc;
273
275 return;
276
277 hdc = BeginPaint(hWnd, &ps);
278
279 /* Erase the background if needed */
280 if (ps.fErase)
281 FillRect(ps.hdc, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1));
282
283 /* Set the correct background and text colors */
284 crOldBkColor = SetBkColor(ps.hdc, GetSysColor(COLOR_WINDOW));
285 crOldTextColor = SetTextColor(ps.hdc, GetSysColor(COLOR_WINDOWTEXT));
286
287 /* Realize the clipboard palette if there is one */
289
290 switch (Globals.uDisplayFormat)
291 {
292 case CF_NONE:
293 {
294 /* The clipboard is empty */
295 break;
296 }
297
298 case CF_DSPTEXT:
299 case CF_TEXT:
300 case CF_OEMTEXT:
301 case CF_UNICODETEXT:
302 {
304 break;
305 }
306
307 case CF_DSPBITMAP:
308 case CF_BITMAP:
309 {
311 break;
312 }
313
314 case CF_DIB:
315 case CF_DIBV5:
316 {
318 break;
319 }
320
322 case CF_METAFILEPICT:
323 {
324 GetClientRect(hWnd, &rc);
326 break;
327 }
328
330 case CF_ENHMETAFILE:
331 {
332 GetClientRect(hWnd, &rc);
334 break;
335 }
336
337 // case CF_PALETTE:
338 // TODO: Draw a palette with squares filled with colors.
339 // break;
340
341 case CF_OWNERDISPLAY:
342 {
343 HGLOBAL hglb;
344 PPAINTSTRUCT pps;
345
346 hglb = GlobalAlloc(GMEM_MOVEABLE, sizeof(ps));
347 if (hglb)
348 {
349 pps = GlobalLock(hglb);
350 CopyMemory(pps, &ps, sizeof(ps));
351 GlobalUnlock(hglb);
352
354 (WPARAM)hWnd, (LPARAM)hglb);
355
356 GlobalFree(hglb);
357 }
358 break;
359 }
360
361 case CF_HDROP:
362 {
363 GetClientRect(hWnd, &rc);
365 break;
366 }
367
368 default:
369 {
370 GetClientRect(hWnd, &rc);
373 break;
374 }
375 }
376
377 /* Restore the original colors */
378 SetTextColor(ps.hdc, crOldTextColor);
379 SetBkColor(ps.hdc, crOldBkColor);
380
381 EndPaint(hWnd, &ps);
382
384}
385
387{
388 switch(uMsg)
389 {
390 case WM_CREATE:
391 {
393 HDC hDC = GetDC(hWnd);
394
395 /*
396 * Note that the method with GetObjectW just returns
397 * the original parameters with which the font was created.
398 */
399 if (GetTextMetricsW(hDC, &tm))
400 {
401 Globals.CharWidth = tm.tmMaxCharWidth; // tm.tmAveCharWidth;
402 Globals.CharHeight = tm.tmHeight + tm.tmExternalLeading;
403 }
405
406
409
410 // For now, the Help dialog item is disabled because of lacking of HTML support
412
414
417
419 break;
420 }
421
422 case WM_CLOSE:
423 {
425 break;
426 }
427
428 case WM_DESTROY:
429 {
431
433 {
434 HGLOBAL hglb;
435 PRECT prc;
436
437 hglb = GlobalAlloc(GMEM_MOVEABLE, sizeof(*prc));
438 if (hglb)
439 {
440 prc = GlobalLock(hglb);
442 GlobalUnlock(hglb);
443
445 (WPARAM)hWnd, (LPARAM)hglb);
446
447 GlobalFree(hglb);
448 }
449 }
450
452 break;
453 }
454
455 case WM_PAINT:
456 {
458 break;
459 }
460
461 case WM_KEYDOWN:
462 {
464 break;
465 }
466
467 case WM_MOUSEWHEEL:
468 case WM_MOUSEHWHEEL:
469 {
471 break;
472 }
473
474 case WM_HSCROLL:
475 {
476 // NOTE: Windows uses an offset of 16 pixels
478 break;
479 }
480
481 case WM_VSCROLL:
482 {
483 // NOTE: Windows uses an offset of 16 pixels
485 break;
486 }
487
488 case WM_SIZE:
489 {
490 RECT rc;
491
493 {
494 HGLOBAL hglb;
495 PRECT prc;
496
497 hglb = GlobalAlloc(GMEM_MOVEABLE, sizeof(*prc));
498 if (hglb)
499 {
500 prc = GlobalLock(hglb);
501 if (wParam == SIZE_MINIMIZED)
503 else
505 GlobalUnlock(hglb);
506
508 (WPARAM)hWnd, (LPARAM)hglb);
509
510 GlobalFree(hglb);
511 }
512 break;
513 }
514
517
518 // NOTE: There still are little problems drawing
519 // the background when displaying clipboard text.
525 {
527 }
528 else
529 {
531 }
532
533 break;
534 }
535
536 case WM_CHANGECBCHAIN:
537 {
538 /* Transmit through the clipboard viewer chain */
539 if ((HWND)wParam == Globals.hWndNext)
540 {
542 }
543 else if (Globals.hWndNext != NULL)
544 {
546 }
547
548 break;
549 }
550
552 break;
553
555 {
556 /*
557 * When the user has cleared the clipboard via the DELETE command,
558 * we (clipboard viewer) become the clipboard owner. When we are
559 * subsequently closed, this message is then sent to us so that
560 * we get a chance to render everything we can. Since we don't have
561 * anything to render, just empty the clipboard.
562 */
564 break;
565 }
566
567 case WM_RENDERFORMAT:
568 // TODO!
569 break;
570
571 case WM_DRAWCLIPBOARD:
572 {
575
576 /* Pass the message to the next window in clipboard viewer chain */
578 break;
579 }
580
581 case WM_COMMAND:
582 {
583 if ((LOWORD(wParam) > CMD_AUTOMATIC))
584 {
586 }
587 else
588 {
589 OnCommand(hWnd, uMsg, wParam, lParam);
590 }
591 break;
592 }
593
594 case WM_INITMENUPOPUP:
595 {
597 break;
598 }
599
600 case WM_DROPFILES:
601 {
603 break;
604 }
605
607 {
608 /* Ignore if this comes from ourselves */
609 if ((HWND)wParam == hWnd)
610 break;
611
612 /* Fall back to WM_QUERYNEWPALETTE */
613 }
614
616 {
618 HDC hDC;
619
621 return FALSE;
622
623 hDC = GetDC(hWnd);
624 if (!hDC)
625 {
627 return FALSE;
628 }
629
631
634
635 if (Success)
636 {
639 return TRUE;
640 }
641 return FALSE;
642 }
643
645 {
647 break;
648 }
649
650 case WM_SETTINGCHANGE:
651 {
653 {
655 }
656 break;
657 }
658
659 default:
660 {
661 return DefWindowProc(hWnd, uMsg, wParam, lParam);
662 }
663 }
664
665 return 0;
666}
667
668int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
669{
670 MSG msg;
671 HACCEL hAccel;
672 HWND hPrevWindow;
673 WNDCLASSEXW wndclass;
674 WCHAR szBuffer[MAX_STRING_LEN];
675
676 hPrevWindow = FindWindowW(szClassName, NULL);
677 if (hPrevWindow)
678 {
679 BringWindowToFront(hPrevWindow);
680 return 0;
681 }
682
683 switch (GetUserDefaultUILanguage())
684 {
687 break;
688
689 default:
690 break;
691 }
692
693 ZeroMemory(&Globals, sizeof(Globals));
695
696 ZeroMemory(&wndclass, sizeof(wndclass));
697 wndclass.cbSize = sizeof(wndclass);
698 wndclass.lpfnWndProc = MainWndProc;
699 wndclass.hInstance = hInstance;
701 wndclass.hCursor = LoadCursorW(0, IDC_ARROW);
702 wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
704 wndclass.lpszClassName = szClassName;
705
706 if (!RegisterClassExW(&wndclass))
707 {
709 return 0;
710 }
711
713
714 LoadStringW(hInstance, STRING_CLIPBOARD, szBuffer, ARRAYSIZE(szBuffer));
717 szBuffer,
723 NULL,
724 NULL,
726 NULL);
727 if (!Globals.hMainWnd)
728 {
730 return 0;
731 }
732
733 ShowWindow(Globals.hMainWnd, nCmdShow);
735
737 if (!hAccel)
738 {
740 }
741
742 /* If the user provided a path to a clipboard data file, try to open it */
743 if (__argc >= 2)
745
746 while (GetMessageW(&msg, 0, 0, 0))
747 {
749 {
752 }
753 }
754
755 return (int)msg.wParam;
756}
static HDC hDC
Definition: 3dtext.c:33
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
void WriteClipboardFile(LPCWSTR lpFileName, WORD wFileIdentifier)
Definition: fileutils.c:449
void ReadClipboardFile(LPCWSTR lpFileName)
Definition: fileutils.c:275
#define MAX_STRING_LEN
Definition: precomp.h:36
#define CF_NONE
Definition: precomp.h:39
#define DISPLAY_MENU_POS
Definition: precomp.h:37
#define STRING_DELETE_MSG
Definition: resources.h:26
#define CLIPBRD_ICON
Definition: resources.h:10
#define STRING_FORMAT_GEN
Definition: resources.h:29
#define CMD_HELP
Definition: resources.h:19
#define MAIN_MENU
Definition: resources.h:12
#define STRING_CLIPBOARD
Definition: resources.h:24
#define CMD_DELETE
Definition: resources.h:18
#define CMD_SAVE_AS
Definition: resources.h:16
#define CMD_ABOUT
Definition: resources.h:20
#define STRING_DELETE_TITLE
Definition: resources.h:27
#define CMD_OPEN
Definition: resources.h:15
#define ID_ACCEL
Definition: resources.h:13
#define ERROR_UNSUPPORTED_FORMAT
Definition: resources.h:46
#define CMD_AUTOMATIC
Definition: resources.h:22
#define STRING_FORMAT_NT
Definition: resources.h:28
#define CMD_EXIT
Definition: resources.h:17
#define CF_UNICODETEXT
Definition: constants.h:408
#define CF_METAFILEPICT
Definition: constants.h:398
#define CF_BITMAP
Definition: constants.h:397
#define CF_DSPENHMETAFILE
Definition: constants.h:417
#define CF_OWNERDISPLAY
Definition: constants.h:413
#define CF_DSPMETAFILEPICT
Definition: constants.h:416
#define CF_HDROP
Definition: constants.h:410
#define CF_DSPBITMAP
Definition: constants.h:415
#define CF_ENHMETAFILE
Definition: constants.h:409
#define CF_TEXT
Definition: constants.h:396
#define CF_DSPTEXT
Definition: constants.h:414
#define CF_DIB
Definition: constants.h:403
#define CF_OEMTEXT
Definition: constants.h:402
HINSTANCE hInstance
Definition: charmap.c:19
#define CLIP_FMT_NT
Definition: fileutils.h:13
#define MAX_FMT_NAME_LEN
Definition: fileutils.h:16
static void OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: clipbrd.c:267
static void SetDisplayFormat(UINT uFormat)
Definition: clipbrd.c:110
static int OnCommand(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: clipbrd.c:202
static void LoadClipboardFromDrop(HDROP hDrop)
Definition: clipbrd.c:100
static void LoadClipboardDataFromFile(LPWSTR lpszFileName)
Definition: clipbrd.c:52
static void InitMenuPopup(HMENU hMenu, LPARAM index)
Definition: clipbrd.c:135
static void UpdateDisplayMenu(void)
Definition: clipbrd.c:154
static void LoadClipboardFromFile(void)
Definition: clipbrd.c:73
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
Definition: clipbrd.c:668
static LRESULT WINAPI MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: clipbrd.c:386
SCROLLSTATE Scrollstate
Definition: clipbrd.c:14
static const WCHAR szClassName[]
Definition: clipbrd.c:11
static void SaveClipboardToFile(void)
Definition: clipbrd.c:16
CLIPBOARD_GLOBALS Globals
Definition: clipbrd.c:13
UINT GetAutomaticClipboardFormat(void)
Definition: cliputils.c:150
void RetrieveClipboardFormatName(HINSTANCE hInstance, UINT uFormat, BOOL Unicode, PVOID lpszFormat, UINT cch)
Definition: cliputils.c:95
void DeleteClipboardContent(void)
Definition: cliputils.c:134
BOOL IsClipboardFormatSupported(UINT uFormat)
Definition: cliputils.c:174
BOOL GetClipboardDataDimensions(UINT uFormat, PRECT pRc)
Definition: cliputils.c:249
LRESULT SendClipboardOwnerMessage(IN BOOL bUnicode, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: cliputils.c:12
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
#define OFN_PATHMUSTEXIST
Definition: commdlg.h:117
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4736
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
Definition: filedlg.c:4801
HANDLE HWND
Definition: compat.h:19
#define MAX_PATH
Definition: compat.h:34
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1374
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
Definition: shellole.c:522
@ Success
Definition: eventcreate.c:712
OPENFILENAMEW sfn
Definition: eventvwr.c:101
unsigned int BOOL
Definition: ntddk_ex.h:94
const GLubyte * c
Definition: glext.h:8905
GLuint index
Definition: glext.h:6031
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
Definition: hhctrl.c:157
_CRTIMP int __argc
Definition: getargs.c:21
_CRTIMP wchar_t ** __wargv
Definition: getargs.c:20
#define c
Definition: ke_i.h:80
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
HACCEL hAccel
Definition: main.c:47
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned int UINT
Definition: ndis.h:50
_Out_ LPRECT prc
Definition: ntgdi.h:1658
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_HSCROLL
Definition: pedump.c:628
#define DefWindowProc
Definition: ros2win.h:31
void UpdateLinesToScroll(LPSCROLLSTATE state)
Definition: scrollutils.c:241
void UpdateWindowScrollState(HWND hWnd, INT nMaxWidth, INT nMaxHeight, LPSCROLLSTATE lpState)
Definition: scrollutils.c:256
void OnKeyScroll(HWND hWnd, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state)
Definition: scrollutils.c:11
void OnScroll(HWND hWnd, INT nBar, WPARAM wParam, INT iDelta, LPSCROLLSTATE state)
Definition: scrollutils.c:124
void OnMouseScroll(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LPSCROLLSTATE state)
Definition: scrollutils.c:61
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LANG_HEBREW
Definition: nls.h:67
#define SUBLANG_DEFAULT
Definition: nls.h:168
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
OPENFILENAME ofn
Definition: sndrec32.cpp:56
HINSTANCE hInstance
Definition: precomp.h:43
UINT uDisplayFormat
Definition: precomp.h:47
INT iWheelCarryoverX
Definition: scrollutils.h:14
INT iWheelCarryoverY
Definition: scrollutils.h:15
LPCWSTR lpszClassName
Definition: winuser.h:3226
LPCWSTR lpszMenuName
Definition: winuser.h:3225
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
HCURSOR hCursor
Definition: winuser.h:3223
HINSTANCE hInstance
Definition: winuser.h:3221
HICON hIcon
Definition: winuser.h:3222
HWND hwndOwner
Definition: commdlg.h:330
HINSTANCE hInstance
Definition: commdlg.h:331
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
HINSTANCE hInstance
Definition: commdlg.h:362
HWND hwndOwner
Definition: commdlg.h:361
DWORD Flags
Definition: commdlg.h:373
LPWSTR lpstrFile
Definition: commdlg.h:367
LPCWSTR lpstrDefExt
Definition: commdlg.h:376
DWORD lStructSize
Definition: commdlg.h:360
DWORD nMaxFile
Definition: commdlg.h:368
LPCWSTR lpstrFilter
Definition: commdlg.h:363
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
Definition: time.h:68
#define WM_MOUSEWHEEL
Definition: treelist.c:96
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1719
#define ZeroMemory
Definition: winbase.h:1712
#define CopyMemory
Definition: winbase.h:1710
#define GMEM_MOVEABLE
Definition: winbase.h:294
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define DIB_RGB_COLORS
Definition: wingdi.h:367
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define SRCCOPY
Definition: wingdi.h:333
#define LAYOUT_RTL
Definition: wingdi.h:1371
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define WM_PAINT
Definition: winuser.h:1620
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1878
DWORD WINAPI GetSysColor(_In_ int)
#define WM_CLOSE
Definition: winuser.h:1621
#define MF_BYCOMMAND
Definition: winuser.h:202
#define DT_NOPREFIX
Definition: winuser.h:537
#define WM_HSCROLL
Definition: winuser.h:1743
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:918
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define DT_CENTER
Definition: winuser.h:527
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define WM_DESTROYCLIPBOARD
Definition: winuser.h:1868
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define COLOR_WINDOWTEXT
Definition: winuser.h:921
#define WM_VSCROLL
Definition: winuser.h:1744
#define WM_CREATE
Definition: winuser.h:1608
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_DRAWCLIPBOARD
Definition: winuser.h:1869
#define WM_SIZE
Definition: winuser.h:1611
#define SB_VERT
Definition: winuser.h:553
#define WM_DROPFILES
Definition: winuser.h:1825
#define WM_PALETTECHANGED
Definition: winuser.h:1877
#define WM_COMMAND
Definition: winuser.h:1740
#define MF_STRING
Definition: winuser.h:138
#define IDC_ARROW
Definition: winuser.h:687
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_CHECKED
Definition: winuser.h:132
#define SIZE_MINIMIZED
Definition: winuser.h:2506
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
UINT WINAPI EnumClipboardFormats(_In_ UINT)
#define MB_YESNO
Definition: winuser.h:817
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136
#define WM_CHANGECBCHAIN
Definition: winuser.h:1874
#define MF_UNCHECKED
Definition: winuser.h:204
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HWND WINAPI SetClipboardViewer(_In_ HWND)
#define WM_SETTINGCHANGE
Definition: winuser.h:1629
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_INITMENUPOPUP
Definition: winuser.h:1746
#define MF_ENABLED
Definition: winuser.h:128
#define MF_SEPARATOR
Definition: winuser.h:137
BOOL WINAPI DrawMenuBar(_In_ HWND)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define MF_BYPOSITION
Definition: winuser.h:203
#define DT_WORDBREAK
Definition: winuser.h:544
BOOL WINAPI ChangeClipboardChain(_In_ HWND, _In_ HWND)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
BOOL WINAPI UpdateWindow(_In_ HWND)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
HDC WINAPI GetDC(_In_opt_ HWND)
int WINAPI CountClipboardFormats(void)
Definition: ntwrapper.h:184
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define MB_ICONWARNING
Definition: winuser.h:786
#define CW_USEDEFAULT
Definition: winuser.h:225
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define WM_DESTROY
Definition: winuser.h:1609
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WM_KEYDOWN
Definition: winuser.h:1715
#define WM_RENDERFORMAT
Definition: winuser.h:1866
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2106
#define WM_PAINTCLIPBOARD
Definition: winuser.h:1870
#define WM_SIZECLIPBOARD
Definition: winuser.h:1872
#define WM_RENDERALLFORMATS
Definition: winuser.h:1867
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
#define SB_HORZ
Definition: winuser.h:552
BOOL WINAPI AppendMenuW(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCWSTR)
#define MF_GRAYED
Definition: winuser.h:129
void HDropFromClipboard(HDC hdc, const RECT *lpRect)
Definition: winutils.c:351
int MessageBoxRes(HWND hWnd, HINSTANCE hInstance, UINT uText, UINT uCaption, UINT uType)
Definition: winutils.c:49
void DrawTextFromClipboard(UINT uFormat, PAINTSTRUCT ps, SCROLLSTATE state)
Definition: winutils.c:75
void BringWindowToFront(HWND hWnd)
Definition: winutils.c:36
BOOL RealizeClipboardPalette(HDC hdc)
Definition: winutils.c:373
void PlayEnhMetaFileFromClipboard(HDC hdc, const RECT *lpRect)
Definition: winutils.c:326
void DrawTextFromResource(HINSTANCE hInstance, UINT uID, HDC hDC, LPRECT lpRect, UINT uFormat)
Definition: winutils.c:65
void SetDIBitsToDeviceFromClipboard(UINT uFormat, PAINTSTRUCT ps, SCROLLSTATE state, UINT fuColorUse)
Definition: winutils.c:187
void BitBltFromClipboard(PAINTSTRUCT ps, SCROLLSTATE state, DWORD dwRop)
Definition: winutils.c:155
void ShowLastWin32Error(HWND hwndParent)
Definition: winutils.c:11
void PlayMetaFileFromClipboard(HDC hdc, const RECT *lpRect)
Definition: winutils.c:306
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define SPI_SETWHEELSCROLLLINES
Definition: zmouse.h:30