在C ++中检查打开的Excel文档 [英] Check for open Excel document in C++

查看:70
本文介绍了在C ++中检查打开的Excel文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了我们的PC,从Windows XP运行Windows 7 32位。我过去使用的代码已停止工作,我想知道我能做些什么才能让它再次运行。



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);





显然Windows改变了窗口名称的方式,我很欣赏我一直在做的方式是完全软糖。



任何帮助都赞赏。



谢谢。



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.

Thanks.

推荐答案

检查Windows版本并以Windows 7的方式进行。



使用Spy ++检测excel-doc的正确名称
Check for the windows version and do it the "Windows 7" way.

Use Spy++ to detect the right name of the excel-doc


Hi
您必须通过VC ++检查Process in Task Manager并使用声明。使用GetmoduleFilename和GetModuleHandle。
Hi You must check Process in Task manager by VC++ and use for statement. use GetmoduleFilename and GetModuleHandle.


这篇关于在C ++中检查打开的Excel文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆