|
Writing CRect(Start, End) calls that CRect ctor to create a new CRect object. This object will get destroyed at the end of the statement.
The = uses the CRect assignment operator (not the copy constructor) to assign that new CRect object into m_EnclosingRect . The implementation of the assignment operator is usually similar/identical to that of the copy ctor, so the end result is that m_EnclosingRect gets a copy of that new CRect object.
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Thanks for the detailed explanation.
|
|
|
|
|
I have an application that allows users to select "stay on top"...however if another application presents a message box (crital error for example), I'd like to trap that and force that message box into the foreground...does anyone have advice on the best way to implement such a feature?
TIA!
Regards,
Norm
|
|
|
|
|
Interesting. How do you going to determine a normal message box from one that conveys "critical error?"
Kuphryn
|
|
|
|
|
I hope I will not waste your time. I am a beginner and had never tried making my window on top, but I think that you do it by setting the window's style. I have an idea, but I do not know whether it is correct or applicable. If an application presents a message box, then your application will lose focus. May be you could handle WM_KILLFOCUS (or OnKillFocus() ) and test the window getting focus for its style. If the style contains on top (and maybe message box style), put it somehow in front of your app (I think you would need to change your app's Z-order to make it after the message box).
Hope this helps, and sorry for anything wrong I may have said.
Hosam Aly Mahmoud
|
|
|
|
|
As I tried to look it up, I saw that you may be able to handle it as follows:
case WM_KILLFOCUS:
if ( wParam != 0 )
{
WINDOWINFO wi;
GetWindowInfo( (HWND)wParam, &wi );
if ( (wi.dwExStyle & WS_EX_TOPMOST) == WS_EX_TOPMOST )
{
SetWindowPos( (HWND)wParam, HWND_TOP,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE |
SWP_NOOWNERZORDER | SWP_NOSENDCHANGING );
}
}
return 0;
Hope this helps (and hope I am not wrong!).
Hosam Aly Mahmoud
|
|
|
|
|
Thanks, just what I needed!
I'll check the wi.dwStyle for WS_POPUP or WS_POPUPWINDOW and if that window's RECT intersects my window will set the appropriate Z-Order for these two windows.
best regards,
norm
|
|
|
|
|
I am happy it worked!
Hosam Aly Mahmoud
|
|
|
|
|
I am trying to figure out this class, but
seems like this CdataGrid is not in MSDN.
I already installed subscription upto 2001,
still no luck. Anyone with the same problem
able to found the solution?
shin
|
|
|
|
|
That's probably because it is not a Microsoft class.
http://www.codeproject.com/useritems/datagrid.asp
|
|
|
|
|
Hi,
Sorry if this is the wrong forum to be asking this
Anyway, I'm going to install Visual Studio .NET 2003. I have Visual Studio .NET (ver. 7) installed already. Should I uninstall it and the framework before installing the newer version?
Thanks..;P
|
|
|
|
|
The answer depends on whether you still want to use version 7. I recommend uninstalling version 7 before installing .NET 2003.
Kuphryn
|
|
|
|
|
Hi,
I’m initializing the dialog in my MFC application from the parent window as follows:
In TreeView.cpp,
void CMyTreeView::OnDraw(CDC* pDC)
{
/**/
CMfcTree dlg;
int ret = dlg.DoModal();
}
In MfcTree.cpp OnInitDialog() is as follows,
BOOL CMfcTree::OnInitDialog()
{
CDialog::OnInitDialog();
m_ImageList.Create(IDB_BITMAP1, 13, 12, RGB(255,255,255));
HTREEITEM hItem = m_nTree.InsertItem( "Root", 0,2,TVI_ROOT );
m_nTree.SelectItem (hItem);
m_nTree.SetImageList(&m_ImageList, TVSIL_NORMAL);
m_nTree.SetItemState(hItem, TVIS_BOLD, TVIS_BOLD );
//sets the background color
m_nTree.SetTextColor(RGB(0, 0, 0));
m_nTree.SetBkColor(RGB(255, 255, 255));
……………………………….
………………………………..
}
If I try to move the dialog I keep getting this error:
Debug assertion failed.
And it points to ASSERT(m_hImageList == NULL); in the winctrl2.cpp.
It has something to do with the line m_ImageList.Create(IDB_BITMAP1, 13, 12, RGB(255,255,255));
Please advise. I’m really frustrated with this error.
Binayak
|
|
|
|
|
hi,
i'm programming an opengl program using visual studio .net. my project uses standard windows library(no mfc or atl). when i try to set a break point on a variable or a function, i keep on getting the error message "intellisense couldn't not find the specific location". does anyone know how to set the break point properly?
also, what file do i need to include in my project in order to use the "TRACE" function? is there a way to redirect printf's output to visual stuio .net's "output" panel/window?
thanx in advance.
|
|
|
|
|
Hello,
I Created a dialog which allows a user to select directories. I now have to code the tree control in which the directories appear. Is there a simple way to do this or do I have to handcode it all?
thanks
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
|
Thanks, but thats not excactly what I meant. It's hard to find an example, but I'm looking for one...
I'll describe the tree control in detail:
It contains the directories like the left splitter of the explorer.
It has check boxes so you can select directories,...
If I can get my hand on a picture or something, I'll post it.
thanks in advance.
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Hi,
I would like to know how to maximize the window of a SDI project upon the excution of it..
Ehsan Behboudi
|
|
|
|
|
Hello,
Add the WS_MAXIMIZE to the window style! If you are using MFC you should modify the CREATESTRUCT in the PreCreateWindow() function.
hope this helps
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
In your app's OnInitInstance() , call ShowWindow(SW_SHOWMAXIMIZED);
|
|
|
|
|
How can i disable to move a window??
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
Have you looked at the WM_GETMINMAXINFO message?
|
|
|
|
|
One solution is to add a handler for WM_SYSCOMMAND. Ignore SC_MOVE.
if (WM_SYSCOMMAND == message && SC_MOVE == (wParam & 0xFFF0))
return 0;
Kuphryn
|
|
|
|
|
thanks that worked pretty good
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
[^]
|
|
|
|
|
We have an MDI app where each MDI window has toolbars of its own (ie. there are multiple docking toolbars on the main frame wnd and at least one fixed position toolbar on the MDI child wnds). And all of the buttons, on all of the toolbars, have tooltips.
but...
When you start the program, the only tooltips that will show are those that belong to toolbars on the main frame wnd. The only way to make tooltips start working on the child wnds is to move the mouse over a separator on the child wnd toolbars first. After you do this, tooltips work fine for everything. Clicking buttons doesn't help, moving over enabled/disabled buttons doesn't help; the separator is the key. And, you don't have to hover over it, just a quick fly over on your way to a button will do it.
This is sub-optimal.
Any ideas?
CheeseWeasle
|
|
|
|