|
I created a tree control.... Which displaying Folders and files of a particular drive.
In this system volume information,Recyclebin folders are displaying, now i want only display folders and files of that drive only...Not to display system hidden folders
|
|
|
|
|
You can when read file or folders check for attrib if they are system or hidden dont show,how to read files/folders?
|
|
|
|
|
How can I get information about running processes on my computer including process tree, dependencies, memory usage, I/O threads etc. Thank you!
modified 9-Mar-17 17:09pm.
|
|
|
|
|
if ( !EnumProcesses( aProcesses, sizeof(aProcesses), &cbNeeded ) )
return NULL;
// Calculate how many process identifiers were returned.
cProcesses = cbNeeded / sizeof(DWORD);
// Print the memory usage for each process
for ( i = 0; i < cProcesses; i++ )
{
CString strFileNamePath, strFileName;
processID = aProcesses[i];
// Print the process identifier.
TRACE( "\nProcess ID: %u\n", processID );
// Get a list of all the modules in this process.
hProcess = OpenProcess( PROCESS_QUERY_INFORMATION |
PROCESS_VM_READ | PROCESS_TERMINATE,
FALSE, processID );
if( EnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
{
char szModName[MAX_PATH];
// Get the full path to the module's file.
if ( GetModuleFileNameEx( hProcess, hMods[0], szModName,
sizeof(szModName)))
{
// Print the module name and handle value.
TRACE("\t%s (0x%08X)\n", szModName, hMods[0] );
strFileNamePath.Format("%s", szModName);
strFileName = strFileNamePath.Mid(strFileNamePath.ReverseFind('\\') + 1, strFileNamePath.GetLength());
}
}
CloseHandle( hProcess );
}
this is how you can retrieve the file names of all running process,
similarily there are psapi functions to get memory usage, I/O threads
Cheers,
Sujith
|
|
|
|
|
You can see an article of Mr David Crow about procceses I think its helpful for you
|
|
|
|
|
I have a service (written in Visual C++ 6), running under Windows 2003. I need to get the name of the currently logged in user, but most Windows APIs I have found return the username of the *calling thread*, which when run as a system, is always "SYSTEM".
I have tried these APIs so far:
GetUserName
GetUserNameEx
Unfortunately, all of the above return the username "SYSTEM". Any suggestions?
|
|
|
|
|
Maybe a stupid question: Did you set a specific user account for the service (to run under)?
And are you aware of the fact that a service isn't allowed to run under an account that has a blank (empty) password?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
There's no need to specify user account for service unless it is exactly what you need. Most of the system/user services should work on Local System account which is almost designed for this purpose.
Regards
|
|
|
|
|
what about getting it from the registry...
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name
not sure if it's what you need, but maybe it'll help
|
|
|
|
|
Hi,
Bear in mind that its existence depends on currently running shell. Also if Fast user switching functionality is enabled, its value depends on currently active desktop, and you don't know how many users is currently logged on.
Regards
|
|
|
|
|
I have a service (written in Visual C++ 6), running under Windows 2003. I need to get the name of the currently logged in user, but most Windows APIs I have found return the username of the *calling thread*, which when run as a system, is always "SYSTEM".
I have tried these APIs so far:
GetUserName
GetUserNameEx
Unfortunately, all of the above return the username "SYSTEM". Any suggestions?
|
|
|
|
|
Hi,
Every application is executed under specific account, if you doubleclick on application icon on your desktop, this application will be executed under your account (if allowed). Using GetUserName/Ex will always return username of the account used to launch your application (associated with your thread).
Considering service, in your case it is Local System account which is used to lauch your service, that's why you get SYSTEM as user name for this account.
If you wish to get name of currently logged on user, you should use
NetWkstaUserGetInfo<br /> function to get info on your local computer, or enumerate users with NetWkstaUserEnum function.
Hope that helps.
Best regards
|
|
|
|
|
Hi Friends,
I am facing couple of problems while compiling the code, and this is the first time I am facing this kind of problem so I don't understand how to resolve this, Please help me out.
The problems are as follows:
1. When I am compiling a code I am getting message saying " The source file XXX and YYY (XXX and YYY are files in different projects) are both configured to produce the output file XXX.obj This project cannot be build.
2.For one project after every change (even after scrolloing the mouse) I am getting message saying " XXX.clw, This file has been modified outside of the source editor. Do you want to relode it?" I am getting this message so many time that I am unable to work.
3. Some times my code is getting compiled and some time it is giving error saying undeclaired member variable even though the variable is declaired. some times same code is getting compiled without any error.
Waiting for the replies from the group.
Thanks in advance...
Thanks & Regards,
-Dinesh.
|
|
|
|
|
Dinu_IP wrote: When I am compiling a code I am getting message saying " The source file XXX and YYY (XXX and YYY are files in different projects) are both
in the file view tab, plz check for the above files and delete the unwanted files from it.
Dinu_IP wrote: 2.For one project after every change (even after scrolloing the mouse) I am getting message saying " XXX.clw
delete the folowing files from the project folder. .clw, .opt, .plg, .aps, .ncb.
This files will be recreated when u compile the program. U can recreate the clw file when u press the ctrl + w ( class wizard )
nave
|
|
|
|
|
I write a program to listed all files in a directory and its subsequent
subdirectories.I use SHBrowseForFolder(),FindFirst(),FindNext() APIs to do this.But this work fine in Windows drive only,not in other drives.Please send me solution To Getme evergrateful.
god
|
|
|
|
|
ayan_00_arup wrote: work fine in Windows drive only
I dont understand what do u mean by windows drive?
nave
|
|
|
|
|
Why its not good for other drives?
|
|
|
|
|
|
I wrote a MFC GUI where I execute plink concole program. When the server is first contacted, I need to accept fingerprint from console prompt. How can I get that confirmation prompt from my GUI application ?
Appreciate any help !!
Gongya Yu
|
|
|
|
|
Hi,
By redirecting console output/input to your application.
You can find out how to do this from several open source project, like: Console[^] from Sourceforge.
Best regards
|
|
|
|
|
thanks!
I did use pipe to redirect output/input to my application. It worked fine. The only thing which does not work is when the server sends fingerprint for the first time connection. My application gets that, but my application just sends return character instead of stopping for input.
|
|
|
|
|
Hi
We are devolopping one project in this project it is required to add the
PNG images to Dialogboxes and other controls.So please kindly any body help us in our project
#sanroop#
|
|
|
|
|
Did you see CImage class ?
|
|
|
|
|
Thanque for your reply can u please send me any example to add png image to dialobbox and other controls.
#sanroop#
|
|
|
|
|
See
#include AtlImage.h
CImage m_Image;
BOOL CAnswerDlg::OnInitDialog()
{
...
m_Image.Load(yourfile);
return TRUE;
}
void CAnswerDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
m_Image.BitBlt(dc.m_hDC,0,0,640,480,0,0);
}
|
|
|
|