|
Look up this Registry Key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Nish
|
|
|
|
|
Add/Remove stores the list in the Registry. You can read from the same location to find the apps installed.
On 2000 the path is:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
Deepak Khajuria
|
|
|
|
|
Ok,
Thank's a lot everybody.
But now my other problem is how to find "the start program file" for each entry (i have just the uninstall program in this registry key).
Sorry for my english
|
|
|
|
|
Uninstall branch in the registry doesn't contain filenames of application itself - note that sometimes one uninstall removes more than one .exe.
Depending on your definition of 'installed applications' you should look elsewhere. Maybe you should just scan the start menu?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Could you tell me how scan the start menu ?
Thank's in advance
|
|
|
|
|
if I send an email with a *.jpg attachmen ,the route I must follow ,
1,I open the jpg file in binary mode;
2,I must call CBase64::Encode() to encode the attachment;
3,send the email.
4,when I receive the email,I muse call
CBase64::Decode() to decode the attachment.
what I say is right?
any suggetion?
now where can I get the standard class CBase64?
thank you in advance!
|
|
|
|
|
I did a similar thing to send binary files as attachments in a project of mine. I did it by overriding the CDocument::OnFileSendMail(0 function and adding code to modify what the attachments are etc.
I have included the function here in its entirity, some of the stuff may not be relevant to your problem.
void CRefinementProDoc::OnFileSendMail()
{
ASSERT_VALID(this);
ASSERT(_afxIsMailAvail);
CWaitCursor wait;
_AFX_MAIL_STATE* pMailState = _afxMailState;
if (pMailState->m_hInstMail == NULL)
pMailState->m_hInstMail = ::LoadLibraryA("MAPI32.DLL");
if (pMailState->m_hInstMail == NULL)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_LOAD);
return;
}
ASSERT(pMailState->m_hInstMail != NULL);
ULONG (PASCAL *lpfnSendMail)(ULONG, ULONG, MapiMessage*, FLAGS, ULONG);
(FARPROC&)lpfnSendMail = GetProcAddress(pMailState->m_hInstMail, "MAPISendMail");
if (lpfnSendMail == NULL)
{
AfxMessageBox(AFX_IDP_INVALID_MAPI_DLL);
return;
}
ASSERT(lpfnSendMail != NULL);
TCHAR szTempName[_MAX_PATH];
TCHAR szPath[_MAX_PATH];
BOOL bRemoveTemp = FALSE;
if (m_strPathName.IsEmpty() || IsModified())
{
CString old_filename ;
CString old_path ;
VERIFY(GetTempPath(_countof(szPath), szPath) != 0);
if (DatasetType == TYPE_DATASET)
{
old_filename = pntr->m_Filename ;
old_path = pntr->m_Path ;
sprintf(szTempName, "%s%s", szPath, pntr->m_Filename) ;
}
else
{
old_filename = mpntr->m_Filename ;
old_path = mpntr->m_Path ;
sprintf(szTempName, "%s%s", szPath, mpntr->m_Filename) ;
}
m_sending_as_attachment = TRUE ;
BOOL bModified = IsModified();
BOOL bResult = DoSave(szTempName, FALSE);
SetModifiedFlag(bModified);
if (!bResult)
{
TRACE0("Warning: file save failed during File.Send Mail.\n");
return;
}
bRemoveTemp = TRUE;
m_sending_as_attachment = FALSE ;
if (DatasetType == TYPE_DATASET)
{
pntr->m_Filename = old_filename ;
pntr->m_Path = old_path ;
}
else
{
mpntr->m_Filename = old_filename ;
mpntr->m_Path = old_path ;
}
SetPathName(old_path + "\\" + old_filename, FALSE) ;
}
else
{
lstrcpyn(szTempName, m_strPathName, _countof(szTempName));
}
#ifdef _UNICODE
char szTempNameA[_MAX_PATH];
_wcstombsz(szTempNameA, szTempName, _countof(szTempNameA));
#endif
TCHAR szTitle[_MAX_PATH];
if (!m_strPathName.IsEmpty())
AfxGetFileName(m_strPathName, szTitle, _countof(szTitle));
else
{
lstrcpyn(szTitle, m_strTitle, _countof(szTitle));
if (m_strTitle.Find('.') == -1)
{
CString strExt;
CDocTemplate* pTemplate = GetDocTemplate();
if (pTemplate != NULL &&
pTemplate->GetDocString(strExt, CDocTemplate::filterExt))
{
lstrcat(szTitle, strExt);
}
}
}
#ifdef _UNICODE
char szTitleA[_MAX_PATH];
_wcstombsz(szTitleA, szTitle, _countof(szTitleA));
#endif
MapiFileDesc *fileDesc;
int num_attachments = 1 ;
if (DatasetType == TYPE_DATASET)
{
fileDesc = new MapiFileDesc ;
}
else
{
fileDesc = new MapiFileDesc[1 + mpntr->no_in_use] ;
num_attachments = 1 + mpntr->no_in_use ;;
}
memset(fileDesc, 0, sizeof(MapiFileDesc) * num_attachments);
fileDesc[0].nPosition = (ULONG)-1;
char szPathAM[MAX_DATASETS_PER_MULTI][_MAX_PATH];
char szTitleAM[MAX_DATASETS_PER_MULTI][_MAX_PATH];
#ifdef _UNICODE
fileDesc[0].lpszPathName = szTempNameA;
fileDesc[0].lpszFileName = szTitleA;
#else
fileDesc[0].lpszPathName = szTempName;
fileDesc[0].lpszFileName = szTitle;
#endif
if (DatasetType == TYPE_MULTISET)
{
for (int i = 0 ; i < mpntr->no_in_use ; i++)
{
fileDesc[i + 1].nPosition = (ULONG)-1 ;
#ifdef _UNICODE
CString temp_string ;
temp_string = mpntr->pntr[i]->m_Path + "\\" + mpntr->pntr[i]->m_Filename ;
_wcstombsz(szPathAM[i], temp_string, _countof(temp_string));
_wcstombsz(szTitleAM[i], mpntr->pntr[i]->m_Filename, _countof(mpntr->pntr[i]->m_Filename));
fileDesc[i + 1].lpszPathName = szPathAM[i] ;
fileDesc[i + 1].lpszFileName = szTitleAM[i] ;
#else
sprintf(szPathAM[i], "%s\\%s", mpntr->pntr[i]->m_Path, mpntr->pntr[i]->m_Filename) ;
sprintf(szTitleAM[i], "%s", mpntr->pntr[i]->m_Filename) ;
fileDesc[i + 1].lpszPathName = szPathAM[i] ;
fileDesc[i + 1].lpszFileName =szTitleAM[i] ;
#endif
}
}
MapiMessage message;
memset(&message, 0, sizeof(message));
message.nFileCount = num_attachments;
message.lpFiles = fileDesc;
AfxGetApp()->EnableModeless(FALSE);
HWND hWndTop;
CWnd* pParentWnd = CWnd::GetSafeOwner(NULL, &hWndTop);
pParentWnd->SetCapture();
::SetFocus(NULL);
pParentWnd->m_nFlags |= WF_STAYDISABLED;
int nError = lpfnSendMail(0, (ULONG)pParentWnd->GetSafeHwnd(),
&message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
::ReleaseCapture();
pParentWnd->m_nFlags &= ~WF_STAYDISABLED;
pParentWnd->EnableWindow(TRUE);
::SetActiveWindow(NULL);
pParentWnd->SetActiveWindow();
pParentWnd->SetFocus();
if (hWndTop != NULL)
::EnableWindow(hWndTop, TRUE);
AfxGetApp()->EnableModeless(TRUE);
if (nError != SUCCESS_SUCCESS &&
nError != MAPI_USER_ABORT && nError != MAPI_E_LOGIN_FAILURE)
{
AfxMessageBox(AFX_IDP_FAILED_MAPI_SEND);
}
delete []fileDesc ;
if (bRemoveTemp)
CFile::Remove(szTempName);
}
Not sure if it will help out.
Roger Allen the man
|
|
|
|
|
Here is a class that can en/decode Base64...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
Hi,
I have to solution in my project. Use CListView or MSFlexGrid.
The project is to display a automation in execution.
My problem is How can I do for to do this :
1/ I have 10 playlist. Each playlist have 1, 2 or 3 functions.
=> I would like to display each playlist with a color. So, if one function -> One line, if two functions -> two lines , ...
2/ I would like to design a rectangle for distinging the playlist in the automation
So, if anyone can help me.
Best regards
youssef
|
|
|
|
|
|
hiya ..
wanna customize my projects makefile by specufying some other CPU type else than x86 .. and use NMAKE for it ..... how can i customize the makefile to achieve this ..
Thanks in advance .....
Farid ....
|
|
|
|
|
- How to change one font to another system-defined font?
- How to restore a font ?
- Can you help?
-Regards,
Maer
|
|
|
|
|
Where do you want to change the font ? System wide ? In a control ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
- Thanks pal!
- I simply want to get the general codes for changing font. It is not for specific use.
- Can you help? Can you show me an example?
-Regards,
Maer
|
|
|
|
|
Try this article,
Automatic Font Handling Class in Fonts & GDI >> GDI Objects
Jonathan de Halleux, Belgium.
|
|
|
|
|
- Thanks pal!
- Your reply clarifies my doubts.
- Regards,
Maer
|
|
|
|
|
- From MSDN it is said,
... A call to TlsAlloc() returns a global TLS index. This one TLS index is valid for every thread within the process that allocated it ...
... when TlsAlloc() is called, every thread within the process has its own private ULONG_PTR-sized space reserved for it (in its stack space, but this is implementation-specific) ...
- Suppose in a case, when thread A1 loads Dll B, and Dll B allocates a TLS in thread A1. And there are 2 threads in process P, thread A1 and thread A2. So when Dll B allocates a TLS in thread A1, thread A2 is also allocated a TLS with the same index. So we have 2 TLSs with the same index now.
- Am I right? But I think the TLS in thread A2 is useless place. (Suppose only thread A1 access Dll B)
- Can you help?
- Best regards,
Maer
|
|
|
|
|
Basically, you're right. The TLS slot alloated in A2 is useless if A2 does not use the same data items as A1.
The reason for this is this. Suppose you want to save the creation time for each thread in your process. And for the sake of completeness we can do the saving in a DLL. When the DLL loads it calls TlsAlloc and saves the returned index in a global variable (e.g. g_iTlsIndex). Now, as each thread is created it can save the creation time in the TLS slot with index g_iTlsIndex - the same index but a unique memory location for each thread. Of course, if your threads are totally unrelated and does totally different things they will probably not have the need for common TLS indices. But you got at least 64 TLS slots available, so you can use new one for each thread type.
TLS, DLLs and multithreading programming is described in great detail in Richters "Advanced Windows". I for (i=0; i<A_WHOLE_LOT;i++, printf("really ")); recommend you get a copy if you're doing MT programming. It's worth every dime.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
DAMN, I though the code tag would allow me to write greater-than an less-than characters! Anyway, the last paragraph should read:
TLS, DLLs and multithreading programming is described in great detail in Richter's "Advanced Windows". I really really recommend that you get a copy if you're doing MT programming. It's worth every dime.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
- Thanks pal!
- I still have a question. If I just use the function "TlsAlloc" and do not use the function "TlsSetValue", I think we just allocate an index and do not allocate a memory space to store value of variable.
- Am I right?
- Regards,
Maer
|
|
|
|
|
Hi,
I have developed an MDI OpenGL App using MFC. It creates a scene and displays it after reading it from a file that stores the colors, etc. of each object in the scene. Now how do I handle change in color depth in runtime, because in my code I use glColor3f(R,G,B) to specify colors while drawing. So will this code work properly in 256 colors also. How will I handle changes to the palette etc.?
Thanks,
Krishnan
|
|
|
|
|
I have refined my previous question in the intrests of specificity.
I need to make an MDI application that supports two kinds of windows:
A: Standard view of a set of data (like an invoice or reciept)
B: Dialogs for adding items to said invoice
As well, I need to put a large bar along the top serving as a sort of summary, as well as commiting, clearing, or canceling the transaction, but I have a way to do this already.
My problem is, I need to know if there is a way to do item B. These must be modeless dialogs within the MDI region. MFC doc/view preferably. think photoshop toolwindows with the main view presenting the finished work. however, photoshop windows can escape the main window.
Another option I have been looking into is docking bars, but the best example I have found is here on code project, but only loads single controls... if these can load whole dialogs it would work.
any help would be most apreciated.
// Rock
|
|
|
|
|
Use FormView for your "Dialogs". They are basically modeless dialogs hooked up to be views.
The "large bar along the top" could be implemented as a dialog bar, I think.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
How to disable the "Ctrl + ALT + DEL" in Windows 2000? Eager for you help, any of your advice will be appreciate.
|
|
|
|
|