|
Dear Friends
I have created a dialog based MFC application. Here I have one form say "MyForm", showing on my current desktop when I run my application. I have two button on this form called "NewDesktop" and "OldDesktop".
Now when I press "NewDesktop" I use CreateDesktop() functions and then SwitchDesktop() so It creates new desktop and shows the new desktop. But now it hides my previous application and my form. Now I want to show my form(MyForm) in this new desktop. I don't know how to do that?
Any help please?
With many many thankx and regards in advance
Mahesh
|
|
|
|
|
Have you tried "SetThreadDesktop" and then create the UI?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Hi...
I have tried that but it return's false value.
Whats seems to be the reason?
Mahesh
|
|
|
|
|
"Remarks
The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop (unless the hDesktop parameter is a handle to the current desktop)."
You must do this FIRST, then create your window. I don't think there is a way to move an already created window between desktops as it's managed by the WM for that particular desktop.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
hello,
does anybody know how to make a financial calendar? Here are some rules :
1- it begins on Jan 1 and ends at Dec 31 (always)
2- it has 4 4 5 (it means Jan has 4 weeks, Feb 4 weeks and March 5 and so on for each quarter)
Ex: Avril 4 weeks, Mai 4 weeks and Jui 5 weeks;
Jui 4 weeks, Aug 4 weeks and Sept 5 weeks;
Oct 4 weeks, Nov 4 weeks and Dec 5 weeks.
3- it has fews exceptions for bisextil year, on Jan can have 5 weeks. Ex: on 2004
Thanks...
|
|
|
|
|
And what do you need exactely ? Every calendar has the features you described, IMO. Do you need a Control, with UI ? Or a simple table or funcitonb that returns dates ? For which kind of app ? MFC ?
~RaGE();
|
|
|
|
|
i need a formula to create a financial calendar beside on standard one. I work with Progress v10.
|
|
|
|
|
homework?
regards,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
Is threre a way to change the background color and the font color in an edit box (rich or not)?
|
|
|
|
|
Yes. I would look into the WM_CTLCOLOREDIT message.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
SubClass the edit control and handle in the ON_WM_CTLCOLOR_REFLECT.
|
|
|
|
|
I found a function for the rich edit box, member of the cricheditctrl !
|
|
|
|
|
Hey,
what message is send from a CListCtrl when a user changes the colwidht on the Header? I need this, beause I have to reposition some controls.
Thanks for your help...
|
|
|
|
|
Look for the HDN_BEGINTRACK notification message. See the example here.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
How to change the caption of a dialog box dynamically?
|
|
|
|
|
|
I want to change the caption of the dialog box itself. not its controls. SetWindowText is working only for the controls, not for the dialogbox
|
|
|
|
|
yes it does !!! because SetWindowText() is a member of CWnd which is also the base class of dialog boxes.
in any dialogbox event handler, put :
this->SetWindowText("My new dialog title");
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
thanx, it works fine now.
|
|
|
|
|
what made you say, it doesn't work??
VuNic
|
|
|
|
|
Hey
I was wondering how i should handle the WM_GETMINMAXINFO because i heard that it is the first message sent when creating a window and not the WM_NCCREATE message as i previously had thought.
Should i just place it in a if statement and handle it, something like this, or is there a way to handle it properly:
<br />
<br />
if(message - WM_GETMINMAXINFO)<br />
{<br />
return 0;<br />
}<br />
else if(message == WM_NCCREATE)<br />
{<br />
SetWindowLongPtr(hwnd, GWL_USERDATA, ((long)((LPCREATESTRUCT(lParam))->lpCreateParams)));<br />
}<br />
<br />
<br />
thanks alot
|
|
|
|
|
virtualrush wrote: I was wondering how i should handle the WM_GETMINMAXINFO
Why do you want to handle it in the first place?
What are you trying to achive that the default-implementation does not do?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I was told that if your class cant handle that first message it might crash your program, or am i confused because it will be handled automatically by the default window procedure.
thanks
|
|
|
|
|
Of my several MFC applications none does activly override the WM_GETMINMAXINFO message handler.
It is handled by the MFC-Framework just fine.
If you do barebones Win32 programming you *might* have to handle that message. I this case I apologise for leading you in the wrong direction.
Also, I can not rule out the possibility of crashing an application by sending it a forged WM_GETMINMAXINFO.
But I am not aware of such a possibility.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
-- modified at 8:10 Wednesday 25th January, 2006
|
|
|
|
|
As an occasional "real" C programmer (SDK level), I can say that I don't handle WM_GETMINMAXINFO - I leave it to the default handlers.
Don't the MFC gurus have a way to look at the MFC code, to see what MFC actually does with this message? As far as I remember (from talking to my local Alpha-geek) MFC just passes most of the low-level WM_ messages straight through to the native Windows handlers.
|
|
|
|