|
i don´t think i understand it, but i tried this:
EnableMenuItem(::LoadMenu(IDR_MENU1), ID_EXTRAS_SERVICE, MF_GRAYED);
but it do not work? do you mean something different? can you give me an example?
thanks
sunny
|
|
|
|
|
You probably did the loading of the menu from resources somewhere before.
You said you are using MFC, so you will have a variable of type CMenu somewhere, which represents your IDR_MENU1, right?
Like this:
...
CMenu menuOne;
menuOne.LoadMenu(IDR_MENU1);
... Then you would write:
BOOL e = ::EnableMenuItem( menuOne.m_hmenu, ID_EXTRAS_SERVICE, MF_GRAYED);
And then you can see in the MSDN-entry for EnableMenuItem, that the 3rd parameter in your code is not correct:
MSDN: "This parameter must be a combination of either MF_BYCOMMAND or MF_BYPOSITION and MF_ENABLED, MF_DISABLED, or MF_GRAYED"
So, you have to add either MF_BYCOMMAND or MF_BYPOSITION to it.
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
oooohhhhhhhhhhhhh.....i know what you mean.
but my problem is, i have NO CMENU objekt.
i make this:
HMENU menu;<br />
menu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MENU1));<br />
::SetMenu(*(AfxGetApp()->m_pMainWnd), menu);
what can i do now?
thanks a lot
sunny
|
|
|
|
|
Sunnygirl wrote:
HMENU menu;
menu = LoadMenu(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDR_MENU1));
::SetMenu(*(AfxGetApp()->m_pMainWnd), menu); And adding a line
BOOL e = ::EnableMenuItem(menu, ) at the bottom does not work?
Does it compile?
Your HMENU is valid?
You corrected the flags like MSDN shows?
--
"My opinions may have changed, but not the fact that I am right."
Found in the sig of Herbert Kaminski
|
|
|
|
|
I don't know if this is what you want, it is a cut/paste from one of my progs but try:-
CWnd* pMain = AfxGetMainWnd();
// Get the main window's menu
CMenu* pMenu = pMain->GetMenu();
CMenu* pSubMenu = NULL;
// Now get a handle to the pop up menu, the 1st one e.g. File
pSubMenu = pMenu->GetSubMenu(0);
pSubMenu->EnableMenuItem(ID_FILE_TRANSFER, MF_GRAYED);
|
|
|
|
|
Oooops typo, last line should be:-
pSubMenu->EnableMenuItem(ID_FILE_TRANSFER, MF_GRAYED | MF_BYCOMMAND);
|
|
|
|
|
I have a parent dialog and some child dialogs in it. The parent dialog have bitmap background. So I want its child dialogs to be transparent? How can I do that? (Same as PropertySheet with Wizard Mode and PSH_WATERMAKE flags)
(I have only return TRUE on OnEraseBkgnd(), the child dialogs has been transparent, but static controls on child dialog are still not transparent... )
Thanks for any help!
|
|
|
|
|
Maybe thisLink[^] can help you.
~RaGE();
|
|
|
|
|
|
Thanks for your help. But the background of these static controls (on child dialg) is different from the background of the parent dialog because I has used a bitmap background, not a solid background.
|
|
|
|
|
Hi !
Is there any way to set/remove the virus protection popup window of excel programatically ? Not that I would like to write a virus , but my program needs to work on PC where this option is set and has to keep set at the end of the automation.
Any idea ?
~RaGE();
|
|
|
|
|
|
Thanks, but it does not help much
~RaGE();
|
|
|
|
|
Don't think it's what your after, but if you create a new class (well, a few really) from the excel.exe (Excel 2002) type library using the class wizard, it does generate a 'Protection' class (as well as 200+ others). You might find what your after in there, or one of the other generated classes)
I'm struggling to use the classes generated at the moment, if I come across anything I think might help you I'll post it here.
Dylan
"In meetings, the person who is least competent usually does the most talking. Talking is a direct substitute for competence, at least in the minds of other people. Five minutes after you leave a meeting, you won't remember what anyone said but you will remember who did most of the talking. Withing a day your mind will translate that into a notion that the talker was unusually knowledgeable" - Scott Adams, Dilbert and the way of the weasel
|
|
|
|
|
Hi folks,
I want to know if anybody can help me about adding an overview (small view)
to a new type of file that I create , in windows file explorer.
I want to implement my own overview.
thanks Michael
|
|
|
|
|
I think Michael Dunn's Shell Extensions[^] series might help.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
The tutorials of Michael Dunn are to add a small View in the popup menu.
I want to add a small view on the left of the file list if you select web view
mode in the windows file explorer.
|
|
|
|
|
I know. Just pointing the general direction. I think that IExtractImage[^] might be the one.
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Ok nice,
But i need shobjidl.hto use that interface do you know where I can find it?
Thanks a lot Michael
|
|
|
|
|
Platform SDK, Core SDK. You'll need to download from MS. Click here[^]
I don't think this is a serious possesion, and the evil most likely comes from your hand. Colin J Davies, The Lounge
|
|
|
|
|
Hi,
I want to catch WM_SETFONT messages in a CEdit control.
Unfortunately the class wizard doesn't offer me this message. Is there any reason? If not, how does my handler look like? hm there is no default handler CEdit::OnSetFont(). please help.
|
|
|
|
|
If you right-click your class and select "Add window message handler" and from there change the type of filtering in the bottom right to "Window", I think you will have access to the option you need.
I can't check as class wizard is bust on my PC at the moment.
Roger Allen
Sonork 100.10016
In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. - Roger Allen, but not me!
|
|
|
|
|
thanks, but WM_SETFONT is still *not* listed. I tried all options
|
|
|
|
|
How can I specify the size of a CView when it is created?
<br />
void COragomy_IIView::OnDraw(CDC* pDC)<br />
{<br />
COragomy_IIDoc* pDoc = GetDocument();<br />
ASSERT_VALID(pDoc);<br />
<br />
CRect rect = new CRect( 0, 0, 320, 200 );<br />
pDoc->m_clientRect = rect;<br />
That doesn't seem to work.
...
|
|
|
|
|
How to Connect to ODBC (SQL SERVER 2000)
through ADO
which provider should be used
|
|
|
|