Click here to Skip to main content
15,909,440 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCopyFile slow over network Pin
jayart25-Apr-06 1:55
jayart25-Apr-06 1:55 
AnswerRe: CopyFile slow over network Pin
YaronNir25-Apr-06 2:04
YaronNir25-Apr-06 2:04 
GeneralRe: CopyFile slow over network Pin
jayart25-Apr-06 2:30
jayart25-Apr-06 2:30 
QuestionAdding .gif as resource. Pin
pc_dev25-Apr-06 1:42
pc_dev25-Apr-06 1:42 
AnswerRe: Adding .gif as resource. Pin
YaronNir25-Apr-06 2:01
YaronNir25-Apr-06 2:01 
GeneralRe: Adding .gif as resource. Pin
pc_dev25-Apr-06 2:24
pc_dev25-Apr-06 2:24 
GeneralRe: Adding .gif as resource. Pin
YaronNir25-Apr-06 2:32
YaronNir25-Apr-06 2:32 
Questionhow to capture the registry keynames after notifying the changes Pin
kiranin25-Apr-06 1:42
kiranin25-Apr-06 1:42 
want to monitor the changes in the registry,By selecting on of the Root key then monitor the changes in that inlcude key,subkeys.....for name,value and status.
i Add the code in the thread function for monitoring as belowvoid MonitorThread(void* pParam)
{
//here am not understanding what event it returns
// RegNotifyChangeKeyValue(hKey1,TRUE,REG_NOTIFY_CHANGE_NAME|
// REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET,hEvent1,TRUE);
DWORD dwFilter = REG_NOTIFY_CHANGE_LAST_SET, dwType, dwSize ;
char lpszUser[81];
HANDLE hEvent;
HKEY hKey;
LONG lErrorCode;

while(1) {
m_Sec.Lock();
//memset(lpszUser,0,81);
dwSize = 81;
dwType = REG_SZ;

// Open a key. Change second parameter to fit your needs.
lErrorCode = RegOpenKeyEx(hKey, NULL, 0,
KEY_NOTIFY | KEY_READ, &hKey);

// Create an event.
hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);

// Watch the registry key for a change of value.
lErrorCode = RegNotifyChangeKeyValue(hKey, TRUE, dwFilter, hEvent,TRUE);

// Wait for an event to occur.
WaitForSingleObject(hEvent, INFINITE);

lErrorCode = RegQueryValueEx(hKey,NULL,0,&dwType,(unsigned char*)lpszUser,&dwSize);
//Add code for reading from the registry key

int item=pList->InsertItem(pList->GetItemCount(),lpszUser);
// Close the key.
lErrorCode = RegCloseKey(hKey);

m_Sec.Lock();
// Close the handle.
CloseHandle(hEvent);
// if(m_cStop1==TRUE)
// exit(0);
//Sleep(1);
}



}


For reading root key i put one combo box in the dialog and selecting one root key by pressing start button starts the monitoring ,if any changes occurs in the that rootkey registry display that key name,value ans status(create/modify/delete).
by pressing stop button stops the monitoring

Thanks,
Kiran.V


AnswerRe: how to capture the registry keynames after notifying the changes Pin
David Crow25-Apr-06 4:30
David Crow25-Apr-06 4:30 
QuestionListctrl problem Pin
Sandeep A.C25-Apr-06 1:42
Sandeep A.C25-Apr-06 1:42 
AnswerRe: Listctrl problem Pin
YaronNir25-Apr-06 2:02
YaronNir25-Apr-06 2:02 
Questioncheck for Invalid Mail ID Pin
QuickDeveloper25-Apr-06 1:30
QuickDeveloper25-Apr-06 1:30 
AnswerRe: check for Invalid Mail ID Pin
Ganesh_T25-Apr-06 1:44
Ganesh_T25-Apr-06 1:44 
AnswerRe: check for Invalid Mail ID Pin
Ganesh_T25-Apr-06 1:45
Ganesh_T25-Apr-06 1:45 
Questionformat the value of Spin & Edit? Pin
zeus_master25-Apr-06 1:26
zeus_master25-Apr-06 1:26 
AnswerRe: format the value of Spin & Edit? Pin
Cedric Moonen25-Apr-06 1:47
Cedric Moonen25-Apr-06 1:47 
GeneralRe: format the value of Spin & Edit? Pin
Naveen25-Apr-06 1:54
Naveen25-Apr-06 1:54 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 4:18
zeus_master25-Apr-06 4:18 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 4:26
zeus_master25-Apr-06 4:26 
AnswerRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 4:41
David Crow25-Apr-06 4:41 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 5:00
zeus_master25-Apr-06 5:00 
GeneralRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 5:11
David Crow25-Apr-06 5:11 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 6:20
zeus_master25-Apr-06 6:20 
GeneralRe: format the value of Spin & Edit? Pin
David Crow25-Apr-06 6:30
David Crow25-Apr-06 6:30 
GeneralRe: format the value of Spin & Edit? Pin
zeus_master25-Apr-06 15:33
zeus_master25-Apr-06 15:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.