如何通过其他类打开和关闭mfc gui?

发布于 2024-10-09 07:44:28 字数 63 浏览 0 评论 0原文

我需要创建一个具有指向 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我很坚强 2024-10-16 07:44:28

通过“打开和关闭 GUI”,我假设您的意思是隐藏或显示主窗口,因为您没有提供对您要查找的内容的良好描述。您可以将 CWnd::ShowWindowSW_HIDE 参数关闭窗口,并使用 SW_SHOWSW_RESTORE 再次显示它。

通过“从 GUI 获取数据的选项”,我假设您想要从 GUI 复制并粘贴到另一个应用程序。这是一个更大的话题。以下是一些示例代码:

OpenClipboard();
EmptyClipboard();
SetClipboardData(CF_TEXT, dataHandle);
CloseClipboard();

您可以在 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 use SW_SHOW or SW_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:

OpenClipboard();
EmptyClipboard();
SetClipboardData(CF_TEXT, dataHandle);
CloseClipboard();

You can find a lot more information in Microsoft's guide to Using the Clipboard.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文