CreateDesktop(..)(确定),然后从我的应用程序在此新桌面上打开新的(MFC)CFrame [英] CreateDesktop(..) (OK) and open new (MFC)CFrame on this new Desktop from my Application

查看:125
本文介绍了CreateDesktop(..)(确定),然后从我的应用程序在此新桌面上打开新的(MFC)CFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在新创建的桌面上打开新窗口时遇到问题.我可以在那里启动一个新应用程序:

我这样做:

Hi there, i''ve problem open new window on newly Created desktop. I can start a new application there:

I do:

this->hNewDesktop = CreateDesktop(sDesktop.c_str(), NULL, NULL, NULL, WRITE_DAC | READ_CONTROL | DESKTOP_CREATEMENU | DESKTOP_CREATEWINDOW | DESKTOP_SWITCHDESKTOP, NULL);

SwitchDesktop(hNewDesktop);

HWnd hWindow = CreateWindow(TEXT("test"), TEXT("test"), WS_CAPTION | WS_BORDER | WS_VISIBLE, 0, 0, WindowWidth, WindowHeight, 0, 0, this->mParent, NULL); // hInstance


---
窗口出现在旧桌面上? -任何人都有一些想法-我找不到一些信息来在新桌面上打开窗口-只能在那儿打开应用程序...

? THX


---
window appears on old desktop? - anyone some ideas - I can''t find some information to open a window on new desktop - only to open a application there...

? THX

推荐答案

参考您的解决方案1,我的建议是:不要这样做!

我不必启动新的桌面并在其中打开窗口,但是很多年前,我正在开发一个应用程序,在该应用程序中我们想创建窗口并移动"处理以分离线程.我们最终更改了设计.

有一些原因使您无法在MFC中正常工作.尽管我下面发布的链接来自于VC6的书,但我认为这些观点仍然有效.
使用用户界面线程 [
With reference to your Solution 1, my advice is: Don''t do it!

I have not had to start a new desktop and open windows in it, but many years ago, I was working on an application where we wanted to create windows and "move" the handling to separate threads. We ended up changing the design.

There are reasons why you are having problems getting this working in MFC. Although the link I have posted below is from a book on VC6, I believe the points are still valid.
Using User-Interface Threads[^]

You should create a separate UI thread and create your window from there once that thread is up and running.

Soren Madsen


确定-创建单独的线程,然后在此处创建新窗口-现在可以正常工作.但是现在MFC CWnd出现了问题->在其他线程中创建窗口存在一些问题-有人建议吗?

THX
ok - Create seperate Thread an Create new window there - now it works. but now there is a Problem with MFC CWnd --> Here there are some problems Creating a window in a different thread - someone a advise?

THX


这篇关于CreateDesktop(..)(确定),然后从我的应用程序在此新桌面上打开新的(MFC)CFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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