|
For my MDI application Framework I normally have a Single View . i.e On a File New i get another instance of the View class .
Now I want to achieve the task of displaying two views at once. I.e when the user clicks on File--> New , user should see two view Windows . How should I do this .
All i could think of was to Add to the Document template the different views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_VIEWTETYPE,
RUNTIME_CLASS(CViewTestDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CViewTestView));
AddDocTemplate(pDocTemplate);
pDocTemplate = new CMultiDocTemplate(
IDR_VIEWTETYPE,
RUNTIME_CLASS(CViewTestDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(View1));
AddDocTemplate(pDocTemplate);
Now on a File New I need to show both the Views ! How to do this ? Please Help
|
|
|
|
|
I am running the vc program from vbprogram using createprocess.My window
name is form1.When i click the button on the form1,i am starting my vc
program exe.Once when i start the exe,i tried to disable my vb program
taskbar name using
HWND DisWnd=FindWindow("Shell_TrayWnd","Form1");
EnableWindow(DisWnd,FALSE);
But it didnt worked out.
|
|
|
|
|
When the application is started it is restored (not-maximized).
When I open the document, I want to create view of the maximised size.
How can I get the maximized size when the window is restored?
|
|
|
|
|
You must to modifiy the PreCreateWindow... Go to FAQ of Michael Dunn...
Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
|
here I want maximized size of the window, but the window is NOT maximized.
|
|
|
|
|
Use the WS_MAXIMIZE flag in PreCreateWindow()
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Sir,
I have some 12 dialog boxes called in sequence.There are situations where I call a dialog box from a function.In that case if I choosing the cancel button eventhough that dialog box hides since Iam calling it in functions it proceeds to the other dialog boxes.When I give cancel in the dialog box I want the entire process to be stopped and I want to start from the first.How can we achieve this.Please kindly help me.
Thanking you.
regards,
Subhashree
|
|
|
|
|
The button you press is returned from DoModal. Check if it's IDCANCEL, and if it is, start again.
From memory there is something on MSDN about building wizard type apps, I don't remember anything else, but you should search MSDN, it could be helpful.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
When you click on cancel button, it returns IDCANCEL, check this value using coditional statements, if it is then come out of loop/application/return to the begining
|
|
|
|
|
How do I prevent the document name from showing up inside the CMainFrame() caption alongside the actual title of the application..?
I don't want "Untitled - My way cool application"
I just want "My way cool application"
How may I accomplish this please and thanx u...??
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
In PreCreateWindow(), remove the FWS_ADDTOTITLE style:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~FWS_ADDTOTITLE;
}
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Thanx Mike, just what I was looking for...
I thought it was something like that, but I couldn't find anything in MSDN...I was actually looking for a virtual inside CDocument() , but I had littel luck there too...
Thanx again!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
A quick google search brought this up:
Microsoft outdid themselves when they designed MFC such that applications are automatically named according to the document view paradigm. When you use MFC to create either an SDI or MDI application, your main window is probably called something like "Untitled - MyApp." If you don't particularly care for the document view paradigm, other than perhaps wishing to benefit from the separation of user interface and program core, then you're left in the dark...
To get rid of the "Untitled" alone, you can override the CDocument virtual function "SetTitle" as shown below.
void CMyDoc::SetTitle(LPCTSTR lpszTitle)
{
CDocument::SetTitle("MyTitle");
}
This will produce a main window title of the type "MyTitle - MyApp". But perhaps all you want is "MyApp".
You can set the main window title from just about anywhere in your application using the statement shown below.
(AfxGetMainWnd( ))->SetWindowText("MyApp");
The problem with this approach is that MFC in its infinite wisdom will reset your window title to the "Document - App" default as soon as a document object is constructed. If you care to change MFC's default behavior ( not advised ) look up WINMDI.CPP; it's the culprit.
Finally, you can overwrite the CFrameWnd virtual function "OnUpdateFrameTitle" in your apps CMainFrame class. Bud Milwood, a friend of mine, pointed out the function's very existence when I was loosing my sanity browsing the MFC online help. Don't try to look up "OnUpdateFrameTitle" in the Microsoft Developer Studio online help. It's not there. So use it merrily, but use it wisely, subsequent versions of MFC may not support it. The following code snippet shows how...
void CMainFrame::OnUpdateFrameTitle(BOOL Nada)
{
// get app name from string table resource
//----------------------------------------
CString csAppName;
csAppName.Format(AFX_IDS_APP_TITLE);
// Set caption of main frame window
//---------------------------------
SetWindowText(csAppName);
}
Another and probably safer method has been brought to my attention by Stephen Michael Schimpf at CyberSky.Simplenet.Com. You can modify the window style in 'PreCreateWindow' as follows:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(LONG) FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
}
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~(LONG) FWS_ADDTOTITLE;
return CFrameWnd::PreCreateWindow(cs);
}
That seems like the most sensible approach...
Thanks CG
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Does the windows is how to distinguish the message from deferent instances of the same program?
|
|
|
|
|
Because they are sent to the window by it's handle, or HWND, and the HWND will be different.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
i want to halt keyboard and mouse.
i want all messages that a user pass with the help of kewboard and mouse.
These user messages should not be posted only return by a function(JournalRecorderFunc).
SetWindowsHookEx(WH_JOURNALRECORD, JournalRecorderFunc,
hins, 0);
but i also want post some message of kewboard and mouse.
that are not user kewboard and mouse messages.
but thease messages are saved into a file.
With the help of threading these messages are performed one bye one.but at the same time no other message of kewboard and mouse should performed (even ctrl+alt+del)
how to do that?
r00d0034@yahoo.com
|
|
|
|
|
Why would you want to ? It sounds like a virus to me.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian seems to think your writting a virus...so i'll assume the same, seeing how you've posted 6 or so questions all about the same thing really...system hooks and trapping key presses globally...
Naughty naughty if you are...
Anyways....AFAIR there is a really easy way to prevent CTRL-ALT-DEL key combinations....it has something to do with tricking the system into thinking the screen saver is active...SetSystemInfo() or something like that...this then disables CTRL-ALT-DEL keys....but it only works under win9X...I think...
Anyways...search google for System hooks, trapping keypresses, ctrl-alt-del, etc...theres lots of examples around...
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
first of all let me tell u its not a virus its mine final project.
i want to install a software remote computer thats why i need that sort of work.
if u could tell any link then plz.
r00d0034@yahoo.com
|
|
|
|
|
You're writing your final project and you don't know how to use google ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
What's a tool I can use to see what windows messages are being sent around in my VC++ app? I've seen the name before, but when I finally need it, I can't for the life of me remember what it was.
|
|
|
|
|
Spy++, in the VC Tools menu.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I was looking all over the web for it, and all the time it was right there in my face.
|
|
|
|