|
I believe one difference is that an overlapped window has a frame is can be resized.
Kuphryn
|
|
|
|
|
No, you can set resizable border also on the popup window, t tried that
rrrado
|
|
|
|
|
Hi all,
I am trying to get a bit of assistance as to the best method of of using data stored in my database, as the means of populating a CTreeCtrl. I have currently included the CTreeCtrl in my project, and now I want to be able to populate individual nodes, with the information stored in my database. Any assistance appreicated.
Regards
|
|
|
|
|
Assuming that you have something like a recordset, whenever you iterate thru the recordset you could add items to the Tree using the InsertItem() method . Also in one of my projects I needed to record changes made to the CtreeCtrl for which I had a structure array .
|
|
|
|
|
Thanks! simple answers are usually the best!!
Regards;)
|
|
|
|
|
I have the following problem in my MDI App.
If my MDIChildView is not maximized I remove the menu of my MDIFrame (SetMenu(NULL)). Then I maximize my view and I set my frame menu to the original menu (SetMenu(pOrgMenu)). The menu appears, but the control menu (maximize, minimize, close button) of my child view don't appear in the menu bar, as it should do.
The only possibility that I have is to call
MDIRestore()
MDIMaximize()
of my child window. But this results in an ugly window flash.
I have already tried all things I know about MDI frames and child views, but non of that worked.
Has anyone an idea, how I can solve this problem?
Thanks in advance
|
|
|
|
|
I never tried to set and remove menus that way, so I won't be able to directly help you.
I've implemented once the maximizing of a view of an MDI application this way
CMyView::Maximize()
{
// maximize window
GetParent()->ShowWindow(SW_MAXIMIZE);
}
The parent of the view is the ChildFrame, it's the one which is resized. The resizing of the contained view is done by the Child frame (CChildFrame::OnSize or CChildFrame::OnExitSizeMove).
HTH,
Ohé Partisans, Ouvriers et Paysans
C'est l'alarme!
Le Chant des Partisans
|
|
|
|
|
Thanks for the reply, but unfortunately that's not exactly what I need.
To be clear: I remove NOT the control menu of my view, but the applications main menu.
If you maximize a view, the control menu of the view will be displayed in the main menu bar of the applications main frame.
If I switch the main menu off and then maximize my view, the control menu of the view is not visible, because the main menu in which the control menu should be displayed is not visible. That's correct. But if I switch the main menu back on, the views control menu is not displayed. I can only solve this if I restore and maximize the view, which causes an ugly flash of my view.
|
|
|
|
|
I would try to solve this in another way:
Draw these buttons (minimze,resize,close) by yourself in the menu bar.
Remember what view is currently maximixed. And send the message
WM_CLOSE,
.
.
to the current view by yourself.
I know this method requires some work but this way you will surely succeed.
Yours,
Alois Kraus
|
|
|
|
|
CodeBrain wrote:
To be clear: I remove NOT the control menu of my view, but the applications main menu
I suppose you do this to have the biggest display area, don't you ?
CodeBrain wrote:
But if I switch the main menu back on
I suppose you work with handles, because CMenu pointers might not be valid anymore when re-setting the menu.
I tried to do a small testing application, and a priori , it works fine (the trick is to restore the active view ). I sent it to you, say me if it's what you're looking for.
Ohé Partisans, Ouvriers et Paysans
C'est l'alarme!
Le Chant des Partisans
|
|
|
|
|
KaЯl wrote:
To be clear: I remove NOT the control menu of my view, but the applications main menu
I suppose you do this to have the biggest display area, don't you ?
Yes, that's true, I want to have the maximum view size.
KaЯl wrote:
CodeBrain wrote:
But if I switch the main menu back on
I suppose you work with handles, because CMenu pointers might not be valid anymore when re-setting the menu.
I tried to do a small testing application, and a priori , it works fine (the trick is to restore the active view ). I sent it to you, say me if it's what you're looking for.
Thank you very much for your effort.
Yes, you may be right with that menu pointer. If I use your test app. it seems to work.
If I remove pActiveFrame->ShowWindow(SW_RESTORE); from your code, it has the behavior I need.
So the method how I handle the old menu seems to be the problem. I will try to change my managing of the menus to make it work.
Thanks again for your work.
Marc
|
|
|
|
|
My pleasure, and welcome on CP
By the way, never ever post programming question in the Lounge, you would loose some teeth in the battle
Ohé Partisans, Ouvriers et Paysans
C'est l'alarme!
Le Chant des Partisans
|
|
|
|
|
KaЯl wrote:
By the way, never ever post programming question in the Lounge, you would loose some teeth in the battle
Yes, sorry. I thought I was in the right forum (Visual C++), but after some back and forward action in my browser I have first posted in the lounge. But I have deleted it at once. So I hope I will keep my teeth till I am old
|
|
|
|
|
Hi,
An hour ago or so I was hit by the lightning when I realized that I hadn't a clue on how MS implemented the set of GetSafe... functions.
I can not find their implemntations in the MFC sources. Where can I find them, or, better, could someone please explain to me how a member function can be called for NULL object without wreaking havoc?
Thanks!
Don't _think_ you are, _know_ you are! (Morpheus in The Matrix)
|
|
|
|
|
As long as the method isn't virtual, there is no problem with calling a member function where "this" is NULL. At no time is "this" ever dereferenced during the call process. So as long as you check for "this == NULL" in the member function, things will work just fine.
return this ? m_hWnd : NULL;
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Thanks,
It's so much fun to learn new details on C++.
I've always (up until now) checked for NULL _before_ calling a member function for an object that may be NULL. Now I have my very own GetSafe... functions
But, the nitpicker in me still wants to know where these MFC functions are implemented. Have I failed to install _all_ MFC sources (is that even possible?) perhaps...
|
|
|
|
|
_AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const
{ return this == NULL ? NULL : m_hWnd; }
in MFC\Include\AFXWIN2.INL
Yours,
Alois Kraus
|
|
|
|
|
Hi,
I'm having big problems trying to scroll a listbox in code. I can set the scrollbar ok, but I can't figure out how to scroll the text properly.
Can anybody suggest how i can instruct a CListBox to scroll by a given amount, and have the listbox take care of updating both the scrollbar and the client area (i.e. have it scroll the text correctly). Clearly CListBox knows how to do this, because if i just grab the scrollbar of a standard CListBox, it works. So how do i ask it to do this for me. Effectively, i want to 'emulate' having dragged the scrollbar.
Thanks
Jase
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
View your digital photos and images with ease using the ultimate desktop image manager for Microsoft Windows
Download your free copy of SlideShow Desktop today from http://www.slideshowdesktop.com
|
|
|
|
|
Have a look at LB_SETTOPINDEX / CListBox::SetTopIndex. These should help you.
Or you could simply send the listbox WM_VSCROLL messages.
Iain Clarke.
|
|
|
|
|
Sir, my computer is running under the proxy server. I want to developed application which is able to make http GET and POST request to a specified server.
C.R.Naik
|
|
|
|
|
Send GET/POST as usually, instead that you will connect your socket to proxy server instead of HTTP server. Headers will remail the same, in simple case (no proxy authorization ...)
rrrado
|
|
|
|
|
good behavior is also to send the complete url of the request, which is not necessary when using direct connection. Instead of
<br />
GET /index.htm HTTP/1.1<br />
Header: Value<br />
which is allowed for direct connecting, you should use the full syntax:
<br />
GET http:
Header: Value<br />
from this the proxy will be able to know, where you want to connect
|
|
|
|
|
I have modeless dialog windiw created in separate thread. Clicking to minimize button cause shrinking this window to size of title bar and it moves to bottom left corner of rhe desktop. How to minimize this window to task bar ? And show this window in task list so i could switch to this window by Alt+Tab ?
Thank you
rrrado
|
|
|
|
|
It sounds like you are using the WS_EX_TOOLWINDOW style.
What you will need to do is remove the WS_EX_TOOLWINDOW style in the SC_MINIMIZE portion of the WM_SYSCOMMAND message handler, and restore this style setting when the SC_RESTORE event is received in the WM_SYSCOMMAND handler.
The toolwindow prevents your windows from appearing in the Taskbar, however it also makes your windows minimize to the desktop like you have described.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I'm not using WS_EX_TOOLWINDOW style. It is ordinal dialog box window, i tried popup and also overlapped type, without any extended styles set in resource editor.
rrrado
|
|
|
|