Click here to Skip to main content
15,923,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Word 2003 Pin
Steve S22-Apr-04 1:51
Steve S22-Apr-04 1:51 
GeneralRe: RECT functions Pin
Balkrishna Talele20-Apr-04 22:43
Balkrishna Talele20-Apr-04 22:43 
GeneralRe: RECT functions Pin
jmkhael20-Apr-04 22:44
jmkhael20-Apr-04 22:44 
GeneralRe: RECT functions Pin
Balkrishna Talele20-Apr-04 22:50
Balkrishna Talele20-Apr-04 22:50 
GeneralRe: RECT functions Pin
jmkhael20-Apr-04 22:52
jmkhael20-Apr-04 22:52 
Questionhow do I determine what apps exist on my machine? Pin
wxl5120-Apr-04 22:28
wxl5120-Apr-04 22:28 
AnswerRe: how do I determine what apps exist on my machine? Pin
GermanGeorge20-Apr-04 22:45
GermanGeorge20-Apr-04 22:45 
AnswerRe: how do I determine what apps exist on my machine? Pin
Rob Caldecott21-Apr-04 2:13
Rob Caldecott21-Apr-04 2:13 
I am going to add a small article on how to do this, but the following code fills an MFC CStringList with the installed programs:

<br />
#define	AUDIT_KEY	_T("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall")<br />
#define	AUDIT_KEY_LEN	256<br />
#define AUDIT_DISPLAY	_T("DisplayName")<br />
<br />
// Build a list of installed applications by enumerating<br />
	//	HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall<br />
	//	and fetching "DisplayName" entry<br />
<br />
	HKEY hKey;<br />
	if (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, AUDIT_KEY, 0, KEY_READ, &hKey) != ERROR_SUCCESS)<br />
		return;<br />
<br />
	// List of strings<br />
	CStringList list;<br />
<br />
	DWORD dwIndex = 0;<br />
	LONG lRet;<br />
	DWORD cbName = AUDIT_KEY_LEN;<br />
	TCHAR szSubKeyName[AUDIT_KEY_LEN];<br />
	<br />
	while ((lRet = ::RegEnumKeyEx(hKey, dwIndex, szSubKeyName, &cbName, NULL,<br />
		NULL, NULL, NULL)) != ERROR_NO_MORE_ITEMS)<br />
	{<br />
		// Do we have a key to open?<br />
		if (lRet == ERROR_SUCCESS)<br />
		{<br />
			// Open the key and get the value<br />
			HKEY hItem;<br />
			if (::RegOpenKeyEx(hKey, szSubKeyName, 0, KEY_READ, &hItem) != ERROR_SUCCESS)<br />
				continue;<br />
			// Opened - look for "DisplayName"<br />
			TCHAR szDisplayName[AUDIT_KEY_LEN];<br />
			DWORD dwSize = sizeof(szDisplayName);<br />
			DWORD dwType;<br />
<br />
			if (::RegQueryValueEx(hItem, AUDIT_DISPLAY, NULL, &dwType,<br />
				(LPBYTE)&szDisplayName, &dwSize) == ERROR_SUCCESS)<br />
			{<br />
				// Add to the list<br />
				list.AddTail(szDisplayName);<br />
			}<br />
			::RegCloseKey(hItem);<br />
		}<br />
		dwIndex++;<br />
		cbName = AUDIT_KEY_LEN;<br />
	}<br />
	::RegCloseKey(hKey);<br />



The Rob Blog
GeneralRECT functions Pin
El'Cachubrey20-Apr-04 22:25
El'Cachubrey20-Apr-04 22:25 
GeneralRe: RECT functions Pin
jmkhael20-Apr-04 22:38
jmkhael20-Apr-04 22:38 
QuestionHow to catch the MINIMIZE event for CDialog Pin
anderslundsgard20-Apr-04 22:20
anderslundsgard20-Apr-04 22:20 
AnswerRe: How to catch the MINIMIZE event for CDialog Pin
Adi Narayana20-Apr-04 23:01
Adi Narayana20-Apr-04 23:01 
GeneralIntegrating VC with Flash MX Pin
ykutanoor20-Apr-04 21:13
ykutanoor20-Apr-04 21:13 
GeneralCWnd Object Pin
Coremn20-Apr-04 20:53
Coremn20-Apr-04 20:53 
GeneralRe: CWnd Object Pin
MrCyber20-Apr-04 21:10
MrCyber20-Apr-04 21:10 
GeneralRe: CWnd Object Pin
Maxwell Chen20-Apr-04 21:14
Maxwell Chen20-Apr-04 21:14 
GeneralRe: CWnd Object Pin
Coremn20-Apr-04 21:24
Coremn20-Apr-04 21:24 
GeneralWhere can I get/download DBG files for MS VS 7, C++ Pin
MrCyber20-Apr-04 20:41
MrCyber20-Apr-04 20:41 
GeneralRe: Where can I get/download DBG files for MS VS 7, C++ Pin
Mike Dimmick21-Apr-04 0:43
Mike Dimmick21-Apr-04 0:43 
GeneralRe: Where can I get/download DBG files for MS VS 7, C++ Pin
MrCyber21-Apr-04 1:36
MrCyber21-Apr-04 1:36 
GeneralTimer Pin
Anonymous20-Apr-04 20:33
Anonymous20-Apr-04 20:33 
GeneralRe: Timer Pin
Balkrishna Talele21-Apr-04 0:15
Balkrishna Talele21-Apr-04 0:15 
GeneralSilly question about std namespace Pin
Jerome Conus20-Apr-04 20:15
Jerome Conus20-Apr-04 20:15 
GeneralRe: Silly question about std namespace Pin
Maxwell Chen20-Apr-04 20:23
Maxwell Chen20-Apr-04 20:23 
GeneralRe: Silly question about std namespace Pin
Jerome Conus20-Apr-04 20:34
Jerome Conus20-Apr-04 20:34 

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.