Recommended Posts


I have a C++ app that uses the Sendit function below to try to get an MAP image to the clipboard.

I have tested it so far to check that I get the correct hThread.


Can you, Alex, see what prevents the code below to get the MAP into clipboard?




HWND SendIt(DWORD dwProcessID) {
	HWND hwnd = NULL;
	do {
		hwnd = FindWindowEx(NULL, hwnd, NULL, NULL);
		DWORD dwPID = 0;
		DWORD hThread;
		hThread = GetWindowThreadProcessId(hwnd, &dwPID);
		if (dwPID == dwProcessID && hThread != NULL) {
			PostThreadMessage(hThread, WM_SYSKEYDOWN, VK_MENU, 1);
			PostThreadMessage(hThread, WM_KEYDOWN, VK_LSHIFT, 1);
			PostThreadMessage(hThread, WM_KEYDOWN, 'P', 1);
	} while (hwnd != 0);
	return hwnd; //Ignore that



Edited by roarkr

Share this post

Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Roar,

sorry but I use the Qt library to put the images into the clipboard since LNM has to work on Linux and macOS too.

The code for that is here: void MainWindow::mapCopyToClipboard() if interested.

No idea how to do that on plain Windows.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now