Click here to Skip to main content
15,896,201 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Assert failed in wincore Pin
Naveen25-Apr-06 1:50
Naveen25-Apr-06 1:50 
GeneralRe: Assert failed in wincore Pin
sujtha25-Apr-06 2:20
sujtha25-Apr-06 2:20 
QuestionList Control Pin
chybin25-Apr-06 0:31
chybin25-Apr-06 0:31 
AnswerRe: List Control Pin
YaronNir25-Apr-06 0:38
YaronNir25-Apr-06 0:38 
QuestionApplying filter Condition in data grid control in MFC VC++ Pin
Sriram P.S25-Apr-06 0:30
Sriram P.S25-Apr-06 0:30 
Questionhow i can capture the registry key name Pin
kiranin24-Apr-06 23:55
kiranin24-Apr-06 23:55 
AnswerRe: how i can capture the registry key name Pin
YaronNir25-Apr-06 0:03
YaronNir25-Apr-06 0:03 
GeneralRe: how i can capture the registry key name Pin
kiranin25-Apr-06 0:18
kiranin25-Apr-06 0:18 
Hi Yaron,

I 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 below
void
MonitorThread(void* pParam)<br />
{<br />
    //here am not understanding what event it returns<br />
//	RegNotifyChangeKeyValue(hKey1,TRUE,REG_NOTIFY_CHANGE_NAME|<br />
		//	REG_NOTIFY_CHANGE_ATTRIBUTES|REG_NOTIFY_CHANGE_LAST_SET,hEvent1,TRUE);<br />
	DWORD  dwFilter = REG_NOTIFY_CHANGE_LAST_SET, dwType, dwSize ;<br />
    char lpszUser[81];<br />
    HANDLE hEvent;<br />
	HKEY   hKey;<br />
	LONG   lErrorCode;<br />
<br />
	while(1) 	{<br />
		m_Sec.Lock();<br />
		//memset(lpszUser,0,81);<br />
		dwSize = 81;<br />
		dwType = REG_SZ;<br />
<br />
	// Open a key. Change second parameter to fit your needs.<br />
		lErrorCode = RegOpenKeyEx(hKey, NULL, 0,<br />
                                       KEY_NOTIFY | KEY_READ, &hKey);<br />
<br />
		// Create an event.<br />
		hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);<br />
<br />
		// Watch the registry key for a change of value.<br />
		lErrorCode = RegNotifyChangeKeyValue(hKey, TRUE, dwFilter, hEvent,TRUE);<br />
<br />
		// Wait for an event to occur.<br />
		WaitForSingleObject(hEvent, INFINITE);<br />
<br />
		lErrorCode = RegQueryValueEx(hKey,NULL,0,&dwType,(unsigned char*)lpszUser,&dwSize);<br />
		//Add code for reading from the registry key<br />
				<br />
		int item=pList->InsertItem(pList->GetItemCount(),lpszUser);<br />
		// Close the key.<br />
		lErrorCode = RegCloseKey(hKey);<br />
<br />
		m_Sec.Lock();<br />
		// Close the handle.<br />
		CloseHandle(hEvent);<br />
	//	if(m_cStop1==TRUE)<br />
		//	exit(0);<br />
		//Sleep(1); 	<br />
	}<br />
<br />
<br />
	<br />
}



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
Questionphysical memory based Pin
aaaan24-Apr-06 23:40
aaaan24-Apr-06 23:40 
AnswerRe: physical memory based Pin
Nick_Kisialiou25-Apr-06 8:48
Nick_Kisialiou25-Apr-06 8:48 
QuestionResolution of a bitmap in a .bmp file Pin
aasstt24-Apr-06 23:34
aasstt24-Apr-06 23:34 
AnswerRe: Resolution of a bitmap in a .bmp file Pin
YaronNir25-Apr-06 0:01
YaronNir25-Apr-06 0:01 
GeneralRe: Resolution of a bitmap in a .bmp file Pin
aasstt25-Apr-06 0:17
aasstt25-Apr-06 0:17 
AnswerRe: Resolution of a bitmap in a .bmp file Pin
Hamid_RT25-Apr-06 0:18
Hamid_RT25-Apr-06 0:18 
GeneralRe: Resolution of a bitmap in a .bmp file Pin
aasstt25-Apr-06 0:23
aasstt25-Apr-06 0:23 
GeneralRe: Resolution of a bitmap in a .bmp file Pin
Hamid_RT25-Apr-06 0:36
Hamid_RT25-Apr-06 0:36 
GeneralRe: Resolution of a bitmap in a .bmp file Pin
aasstt25-Apr-06 1:18
aasstt25-Apr-06 1:18 
GeneralRe: Resolution of a bitmap in a .bmp file Pin
Hamid_RT25-Apr-06 2:08
Hamid_RT25-Apr-06 2:08 
Questionbitmap Pin
srija24-Apr-06 23:20
srija24-Apr-06 23:20 
AnswerRe: bitmap Pin
voorugonda prashanth24-Apr-06 23:30
voorugonda prashanth24-Apr-06 23:30 
GeneralRe: bitmap Pin
srija24-Apr-06 23:49
srija24-Apr-06 23:49 
GeneralRe: bitmap Pin
voorugonda prashanth25-Apr-06 0:02
voorugonda prashanth25-Apr-06 0:02 
GeneralRe: bitmap Pin
srija25-Apr-06 2:45
srija25-Apr-06 2:45 
QuestionRe: bitmap Pin
Hamid_RT25-Apr-06 0:18
Hamid_RT25-Apr-06 0:18 
QuestionCommand line arguments for my MFC app… Pin
anderslundsgard24-Apr-06 23:13
anderslundsgard24-Apr-06 23:13 

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.