Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAlternatives to WinHTTP and SoapToolkit? Pin
Ed K26-Jan-06 5:10
Ed K26-Jan-06 5:10 
QuestionDoes anyone know the default location to.. Pin
JohnnyG26-Jan-06 4:38
JohnnyG26-Jan-06 4:38 
AnswerRe: Does anyone know the default location to.. Pin
David Crow26-Jan-06 7:26
David Crow26-Jan-06 7:26 
QuestionRoaming profile Pin
P Gibson26-Jan-06 3:48
P Gibson26-Jan-06 3:48 
QuestionRe: Roaming profile Pin
David Crow26-Jan-06 4:11
David Crow26-Jan-06 4:11 
QuestionCMDIFrameWnd in ActiveX Pin
souso2026-Jan-06 3:12
souso2026-Jan-06 3:12 
Question[Message Deleted] Pin
Zanathel26-Jan-06 2:20
Zanathel26-Jan-06 2:20 
QuestionProblem in showing the dialog form in different desktop created using CreateDesktop()? Pin
Amarelia26-Jan-06 2:00
Amarelia26-Jan-06 2:00 
Hi Friends

Yesterday also I have posted the same question but I didn't get any reply. Frown | :(

I have my dialog based application which shows one form and it contains one button. When I press the button I create new desktop and then use switch to the new desktop. Now I want to show one more dialog form in this newly created desktop. But I am unable to do it. is there a way to do same?

Or is there a way to give parent window or attaching it to other desktop?

I am pating my little code here so that you can have exact idea what I am doing.

//My CPP file
HDESK hOriginalThread;
HDESK hOriginalInput;
HDESK hNewDesktop;

// Save original ...
hOriginalThread = GetThreadDesktop(GetCurrentThreadId());
hOriginalInput = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP);

// Create a new Desktop and switch to it
hNewDesktop = CreateDesktop("MYDesktop", NULL, NULL, 0, GENERIC_ALL, NULL);
SetThreadDesktop(hNewDesktop);
SwitchDesktop(hNewDesktop);

// Here I want to show my new dialog form
CMyDlg objDlg;
objDlg.DoModal(); or objDlg.ShowWindow(SW_SHOW);
// Restore original ...
SwitchDesktop(hOriginalInput);
SetThreadDesktop(hOriginalThread);

// Close the Desktop
CloseDesktop(hNewDesktop);

return 0;

Any idea how to achieve...

Regards

Mahesh
AnswerRe: Problem in showing the dialog form in different desktop created using CreateDesktop()? Pin
Rage26-Jan-06 3:24
professionalRage26-Jan-06 3:24 
GeneralRe: Problem in showing the dialog form in different desktop created using CreateDesktop()? Pin
Amarelia26-Jan-06 7:05
Amarelia26-Jan-06 7:05 
GeneralRe: Problem in showing the dialog form in different desktop created using CreateDesktop()? Pin
Owner drawn26-Jan-06 17:16
Owner drawn26-Jan-06 17:16 
AnswerRe: Problem in showing the dialog form in different desktop created using CreateDesktop()? Pin
BadKarma26-Jan-06 21:29
BadKarma26-Jan-06 21:29 
QuestionDDX and DDV for dynamic CEdit Pin
JohnMFC26-Jan-06 1:21
JohnMFC26-Jan-06 1:21 
AnswerRe: DDX and DDV for dynamic CEdit Pin
Rage26-Jan-06 3:26
professionalRage26-Jan-06 3:26 
AnswerRe: DDX and DDV for dynamic CEdit Pin
Blake Miller26-Jan-06 10:42
Blake Miller26-Jan-06 10:42 
QuestionChanging directory in CFileDialog Pin
doctorpi26-Jan-06 0:57
doctorpi26-Jan-06 0:57 
AnswerRe: Changing directory in CFileDialog Pin
Cedric Moonen26-Jan-06 1:43
Cedric Moonen26-Jan-06 1:43 
AnswerRe: Changing directory in CFileDialog Pin
David Crow26-Jan-06 3:32
David Crow26-Jan-06 3:32 
Questionfrom where extra #s come when float is saved to double Pin
pc_dev25-Jan-06 23:40
pc_dev25-Jan-06 23:40 
AnswerRe: from where extra #s come when float is saved to double Pin
Rage26-Jan-06 0:36
professionalRage26-Jan-06 0:36 
AnswerRe: from where extra #s come when float is saved to double Pin
David Crow26-Jan-06 4:02
David Crow26-Jan-06 4:02 
AnswerRe: from where extra #s come when float is saved to double Pin
cmk26-Jan-06 12:29
cmk26-Jan-06 12:29 
QuestionAFX? Pin
Zanathel25-Jan-06 22:58
Zanathel25-Jan-06 22:58 
AnswerRe: AFX? Pin
Stephen Hewitt25-Jan-06 23:03
Stephen Hewitt25-Jan-06 23:03 
GeneralRe: AFX? Pin
Zanathel26-Jan-06 0:38
Zanathel26-Jan-06 0:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.