Y
SUPER!
Mit folgendem Code klappt's:
#include <Windows.h>
#include <iostream>
using namespace std;
void main()
{
DWORD dwID = 0;
MSGBOXPARAMS msg = { 0 };
msg.cbSize = sizeof(MSGBOXPARAMS);
msg.hInstance = GetModuleHandle(NULL);
msg.lpszText = TEXT("refresh Text-File");
msg.lpszCaption = TEXT("Please wait...");
msg.dwStyle = MB_OK | MB_SETFOREGROUND;
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)MessageBoxIndirect, &msg, 0, &dwID);
HWND m_hwnd = NULL;
while (!m_hwnd) {
Sleep(0);
m_hwnd = FindWindow((LPCSTR)32770, msg.lpszCaption);
}
cout << "Fenster Handle = " << m_hwnd << endl << endl;
SendMessage(m_hwnd, WM_CLOSE, NULL, NULL); // MsgBox schließen
system("pause");
}
Vielen Dank!