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:
then the functionvoid CPrevProgramView::OnUpdateFileAdjustTimes(CCmdUI *pCmdUI)
and my resource property for ID_FILE_ADJUST isset to: Enabled=False, Greyed=True
In the new piece of code I'm trying to write (Dialog-based app), I have the following:
and the new function (that IS called) isvoid CMyDlg::OnUpdateUtilitiesConvert(CCmdUI *pCmdUI)
BOOL bExists = FALSE;
// Get the status of this file - exists or not
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
Are you wanting to know when the user pastes into any application?
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...
 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