如何通过其他类打开和关闭mfc gui?
我需要创建一个具有指向 MFC 类的指针的类,并打开和关闭 GUI,并且还可以选择从 GUI 获取数据。 谢谢。
i need to make a class that have a pointer to mfc class and to turn on and off the gui and also to have the option to take data from the gui.
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过“打开和关闭 GUI”,我假设您的意思是隐藏或显示主窗口,因为您没有提供对您要查找的内容的良好描述。您可以将 CWnd::ShowWindow 与
SW_HIDE
参数关闭窗口,并使用SW_SHOW
或SW_RESTORE
再次显示它。通过“从 GUI 获取数据的选项”,我假设您想要从 GUI 复制并粘贴到另一个应用程序。这是一个更大的话题。以下是一些示例代码:
您可以在 Microsoft 的 使用剪贴板。
By "turn on and off the GUI" I will assume you mean hide or display the main window, since you haven't provided a good description of what you're looking for. You can use CWnd::ShowWindow with a parameter of
SW_HIDE
to turn the window off, and useSW_SHOW
orSW_RESTORE
to show it again.By "option to take data from the GUI" I will assume you want to do Copy and Paste from the GUI to another application. That's a much larger subject. Here's some sample code:
You can find a lot more information in Microsoft's guide to Using the Clipboard.