Then you will have to get into interprocess communication, and stuff like that. Perhaps the cure is worse than the ailment in that case...idunno, that's your call, obviously.
Here is the source for the DLL that I'm attaching. All it contains is the jzModelessMessageBox function. It's not the best, just a quick and dirty version of what I am talking about. The thing leaves a trail on my machine, but I think that is not an issue with all machines. At any rate, it will repaint when you are done moving, which is what you want, isn't it?
// modelessdlgs.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "modelessdlgs.h"
#include "resource.h"
#include <stdio.h>
#include <globstruct.h>
GlobStruct* ptrCore;
HINSTANCE hInst = NULL;
HWND hMessageBox = NULL;
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
hInst = (HINSTANCE)hModule;
break;
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
INT_PTR CALLBACK jzMessageBox(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_INITDIALOG:
return TRUE;
break;
case WM_COMMAND:
if (wParam == IDOK || wParam == IDCANCEL)
{
DestroyWindow(hwndDlg);
hMessageBox = NULL;
return TRUE;
}
break;
default:
//
break;
}
return FALSE;
}
MODELESSDLGS_API void ReceiveCoreDataPtr(LPVOID pCore)
{
ptrCore = (GlobStruct*)pCore;
}
MODELESSDLGS_API int jzModelessMessageBox(const char* text, const char* title, DWORD flags)
{
char sztext[80];
if (hMessageBox != NULL) return -1;
hMessageBox = CreateDialog(hInst, MAKEINTRESOURCE(IDD_JZMESSAGEBOX),
NULL, jzMessageBox);
ShowWindow(hMessageBox, SW_SHOW);
SetWindowText(hMessageBox, title);
SendDlgItemMessage(hMessageBox, IDC_MSG, WM_SETTEXT, NULL, (LPARAM)text);
return 0;
}
EDIT: I have been experimenting with the best settings for this, and also...mine trails because I have draw window contents while dragging enabled. When I disable that, it works as expected. Also, are you using a compiler that has a resource editor? If not, I can give you a couple of files that will be quite useful for this, and will allow you to make dialog templates much easier.