|
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
|
|
|
|
|
Could you view your windows styles in Spy++ and let me know which styles both regular and EX that your window is using? That would help me figure out whats causing your problems.
Thanks
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!
|
|
|
|
|
Dialog style :
14CF0044 (WS_OVERLAPPEDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_OVERLAPPED|DS_3DLOOK|DS_SETFONT)
EXTENDED STYLES :
00010100 (WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|WS_EX_WINDOWEDGE|WS_EX_CONTROLPARENT)
Parent window : NONE ( created with NULL parent window)
Thank you.
PS
I create more ot this modeless dialog windows, each in separate UI-thread. Another bug is that sometimes more of them are dreawn with active title bar, like when all of them would have focus set. So after creating of dialog i set focus for it, but it still happens rarely.
Thank you
rrrado
|
|
|
|
|
It looks like if you add the WS_EX_APPWINDOW style you will be all set!
Good Luck
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 tried to set WS_EX_APPWINDOW style, now it is in task bar next to main window, but windows is not able to switch to main window, it always switch to my dialog even if i click to main window in task bar
I will perhaps write my own window switching wihtin my application with ctrl-tab.
Thank you very much
rrrado
|
|
|
|
|
Hi,
how to disable Close button in titlebar of Popup window with minimize and maximize button enabled ?
Thanks
rrrado
|
|
|
|
|
In MFC:
CMenu* mnu = this->GetSystemMenu(FALSE);
mnu->ModifyMenu(SC_CLOSE, MF_BYCOMMAND ,MF_GRAYED);
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Thank you !
rrrado
|
|
|
|