I've recently updated our PCs to run Windows 7 32-bit from Windows XP. The code I had used in the past has stopped working and I was wondering what I could do to get it working again.
FileStr.Format("Microsoft Excel - %s [Read-Only]", pathStr);
HWND hWnd= ::FindWindow(NULL,FileStr);
if (hWnd == NULL)
ShellExecute(NULL, "open", pseMULTI.m_tProductionTaskfBriefPath, NULL, NULL, SW_SHOWNORMAL);
Obviously Windows have changed the way it window names, and I appreciate that the way I had been doing it was a complete fudge.
Any help appreciated.
Check for the windows version and do it the "Windows 7" way.
Use Spy++ to detect the right name of the excel-doc
10 Feb '13 - 21:52
You must check Process in Task manager by VC++ and use for statement. use GetmoduleFilename and GetModuleHandle.
28 Mar '13 - 23:32
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)