|
Hi
I have problem with retrive a list of files open by one process for example notepad.
I alredy have the list of processes (Name and PID)
conime.exe (PID: 3384)<br />
rxvt.exe (PID: 3392)<br />
sh.exe (PID: 3484)<br />
SbPFCl.exe (PID: 3888)<br />
<unknown> (PID: 4044)<br />
GoogleDesktop.exe (PID: 4080)<br />
avgnt.exe (PID: 2184)<br />
jusched.exe (PID: 1156)<br />
GoogleDesktop.exe (PID: 1860)<br />
CarboniteSetupLitePBPreInstaller.exe (PID: 2824)<br />
rxvt.exe (PID: 3692)<br />
sh.exe (PID: 2692)<br />
notepad++.exe (PID: 2036)<br />
SciTE.exe (PID: 3156)<br />
<unknown> (PID: 3680)<br />
firefox.exe (PID: 3116)<br />
cmd.exe (PID: 1868)<br />
procexp.exe (PID: 2076)<br />
<unknown> (PID: 2604)<br />
mspaint.exe (PID: 3856)<br />
<unknown> (PID: 468)<br />
sh.exe (PID: 3880)<br />
spyprocess.exe (PID: 3260)
Let´s sey that in notepad++ I have opened 2 files .
I need the list that look like:
List:
Notepad++:
file1.txt
file2.txt (active)
file3.txt
Is there any function to enumerate this files or just to get this active file name or its path?
|
|
|
|
|
slawekwwww wrote: Is there any function to enumerate this files or just to get this active file name or its path?
Although it is unsupported by Microsoft it is possible to call the NtQuerySystemInformation Function[^] and populate an array of SYSTEM_HANDLE_INFORMATION structure.
Best Wishes,
-David Delaune
|
|
|
|
|
No, it won't work.
Notepad don"t let handles opened.
(see notepad source code)
|
|
|
|
|
kilt wrote: Notepad don"t let handles opened.
I do not understand your comment. Do you care to clarify?
Best Wishes,
-David Delaune
|
|
|
|
|
I have some code here
private: System::Void TS11_Click(System::Object^ sender, System::EventArgs^ e) {
++Tsn11;
if (Tsn11 = 0) { this->TS11->Image = Image::FromFile("C:/GamePics/NOTILE.png");}
else {
if (Tsn11 = 1){ this->TS11->Image = Image::FromFile("C:/GamePics/GREEN.png");}
else {
if (Tsn11 = 2){ this->TS11->Image = Image::FromFile("C:/GamePics/GRTRE.png");}
else {
if (Tsn11 = 3){ this->TS11->Image = Image::FromFile("C:/GamePics/ROAD.png");}
else {
if (Tsn11 = 4){ this->TS11->Image = Image::FromFile("C:/GamePics/WALL.png");}
};
};
};
};
};
};
when you click on the image, it gets the next one, but it only works one time
How can I make it work every time?
|
|
|
|
|
Hi,
This is the C++/MFC forum. You should ask your question in the C# forum[^].
Best Wishes,
-David Delaune
|
|
|
|
|
You could at least have answered it.
And I am writing it in C++...
So what...
|
|
|
|
|
You are in the wrong forum. Use the Managed C++/CLI forum[^]. This forum has nothing to do with .net.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Fenix2 wrote: if (Tsn11 = 0)
Shouldn't that be if (Tsn11 == 0) ?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi,
Can anyone tell me how to open a multi-page TIFF file using GDI+ ?
I use GDI+ to open various image files and then draw them on a printer DC. I use the same function for all types of image files:
Image* p = Image::FromFile(strFile);
But in the case of multipage TIFF this loads only the first page.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
|
Here is the code I use for loading multipage images. It works for animated gifs as well as tiffs. It does not work for multi image icons however.
Gdiplus::Image Image(static_cast<LPCWSTR>(CT2W(FilePath)));
if (Gdiplus::Ok == Image.GetLastStatus())
{
GUID DimensionID;
Image.GetFrameDimensionsList(&DimensionID, 1);
UINT Frames = Image.GetFrameCount(&DimensionID);
for (UINT CurrentFrame = 0; CurrentFrame < Frames; ++CurrentFrame)
{
if (Gdiplus::Ok == Image.SelectActiveFrame(&DimensionID, CurrentFrame))
{
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for the code, I was wondering how to use the GUID and the MSDN docs weren't very clear, so your code is a lot of help.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Dear Experts,
While running the visual c++ program for active directory querying an error occuring like activeds.h is not included.so my question is whether we have to create activeds.h or it is builtin header file.provide me a solution to run the program
|
|
|
|
|
raja 4 wrote: so my question is whether we have to create activeds.h or it is builtin header file.provide me a solution to run the program
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I am a beginner in Adobe Indesign CS4.When i build a plugin using dollyxs and running it i am getting the following error.
PRJ0019:A tool returned an error code from performing custom build set up.
Can anyone solve this problem??
I am using Microsoft visual studio 2008 and AdobeIndesign cs4
Regards
G.Narendra Babu
|
|
|
|
|
narendragrandhi wrote:
I am using Microsoft visual studio 2008...
But it's not a VS problem. See here for more.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I want to know that when & where does the storage for static data members of a class is defined and what is it's life time.
Since we don't need to create an object for assessing static members, does the storage is defined only by defining a class with static data members.
Please let me know about the same ASAP.
Thanks,
Akash
|
|
|
|
|
akashag wrote: Since we don't need to create an object for assessing static members, does the storage is defined only by defining a class with static data members.
You've to explicitely define the static members of a class, once you've declared them inside the class.
akashag wrote: Please let me know about the same ASAP.
Fast enough?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
akashag wrote: storage for static data members of a class
Since static members have to be available whether an object of the class exists or not, they are allocated in fixed program memory by the compiler. Thus they will be present during the lifetime of the program.
|
|
|
|
|
Hi,
Thanks for your answer.
Between, I assume that by 'fixed program memory', you mean heap. Isn't it?
Secondly, at what time storage for them is reserved?
Rgrds,
Akash
|
|
|
|
|
akashag wrote: etween, I assume that by 'fixed program memory', you mean heap
Why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
akashag wrote: Between, I assume that by 'fixed program memory', you mean heap. Isn't it?
No, I mean fixed program memory.
akashag wrote: Secondly, at what time storage for them is reserved?
As I said before, at compile time.
Static data whether global or class is allocated by the compiler, it is not dynamic (i.e. run time allocated).
|
|
|
|
|
akashag wrote: I want to know that when & where does the storage for static data members of a class is defined and what is it's life time.
Hi Akash,
Static data members are having global scope comparing to local variables. The simple example for this is when ever you are trying to create a static variable inside a class it gives an error. That is the memory is allocated to class variables at run time. Where as memory allocation done at compile time in case of static variables. So when ever i am creating variable inside a class means I giving memory at run time, both the things are contradiction.
A variable for that memory allocation done at only once called static variable.
sampath-padamatinti
|
|
|
|
|
sampath-padamatinti wrote: The simple example for this is when ever you are trying to create a static variable inside a class it gives an error.
What does this mean? It is quite correct to have static variables in a class: they are known as class variables.
sampath-padamatinti wrote: That is the memory is allocated to class variables at run time.
No, class variables are allocated at compile time.
sampath-padamatinti wrote: both the things are contradiction.
|
|
|
|