Index: /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.cpp
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.cpp (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.cpp (revision 134)
@@ -0,0 +1,223 @@
+// GetClipboardData.cpp : Defines the entry point for the application.
+//
+
+#include "stdafx.h"
+#include "GetClipboardData.h"
+
+#define MAX_LOADSTRING 100
+
+// Global Variables:
+HINSTANCE hInst; // current instance
+TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
+TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
+
+// Forward declarations of functions included in this code module:
+ATOM MyRegisterClass(HINSTANCE hInstance);
+BOOL InitInstance(HINSTANCE, int);
+LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
+INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
+
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine,
+ int nCmdShow)
+{
+ UNREFERENCED_PARAMETER(hPrevInstance);
+ UNREFERENCED_PARAMETER(lpCmdLine);
+
+ // TODO: Place code here.
+ MSG msg;
+ HACCEL hAccelTable;
+
+ // Initialize global strings
+ LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+ LoadString(hInstance, IDC_GETCLIPBOARDDATA, szWindowClass, MAX_LOADSTRING);
+ MyRegisterClass(hInstance);
+
+ // Perform application initialization:
+ if (!InitInstance (hInstance, nCmdShow))
+ {
+ return FALSE;
+ }
+
+ hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_GETCLIPBOARDDATA));
+
+ // Main message loop:
+ while (GetMessage(&msg, NULL, 0, 0))
+ {
+ if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ return (int) msg.wParam;
+}
+
+
+
+//
+// FUNCTION: MyRegisterClass()
+//
+// PURPOSE: Registers the window class.
+//
+// COMMENTS:
+//
+// This function and its usage are only necessary if you want this code
+// to be compatible with Win32 systems prior to the 'RegisterClassEx'
+// function that was added to Windows 95. It is important to call this function
+// so that the application will get 'well formed' small icons associated
+// with it.
+//
+ATOM MyRegisterClass(HINSTANCE hInstance)
+{
+ WNDCLASSEX wcex;
+
+ wcex.cbSize = sizeof(WNDCLASSEX);
+
+ wcex.style = CS_HREDRAW | CS_VREDRAW;
+ wcex.lpfnWndProc = WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = hInstance;
+ wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_GETCLIPBOARDDATA));
+ wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
+ wcex.lpszMenuName = MAKEINTRESOURCE(IDC_GETCLIPBOARDDATA);
+ wcex.lpszClassName = szWindowClass;
+ wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
+
+ return RegisterClassEx(&wcex);
+}
+
+//
+// FUNCTION: InitInstance(HINSTANCE, int)
+//
+// PURPOSE: Saves instance handle and creates main window
+//
+// COMMENTS:
+//
+// In this function, we save the instance handle in a global variable and
+// create and display the main program window.
+//
+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
+{
+ HWND hWnd;
+
+ hInst = hInstance; // Store instance handle in our global variable
+
+ hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
+
+ if (!hWnd)
+ {
+ return FALSE;
+ }
+
+ ShowWindow(hWnd, nCmdShow);
+ UpdateWindow(hWnd);
+
+ return TRUE;
+}
+
+//
+// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
+//
+// PURPOSE: Processes messages for the main window.
+//
+// WM_COMMAND - process the application menu
+// WM_PAINT - Paint the main window
+// WM_DESTROY - post a quit message and return
+//
+//
+
+HWND hNextClipboardViewerWindow;
+
+LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ int wmId, wmEvent;
+ PAINTSTRUCT ps;
+ HDC hdc;
+
+ switch (message)
+ {
+
+ #pragma region Real Code
+ case WM_CREATE:
+ hNextClipboardViewerWindow = SetClipboardViewer(hWnd);
+ break;
+ case WM_CHANGECBCHAIN:
+ {
+ HWND hRemovedWindow = (HWND) wParam;
+ HWND hNextWindow = (HWND) lParam;
+ if(hNextClipboardViewerWindow == hRemovedWindow)
+ hNextClipboardViewerWindow = hNextWindow;
+ else if(hNextClipboardViewerWindow)
+ SendMessage(hNextClipboardViewerWindow, WM_CHANGECBCHAIN, wParam, lParam);
+ }
+ break;
+ case WM_DRAWCLIPBOARD:
+ {
+ if(OpenClipboard(hWnd))
+ {
+ if(IsClipboardFormatAvailable(CF_UNICODETEXT))
+ {
+ HGLOBAL hData = (HGLOBAL) GetClipboardData(CF_UNICODETEXT);
+ // ...
+ }
+ CloseClipboard();
+ }
+ }
+ break;
+ #pragma endregion
+
+ case WM_COMMAND:
+ wmId = LOWORD(wParam);
+ wmEvent = HIWORD(wParam);
+ // Parse the menu selections:
+ switch (wmId)
+ {
+ case IDM_ABOUT:
+ DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
+ break;
+ case IDM_EXIT:
+ DestroyWindow(hWnd);
+ break;
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+ break;
+ case WM_PAINT:
+ hdc = BeginPaint(hWnd, &ps);
+ // TODO: Add any drawing code here...
+ EndPaint(hWnd, &ps);
+ break;
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+ default:
+ return DefWindowProc(hWnd, message, wParam, lParam);
+ }
+ return 0;
+}
+
+// Message handler for about box.
+INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ UNREFERENCED_PARAMETER(lParam);
+ switch (message)
+ {
+ case WM_INITDIALOG:
+ return (INT_PTR)TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
+ {
+ EndDialog(hDlg, LOWORD(wParam));
+ return (INT_PTR)TRUE;
+ }
+ break;
+ }
+ return (INT_PTR)FALSE;
+}
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.h
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.h (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.h (revision 134)
@@ -0,0 +1,3 @@
+#pragma once
+
+#include "resource.h"
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.sln
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.sln (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.sln (revision 134)
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GetClipboardData", "GetClipboardData.vcxproj", "{97B7B42F-6166-43AF-B961-AB1CF3800CC7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {97B7B42F-6166-43AF-B961-AB1CF3800CC7}.Debug|Win32.ActiveCfg = Debug|Win32
+ {97B7B42F-6166-43AF-B961-AB1CF3800CC7}.Debug|Win32.Build.0 = Debug|Win32
+ {97B7B42F-6166-43AF-B961-AB1CF3800CC7}.Release|Win32.ActiveCfg = Release|Win32
+ {97B7B42F-6166-43AF-B961-AB1CF3800CC7}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj (revision 134)
@@ -0,0 +1,103 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {97B7B42F-6166-43AF-B961-AB1CF3800CC7}
+ Win32Proj
+ GetClipboardData
+
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ false
+
+
+
+ Use
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
+ Windows
+ true
+
+
+
+
+ Level3
+ Use
+ Full
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ AnySuitable
+ Size
+ true
+ true
+ true
+ MultiThreaded
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create
+ Create
+
+
+
+
+
+
+
+
+
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj.filters
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj.filters (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/GetClipboardData.vcxproj.filters (revision 134)
@@ -0,0 +1,52 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hpp;hxx;hm;inl;inc;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Resource Files
+
+
+ Resource Files
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+
+
+ Resource Files
+
+
+
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/Resource.h
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/Resource.h (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/Resource.h (revision 134)
@@ -0,0 +1,31 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by GetClipboardData.rc
+//
+
+#define IDS_APP_TITLE 103
+
+#define IDR_MAINFRAME 128
+#define IDD_GETCLIPBOARDDATA_DIALOG 102
+#define IDD_ABOUTBOX 103
+#define IDM_ABOUT 104
+#define IDM_EXIT 105
+#define IDI_GETCLIPBOARDDATA 107
+#define IDI_SMALL 108
+#define IDC_GETCLIPBOARDDATA 109
+#define IDC_MYICON 2
+#ifndef IDC_STATIC
+#define IDC_STATIC -1
+#endif
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NO_MFC 130
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 110
+#endif
+#endif
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.cpp
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.cpp (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.cpp (revision 134)
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// GetClipboardData.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.h
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.h (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/stdafx.h (revision 134)
@@ -0,0 +1,21 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include
+
+// C RunTime Header Files
+#include
+#include
+#include
+#include
+
+
+// TODO: reference additional headers your program requires here
Index: /trunk/Utilities/Miscellaneous/GetClipboardData/targetver.h
===================================================================
--- /trunk/Utilities/Miscellaneous/GetClipboardData/targetver.h (revision 134)
+++ /trunk/Utilities/Miscellaneous/GetClipboardData/targetver.h (revision 134)
@@ -0,0 +1,8 @@
+#pragma once
+
+// Including SDKDDKVer.h defines the highest available Windows platform.
+
+// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
+// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
+
+#include