|
|
No. Adding manifest is not the solution. I think its the process properties that one should look into.
|
|
|
|
|
When I use the following method to disable menu items, only popup ones can be disabled, the top-level menus and other sub-menus seems to do nothing!
<br />
CMenu* menu = CMenu::FromHandle(m_wndMenuBar.GetDefaultMenu());<br />
menu->GetSubMenu(1)->EnableMenuItem(1, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);<br />
This method is OK with CMenu in VS 2005.
Thanks for the helps!
|
|
|
|
|
Perhaps this may give you a clue - I've used this many times to disable a top-level menu:
if (pCmdUI->m_pSubMenu != NULL)
{
pCmdUI->m_pMenu->EnableMenuItem(pCmdUI->m_nIndex, MF_BYPOSITION |
(bShowMenuItems ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
}
This code is in the UpdateCmdUI handler for the menu, so it takes care of getting the CMenu that I'm concerned with - you'll need to modify it for your needs.
Hope this helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thank you so much, but I still failed in disable top-level menus just like File, Edit, etc.
I tried by add UPDATE_COMMAND_UI to a menu item, pCmdUI->SetRadio & pCmdUI->SetCheck turn out to be success, but pCmdUI->EnableMenuItem or pCmdUI->Enable still work in vain.
pCmdUI->EnableMenuItem do work well with menu items that have submenu.
So I will be appreciated if you can tell me something more about your trick, especially that how can I disable all top-level menu items by using one cCmdUI.
Thanks a lot!
|
|
|
|
|
I need functions to get following directories - except SHGetSpecialFolderPath() or SHGetFolderPath(), because they don't work well on win98 and win2k.
typical directories are:
1. C:\Documents and Settings\All Users\Start Menu\Programs
2. C:\Documents and Settings\All Users\Desktop
3. C:\Program Files
|
|
|
|
|
Quit spamming the board. You have precisely the same post three threads before this. Do you really think someone is going to respond to this, who didn't respond to the first one?
All you manage to accomplish with this is to irritate anyone who might have been willing to help you.
|
|
|
|
|
Please Calm Down,
LunaticFringe wrote: You have precisely the same post three threads before this (underline by bvk)
It is technically a subtly different question.
I agree, it would have been better dealt with in the previous thread, but, then again...
To Err is Human, to forgive is devine.
Regards,
Bram van Kampen
|
|
|
|
|
Bram van Kampen wrote: but, then again...
To Err is Human, to forgive is devine.
Given that the OP does this sort of thing regularly, LunaticFringe's response was not inappropriate.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I refer you to my previous answer to this question - which is still on the first page of the forum.
OK, I've now looked, and your previous question did not mention SHGetFolderPath.
But you never replied to my answer, which is a) rude, b) making me unbothered to help you, and c) not helpful to anybody else who might still care about you.
Did you try my advice? Did it fail?
Iain.
edited again:
I've relooked at you as a member, and remember previous threads like this. You're able to write good articles, so you're far from an idiot. I didn't enjoy "spot the difference" competitions when I was young, so all that posting 99% identical questions, instead of following up on previous helpers does is antagonise the very people you want help from. Please apply the same brain you use to write nice articles to writing better forum posts.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I am creating a popup window which slides from the taskbar region. I created a dialog class and attached it into my dialog window. Please tell me which function should i override to put the AnimateWindow, so that when I call DoModal() Dialog will have the slide effect.
Thanks in advance.
Regards,
J.
|
|
|
|
|
|
I have created a simple dialog box using visual studio's form editor, and am creating the dailog like so:
DialogBox(NULL, MAKEINTRESOURCE(IDD_IMGPROPS), hWnd, reinterpret_cast<DLGPROC>(dlgImgPropsProc));
The dialog procedure looks like this:
LRESULT CALLBACK dlgImgPropsProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_INITDIALOG:
SendMessage(GetDlgItem(hWnd, IDC_IMGPROPS_SPINW), UDM_SETBUDDY, (WPARAM)GetDlgItem(hWnd, IDC_IMGPROPS_WIDTH), 0);
SendMessage(GetDlgItem(hWnd, IDC_IMGPROPS_SPINH), UDM_SETBUDDY, (WPARAM)GetDlgItem(hWnd, IDC_IMGPROPS_HEIGHT), 0);
return TRUE;
case WM_CLOSE:
EndDialog(hWnd, 0);
return TRUE;
case WM_COMMAND:
switch(wParam)
{
case IDC_IMGPROPS_OK:
EndDialog(hWnd, 0);
return TRUE;
}
break;
default:
return FALSE;
}
return FALSE;
}
Now, the problem is that every time my application hits the call to createDialog(), it hangs... and it seems to be pretty permanent. I've stepped through the dialog procedure and my dialog is recieving the following messages:
48 WM_SETFONT
85 WM_NOTIFYFORMAT
297 WM_QUERYUISTATE
85 WM_NOTIFYFORMAT
297 WM_QUERYUISTATE
272 WM_INITDIALOG
1024 WM_USER
24 WM_SHOWWINDOW
70 WM_WINDOWPOSCHANGING
71 WM_WINDOWPOSCHANGED
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
131 WM_NCCALCSIZE
15 WM_PAINT
133 WM_NCPAINT
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
20 WM_ERASEBKGND
310 WM_CTLCOLORDLG
307 WM_CTLCOLOREDIT
307 WM_CTLCOLOREDIT
312 WM_CTLCOLORSTATIC
307 WM_CTLCOLOREDIT
307 WM_CTLCOLOREDIT
309 WM_CTLCOLORBTN
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
127 WM_GETICON
...
Now, I'm guessing that it just continues on forever there with WM_GETICON. I didn't bother stepping through it any further than that. My question is, what would cause my dialog to continuously recieve the WM_GETICON message, and how can I fix it?
|
|
|
|
|
I've tracked down the problem and found a solution.
In my .rc file I had the following:
IDD_ABOUT DIALOGEX 0, 0, 219, 110
STYLE DS_SYSMODAL | DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
CTEXT "Lorem Ipsum",IDC_STATIC,7,7,205,96
PUSHBUTTON "OK",IDC_ABOUT_OK,84,89,50,14
END
IDD_IMGPROPS DIALOGEX 0, 0, 101, 73
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Image Properties"
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
EDITTEXT IDC_IMGPROPS_WIDTH,35,7,49,14,ES_AUTOHSCROLL | ES_WANTRETURN | ES_NUMBER
CTEXT "Width:\n\n\nHeight:",IDC_STATIC,8,9,27,34
EDITTEXT IDC_IMGPROPS_HEIGHT,35,32,49,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "",IDC_IMGPROPS_SPINW,"msctls_updown32",UDS_ARROWKEYS,84,7,10,14
CONTROL "",IDC_IMGPROPS_SPINH,"msctls_updown32",UDS_ARROWKEYS,84,32,10,14
PUSHBUTTON "OK",IDC_IMGPROPS_OK,25,52,50,14
END
The problem seemed to be the window style of the second dialog box. Replacing it with the same style as the first one solved it.
What then is it, about the combination of the flags DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_CAPTION | WS_SYSMENU that caused my dialog to recieve a constant stream of WM_GETICON messages?
|
|
|
|
|
I need functions to get following directories - except SHGetSpecialFolderPath(), because it doesn't work well on win98 and win2k.
typical directories are:
1. C:\Documents and Settings\All Users\Start Menu\Programs
2. C:\Documents and Settings\All Users\Desktop
3. C:\Program Files
|
|
|
|
|
may be solve your problem
CString sortfile="Add Path";
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_SYSTEM|CSIDL_FLAG_CREATE,
NULL,
0,
szPath)))
{
PathAppend(szPath, sortfile);
}
TCHAR szPathDesk[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_DESKTOP|CSIDL_FLAG_CREATE,
NULL,
0,
szPathDesk)))
{
PathAppend(szPathDesk, sortfile);
}
|
|
|
|
|
You should make sure if they work on win98 before you post your lovely code.
|
|
|
|
|
It's not up to him to test his suggestion on every version of the OS you might be interested in using. That's your job.
You might have told him thanks instead of being a wiseass. I doubt many more will be lining up to help.
|
|
|
|
|
first you test then give response.
|
|
|
|
|
I've looked at the docs for SHGetSpecialFolderPath (just google "msdn SHGetSpecialFolderPath").
I found this near the bottom:
With Microsoft Windows 2000, this function is superseded by ShGetFolderPath. You can use this function on earlier systems by including the redistributable DLL, ShFolder.dll.
So, if you're right, then maybe you could use that redistributable file.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi,
I'm wading trough code dealing with UNC Names and Mapped Drives. It suddenly occurred to me that a DriveSpec of say 'C:\' limits the number of drives to 26. It also occurred to me that Microsoft may not have set anarbitrary maximum of 26 Drives (included Mapped Drives).
What is the limit (if any), and what would be the syntax for drives beyond 26.
I just want to proof things against some future Idiot who's going to phone me in time to come about software failing in obscure ways and who, as it might transpire has say 32 Disks on his system.
Regards
Bram van Kampen
|
|
|
|
|
You can only have 26 drive letters because it is limited by the english language.
But you can have more than 26 volumes using something called as Reparse points .
Reparse point s allows you to create NTFS junction folders where a folder points to a different volume.
So when you're accessing the folder, you're actually accessing the root of another volume.
Sysinternals has a tool to manipulate junctions - Junction v1.05[^]
Read more about NTFS junction points - How to create and manipulate NTFS junction points[^]
|
|
|
|
|
In addition to <superman>'s response, you can attach a drive to an empty NTFS directory on another drive with standard tools.
In Vista... control panel, admin tools, computer management, disk management, right click on a partition and choose drive letters and paths.
I assume something similar in 7, and XP.
Besides, "26 is enough letters for anyone!"
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thanks to Both,
Iain Clarke, Warrior Programmer wrote: Besides, "26 is enough letters for anyone!"
I wholehartedly Agree. It is not that I am looking for more Drive Letters, I just am trying to anticipate what customers in the field 'might' do. In a nutshell, my Software fishes a 'Path' out of the Registry, and must decide whether this path refers to a file on a Local Drive, or to a file somewhere on the Network.
This is all in aid of a larger design which retrieves timestamps from a designated machine on the network.
My initial approach was that if it is a UNC Name, e.g. '//Server1/Data/MyData.Dat', it refers to a File on the Network, UNLESS the Name of this computer is 'Server1'. and, Alternatively, that if it is of the form 'P:\Application Data\...\MyData.Dat' that it refers to a Local File, UNLESS 'P:\' is a Mapped Drive, which we can determine with GetDriveType.
Now, this 'Junction' stuff seems to throw sand in the above machinery. I had never heard of it, cannot imagine I will ever need it, but, Some future customer somewhere someday just might!
And THEN we have suddenly an obscure bug which causes the time stamp to be incorrect on certain machines (Actually it would retrieve the timestamp successfully from but from the wrong machine, and would give 'Time Server Errors' if this machine were switched of, but that might not be clear at the time! So, I want to trap these situations, both during Setup and at Startup.
Now I'm Stuck!
Maybe I should re-phrase the question as Follows:-
'How do I determine whether a path points to a Local File, or a File on the Network'
Thanks,
Bram van Kampen
modified on Saturday, December 5, 2009 8:13 PM
|
|
|
|
|
Bram van Kampen wrote: 'How do I determine whether a path points to a Local File, or a File on the Network'
How about GetDriveType() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|