|
Try to pretranslate the message WM_KEYDOWN and then filter the return... if you want another and more polite way to do it, derive a class from the combobox and handle the keys from there...
I was wondering if WM_CHAR could help you too...
Hope this helps...
|
|
|
|
|
Hello
I am trying to create an application that has a main windoe and two child frames inside the main window. One frame needs to be dialog based so I can place a number of controls and edit fields on it. The other needs to be a plain window that can except drawing and/or plot information from the program. I would like to have both windows fixed in size and position and have both of them come up automatically when the program starts. Ther are a few other features that I want to add but that will be addressed after I get this structue working and the program running.
I have figured out how to create an MDI application. I chose to use an MDI because it looks like the only window style that will do what I want. I will admit that I am a hardare designer and this is my first time with Visual C++. So I am an extream novice. I do have two copies of "Teach youself Visual C++" books by SAMS, however they are not much help for this application. So I thought I would locate some experts! Any help would be greatly appreciated.
|
|
|
|
|
In your case you really don't need to use MDI if you only need to create 2 views from the same document. What you can do is create and SDI application, and then use a splitter Frame. using a splitter window allows you to insert a seperate view into each of the splitter panes, and each one of these views can be what ever you need them to be, i.e. a FormView, CDialog box, RichEdit, what ever you need. Then each of these views can access the Document class which you setup and, and have access to the data.
There are many great articles in here about creating splitter windows and how to associate view with them as well as many articles on dealing with MDI and SDI.
I know this is kinda vague, but I think I at least pointed you in the right direction.
Hope this helps!
Dan
|
|
|
|
|
Dan
Thanks for the reply. What I am trying to do is create two separet frames that are independante of each other. One frame needs to be a dialog box in which I will place controls or options for running the program and the other frame will be an output of the program results. The results will be a plot of an airfoil and some data in a list next to the plot. I would like to have the two frames fixed in size and position when the program is in a full screen view or just come up with a default size and position. Also the two frames must he contained inside a main window. Are there any articles on how to do this?
Thanks
Scott
|
|
|
|
|
Will you trully have multiple documents?
Create MDI/SDI ( I recommend SDI), create Dialog place controls on it. Insert new class based on CDialogBar, in Mainframe::OnCreate create yor bar given ID of your dialog. Dock dialog (left/right/whatever).
I would not even bother with splits.
|
|
|
|
|
If I want to set IP in my program,which API should I use,and how to use these API?
thanks!
by the way ,I found that there were not Iphlpapi.h in my PC when I want to use function AddIPAddress(XX)
Don't look at me in that way!
|
|
|
|
|
well you do need to use the ip helper api package. If its not on your pc than you need to download/install the most recent SDK you can find. That should take care of it for you. Once you've done that you have access to a rich api that will let you take care of all that for you.
Joseph Dempsey
joseph_r_dempsey@yahoo.com
"Software Engineering is a race between the programmers, trying to make bigger and better fool-proof software, and the universe trying to make bigger fools. So far the Universe in winning."
--anonymous
|
|
|
|
|
Deal All,
I'm goint to customize Windows Media Player 6.4 using VB 6 or VC++.
THe basic requirements for this task are:
1) the media player only play at full-screen mode. This is quite easy and I can set the properties related.
2) the media player is exclusively run, which means when there is a playback, there would be no other player running simutaneously.
I dont know how to do this by customizing media player. However, I set the program checking at starting point if there is a previous instance of this program. If yes, then abort the new started player program.
However, if the file name of this media player changed, two media player programs with different names will be running simultaneously, which is a situation i did not expect to see.
3) The full screen mode seems not so stable. For example, if I try to start, at the same time, the same player program more than once, only one will run but NOT in full screen mode.
I appreciate your help!
JW
DJ
|
|
|
|
|
This is an 'official' bug of the .NET compiler. Does someone has any clue on solving this issue ????
Jonathan de Halleux.
|
|
|
|
|
Hello,
I have SDI app of type CTreeView.. My question is, is there a way of moving the tree over x number of pixels and down y number of pixels?? I'm using the OnPaint function to paint a border around the outside of the tree, the only problem is that the tree is so close to the top and left side of the window that my border covers part of the tree...
Any ideas??
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
If you inherit from the TreeView, you could override the WM_NCCALCSIZE / OnNcCalcSize message
to give yourself some non-client area to put a fancy border in using WM_NCPAINT / OnNcPaint.
Iain.
|
|
|
|
|
Thanks for the quick reply.. I have been trying the following... The only problem I am having is I can't seem to paint on the non-client area.. I can see a 5px gap all the way around the tree, even when I paint my border.. Here is what im trying on my WM_NCCALCSIZE msg..
LRESULT CMyTreeView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == WM_NCCALCSIZE)
{
if(wParam == TRUE)
{
RECT* prect = (RECT*)lParam;
prect->right = prect->right - 5;
prect->left = prect->left + 5;
prect->top = prect->top + 5;
prect->bottom = prect->bottom -5;
return 0;
}
}
return CTreeView::WindowProc(message, wParam, lParam);
}
Any ideas? Am I doing this all wrong?
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
I actually had CTreeCtrl in mind when I replied earlier! Doh...
Having a quick look at the DSK for calcsize, when wParam == TRUE,
lParam = (NCCALCSIZE *), not (RECT *). But you are getting away
with it! A five pixel gap is what you asked for.
How are you trying to paint? You need to be using OnNcPaint.
Iain.
|
|
|
|
|
THanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi
I have developed a client server program with RTP/RTCP and IPV6 communication. The RTP Library is given as both debug and release mode. When the application changes from debug mode to release mode the data sending is not happening. I am using WS2_32.dll for socket operations. Could anybody suggest the reason or any clues to get it resolved and make it running in release mode. Any suggestions are appreciable.
Regards,
Sankaran
|
|
|
|
|
http://www.codeguru.com/debug/release_ver.shtml
|
|
|
|
|
My main header file is bloated to the max, now reaching 6000 lines with many classes. I started editing it by hand riping out classes and creating their respective header/source files, but it is taking forever.
It would be GREAT if someone has or knows of a utility which will do this, ideally this utility would create class.h and class.cpp files for every class in a header file.
|
|
|
|
|
Just write a macro to do it. Should take you about 1/2 hour to make the macro, searching for "class" and what not, then it'll take the macro about 30 seconds to run.
|
|
|
|
|
hm, ya not a bad idea, thanks ill post it if i get around to it, busy with other stuff at the moment though
|
|
|
|
|
Hi
Does anyone have the source for making plain text scroll .. just text, no pictures, don't need special backgrounds etc. It has to be vertical scrolling
and easy to implement becz i'm not that good in mfc (yet? ).
Thanks for the support
Greetz
Jens
|
|
|
|
|
|
ok thanks .. already works i c .. you were right about the colours
Do you know how i can make sure the form can not be moved .. else if you move the form, the scrolling background becomes gray
Sorry, i already finded out that i can set property of dialog: control & center. But i don't see the titlebar (and the option 'titlebar' is checked)
Thanks
Jens
|
|
|
|
|
dear all,
how do i differentiate between windows Shutdown and Restart using WM_QUERYENDSESSION.
I can find out if user has logged of using
if (lParam & ENDSESSION_LOGOFF)
{
\\ logoff
}
else
{
\\ restart or shutdown
}
but i don't know how to differentiate between the shutdown and restart condition in else
Regards
|
|
|
|
|
Is there any way in C++/MFC that we can export a registry key and all its subkeys/values and save the contents to a file, like we do using "regedit.exe"? "RegSaveKey" will not work since it can only save all contents of a root key.
|
|
|
|
|
Read the documentation for RegSaveKey once again :
hKey <br />
[in] Specifies a handle to the key where the save operation is to begin, or any of the following predefined reserved handle values: <br />
|
|
|
|