I'm trying to minimize an Excel window using c++. but it doesn't work.
Here I tried this: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); }
and this:Code:{ SetForegroundWindow((HWND)(((ULONG) hWnd) | 0x01) ); BringWindowToTop(hWnd); ShowWindow(hWnd, SW_MINIMIZE); }
amd i have also tried WINDOWPLACEMENT and other things, and anything works.Code:{ ShowWindow(hWnd, SW_MINIMIZE); }
I checked the HWND is not null, but is not visible....
and visible=false, but the window is Visible (I see the Excel file)Code:bool visible=IsWindowVisible(hWnd);
Do you know why?
Could you help me?? Thank you




Reply With Quote
