I'm trying to minimize an Excel window using c++. but it doesn't work.
Code:
 
//Save the PID
HWND hWnd = FindWindowA(NULL, (LPCSTR)pXlApp);  
GetWindowThreadProcessId(hWnd, &proccesID);

// Make it visible 
{
VARIANT x;
x.vt = VT_I4;
x.lVal = isVisible;
AutoWrap(DISPATCH_PROPERTYPUT, NULL, pXlApp, L"Visible", 1, x);
}
Here I tried this:
Code:
 
{
SetForegroundWindow((HWND)(((ULONG) hWnd) | 0x01) );
BringWindowToTop(hWnd);
ShowWindow(hWnd, SW_MINIMIZE);      
}
and this:
Code:
 
{
ShowWindow(hWnd, SW_MINIMIZE);      
}
amd i have also tried WINDOWPLACEMENT and other things, and anything works.

I checked the HWND is not null, but is not visible....
Code:
 
bool visible=IsWindowVisible(hWnd);
and visible=false, but the window is Visible (I see the Excel file)

Do you know why?

Could you help me?? Thank you