|
When I set the resource properties of the menu item (like I did in my old code, VC++6.0) to Enabled = False, Greyed = True, it can't reach this update because the menu item is disabled - ON_UPDATE_COMMAND_UI() can't be called
I am so confused as to why it worked in old code and not now....
|
|
|
|
|
sorry for the same problem again, but I have one more question regarding this:
Is there a difference in how menu items are handle in Doc/View applications Vs. a Dialog-based app?
The previous example, which worked, was implemented in a Doc/View application. The ON_UPDATED_COMMAND_UI was placed in the view.cpp section of code. here is what worked:
(PrevProgramView.cpp)
BEGIN_MESSAGE_MAP(CPrevProgramView, CView)
ON_COMMAND(ID_FILE_ADJUST, OnFileAdjustTimes)
ON_UPDATE_COMMAND_UI(ID_FILE_ADJUST, OnUpdateFileAdjustTimes)
END_MESSAGE_MAP()
then the function
void CPrevProgramView::OnUpdateFileAdjustTimes(CCmdUI *pCmdUI)
{
if (m_existingFile)
pCmdUI->Enable(TRUE);
else
pCmdUI->Enable(FALSE);
}
and my resource property for ID_FILE_ADJUST is set to: Enabled=False, Greyed=True
In the new piece of code I'm trying to write (Dialog-based app), I have the following:
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
ON_COMMAND(ID_UTILITIES_CONVERT, OnUtilitiesConvert)
ON_UPDATE_COMMAND_UI(ID_UTILITIES_CONVERT, &CMyDlg::OnUpdateUtilitiesConvert)
END_MESSAGE_MAP()
and the new function (that IS called) is
void CMyDlg::OnUpdateUtilitiesConvert(CCmdUI *pCmdUI)
{
CFileStatus cfStat;
CString sProcName;
BOOL bExists = FALSE;
sProcName.LoadStringA(IDS_COORD_CONV);
bExists = CFile::GetStatus(sProcName, cfStat);
pCmdUI->Enable( bExists );
}
with my resource ID_UTILITIES_CONVERT set to Enabled=False, Greyed=True.
NOTE: I even changed my ID_UTILITIES_CONVERT to Enabled=TRUE, Greyed=FALSE, changed pCmdUI->Enable( FALSE ); and set breakpoints - did not change the menu item to disabled
Don't know what is not working 
|
|
|
|
|
john john mackey wrote: Is there a difference in how menu items are handle in Doc/View applications Vs. a Dialog-based app?
I've never added a menu to a dialog-based app.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hey everybody
Okay, I'm stuck on that one for a few month now...
Is there a way to get a clipboard paste event without system-wide hook???
Thanks a lot !!!!
|
|
|
|
|
Green Fuze wrote: Is there a way to get a clipboard paste event without system-wide hook???
I'm not even sure what that means. If you want to capture all WM_PASTE messages in the system then how else would it be done?
Otherwise maybe you are looking for SetClipboardViewer[^]
|
|
|
|
|
led mike wrote: If you want to capture all WM_PASTE messages in the system then how else would it be done?
Well, you may ask to the developers of all your applications (future ones included) to gently notify you when a WM_PASTE is to be issued...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I was starting to think about that solution after a while... 
|
|
|
|
|
Hey,
Thanks for your help!
SetClipboardViewer is not a good solution because it simply tells you what is in the clipboard, and when it changes (copy/cut), but it doesn't tell you when an application pastes from the clipboard.
Besides that, WM_PASTE is not being used much nowadays (from what I checked a little bit), and it is not a complete solution, and it also requires a system-wide hook.
I was hoping to find something list "FindFirstPrinterChangeNotification()", but for paste, or some service that I can register to in order to receive notifications.
Thanks again!!!
|
|
|
|
|
Green Fuze wrote:
Is there a way to get a clipboard paste event without system-wide hook???
Are you wanting to know when the user pastes into any application? Have you seen the discussion here?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Thanks a lot for your help!!!
DavidCrow wrote: Are you wanting to know when the user pastes into any application?
Yup!
DavidCrow wrote: Have you seen the discussion here?
I read this post, and it talks about system-wide hook.
I know how to do it using system-wide hook, and replacing the GetClipboardData() function to get notification, but it looks a bit of an overkill (unless there is no choice...!).
I was hoping to find something like FindFirstPrinterChangeNotification(), or a service I can register to get notifications...
Thanks again!!!
|
|
|
|
|
Hello Green, were You able to detect paste events, would You please post your code?
|
|
|
|
|
Hello All
is there any API to show how strong is password for respective user .in vc++
|
|
|
|
|
Do you mean the strength of the password they have just entered, or the strength of password required by their account settings?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Many varieties exist. One example is here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Hello All .
Can you please tell me how to di firewall rule in xp.
|
|
|
|
|
Look here[^]
[edit] Sorry - didn't notice your constraint that it should be under XP, not Vista. [/edit]
[edit2]There is the Windows Firewall API[^], though - that's accessible in XP SP2 and above... That let's you list the authorized applications and open ports, which are the closest you get to rules with the XP firewall.[/edit2]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hello frnd i write this under XP, not Vista. because inetfwpolicy2.rule you can get fw rules but it is only for vista
|
|
|
|
|
Read the edited message[^] - I give you a link to a Firewall API that is claimed to work in XP...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your reply ,
But I am unable to find proper way ,like IFwPolicy2 is support only in vista .
|
|
|
|
|
Hello, I'd like to invite developers to new open source project - caching proxy server.
We'll use C++, STL, Boost.
It's very interesting and hard project.
If you're interested, please, send me e-mail with short description about your skills or CV to denrrr@gmail.com
Any comments are welcome
Thank you,
Denis
|
|
|
|
|
denrrr wrote: send me e-mail with short description about your skills
My skill is recognizing this is not the right forum to post your open-source project advertising.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Would you like to take part?
|
|
|
|
|
I see we're expressing ourselves with different languages...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yes, you're right. I understand your message, but anyway, I mean, maybe you're interesting 
|
|
|
|
|
denrrr wrote: I mean, maybe you're interesting
Well I know I'm interesting: are you a blonde princess?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|