|
I don't know if this is possible, but I'd explore the possibility of getting a list of running exes. Duplicate their handle. Wait on that handle.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hello,
This is the solution I found from another source:
=======================================================
Apart from WMI, a nice and elegant way to do that is to place a small DLL "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\AppInit_DLLs"
(see also http://support.microsoft.com/kb/197571 - "Working with the AppInit_DLLs registry value")
DLLs listed in AppInit_DLLs will be loaded into every newly created process and will allow you to perform any notification via the DLL's 'DllMain().
Let me know, if you need help with source code.
|
|
|
|
|
Just wanted to add some comments for your consideration. The AppInit_DLLs entry will not have any effect on applications which are not linked with user32.dll. Generally this isn't much of an issue because 99% of all usermode applications are linked against user32. However if your developing a security product then this might not be acceptable.
Also you need to be aware that the future of AppInit DLLs is uncertain and is changing. Just like loading device drivers, future AppInit DLLs will have a code signature requirement. Microsoft has outlined this new behavior here:
AppInit DLLs in Windows 7 and Windows Server 2008 R2[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Does the TRACE macro work with Unicode string as well?
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: Does the TRACE macro work with Unicode
I'd be shocked if it doesn't.
TRACE(L"Hello, world");
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Try it and found out. 
|
|
|
|
|
How to use graphics in cpp.........
when i try to intialise graphics system generates an error graphic driver not detected (something like that)
help me pleaseeeeeeeeee
|
|
|
|
|
What Graphics? If you are writing applications in C++/MFC, you may start at Windows GDI Start Page (Windows)[^]
CodeProject also has a Graphics[^] section and a GDI[^] section.
Markandaiya Harsh wrote: an error graphic driver not detected (something like that)
Something like that? See point #2 and #4 in How to get an answer to your question[^]
Markandaiya Harsh wrote: pleaseeeeeeeeee
Nooooooooooooo
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi..Sakthi here..
First i would like to thank all Expert's for your good response..
Here i have given the question with one Ex:
My question is th check whether the entered input text is meaningful or not...For this we need to compare the given input in english dictionary,if we have found then we can accept it ..We are checking in terms of spelling ..
Class -------- > Text ( Selected )
Klass --------- > Spelling mistake ( Rejected )
------------------------------------------------------------
Like that we need to implement the english dictionary in visual c++..
Waiting for good response
Thanks in advane ..
|
|
|
|
|
You were given an answer here[^], so stop re-posting the same thing.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
i m using CFile function to create a file, i want to create a text file that is have full permission control to user.
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
1) You can try exploring the flags of CFile ctor.
2) And if not satiated with what you are trying to achieve, then try using CreateFile, modify its security attributes and pass its handle to CFile ctor.
|
|
|
|
|
Which flag is useful for this.
if possible please can u explain me with example.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
HANDLE WINAPI CreateFile(
__in LPCTSTR lpFileName,
__in DWORD dwDesiredAccess,
__in DWORD dwShareMode,
__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes,
__in DWORD dwCreationDisposition,
__in DWORD dwFlagsAndAttributes,
__in_opt HANDLE hTemplateFile
);
dwDesiredAccess [in]
The requested access to the file or device, which can be summarized as read, write, both or neither (zero).
The most commonly used values are GENERIC_READ, GENERIC_WRITE, or both (GENERIC_READ | GENERIC_WRITE). For more information, see Generic Access Rights and File Security and Access Rights.
If this parameter is zero, the application can query certain metadata such as file, directory, or device attributes without accessing that file or device, even if GENERIC_READ access would have been denied.
You cannot request an access mode that conflicts with the sharing mode that is specified by the dwShareMode parameter in an open request that already has an open handle.
For more information, see the Remarks section of this topic and Creating and Opening Files.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
"_$h@nky_" wrote: i m using CFile function to create a file, i want to create a text file that is have full permission control to user.
What is this supposed to mean?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I want,if i create any text file from admin account,and want to access this file from user or guest account than this file cannot editable by user or guest.
i want to make it editable by all users and guest.
so please tell me how can i create file with full access ,so all user an edit it.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
I have a dialog with with a list box and a Add button. When any item in the list box is selected then the Add button has to be enabled. I have a requirement where I would select the item in list box by pressing the Shift+Tab combination. (Shift+Tab combination would move the focus from control to control) How to know that Shift+Tab combination has occured.
|
|
|
|
|
|
|
If the list box loses focus, you might disable the "Add" button and if the list box gains focus, you can enable the button. That sounds viable? This way you do not have to know if shift+tab was pressed or not.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I have a Visual Studio 2008 MFC doc/view application. I have choosed a docking pane type. The dock is a tree control like Windows explorer. When I click an item on the tree, I want to change the form in the view area.
For that I have to acces the document to get a member function. The code is working but I get memory leak.
Perhaps I don't take the good way.
Any suggestions ?
Claude
Here's my code:
void CViewTree::OnTvnSelchanged(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
// TODO : ajoutez ici le code de votre gestionnaire de notification de contrôle
*pResult = 0;
CString strItem;
HTREEITEM hItem = GetSelectedItem();
strItem = GetItemText(hItem);
// Pointeurs vers le document
CFrameWnd *pFrameWnd = (CFrameWnd*)AfxGetApp()->m_pMainWnd;
CCDSView* pView;
pView = (CCDSView*)pFrameWnd->GetActiveView(); //
// Detected memory leaks!
//Dumping objects ->
//{1272} normal block at 0x03E2C478, 530 bytes long.
// Data: < 6 > 14 36 19 01 0F 00 00 00 00 01 00 00 01 00 00 00
//{1190} normal block at 0x03E28F20, 530 bytes long.
// Data: < 6 ( > 14 36 19 01 28 00 00 00 00 01 00 00 01 00 00 00
//Object dump complete.
CCDSDoc* pDoc = pView->GetDocument();
pDoc->ToDoc(strItem);
}
|
|
|
|
|
The code that you have shown does not appear to have any memory leaks.
Search for the new keyword or functions like HeapAlloc , GlobalAlloc , VirtualAlloc etc. in all the code. Then you can see if the allocated memory is being freed.
Alternatively you can use the _CrtMemCheckpoint and _CrtMemDifference functions to find exactly where the memory leak happens.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
How do you know there is a memory leak? Is the debugger dumping the objects after your application shuts down? In which case it must point out the line numbers where the leaking memory was allocated. If not, you need to add this to the beginning of your manually created source files (if a source file is added by any of the wizards, it adds this by default):
#ifdef _DEBUG
#define new DEBUG_NEW
You may look at the definition of DEBUG_NEW to see what it does.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
See this page[^] (or this page[^] for newer versions of Visual Studio) for advice on how to get a debugger breakpoint when the allocation that's been detected as leaking occurs.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
When I tried to compile my files, every file will generate following errors. After commenting the "#include "stdafx.h" out, these two errors will disappear. My "debug" version can compile. but the "release" version has following problems.
I used VS to create a new project. I got same errors. The debug version is OK. The release version can not be compiled.
1>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.inl(210) : error C2556: 'CFile *CArchive::GetFile(void) const' : overloaded function differs only by return type from 'CFile &CArchive::GetFile(void) const'
1> C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h(1628) : see declaration of 'CArchive::GetFile'
1>C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.inl(210) : error C2372: 'CArchive::GetFile' : redefinition; different types of indirection
1> C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h(1628) : see declaration of 'CArchive::GetFile'
What is wrong?
Thanks,
modified on Friday, May 15, 2009 5:47 PM
|
|
|
|