|
I mean what specifically is in sFileName ? When FindFirstFile() fails, what is the value of GetLastError() ?
|
|
|
|
|
Ok , i found the problem -
But if i need to search the current file in all C: driver ( all the harddisk ) how can i do it ?
|
|
|
|
|
|
Minor point; you should call ::FindClose() iside of the if() statement. (Windows doesn't care, but...)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
You can check for \\ instead insert _T("\\*.*"); to sFileName.(If I remember you want to write a search,right)
|
|
|
|
|
|
What code?
|
|
|
|
|
Your code is hide
|
|
|
|
|
all your codes are belong to us
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I launched a program P.EXE. Can other programs determine that P.EXE is running at that time?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: I launched a program P.EXE. Can other programs determine that P.EXE is running at that time?
yes.
Even Task manager can see programs.
|
|
|
|
|
I mean, by VC6
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Yes.
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.
|
|
|
|
|
I mean, by VC6
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
If you wan't example, You shoud say it. I will not play with Windows API.
Hint:
NextProcess()
FindWindow()
|
|
|
|
|
RomTibi wrote: I mean, by VC6
And the answer is, again, yes!.
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.
|
|
|
|
|
how? can you give mr an example?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Yes but you're a bit vague. Post with more detail what do you intend to do and then I'll give you an example.
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.
|
|
|
|
|
I have 5 programs: 1.exe ... 5.exe
I try to avoid that someone to launch a program in more than one instance and that two or more of the mentioned 1-5 programs can't run simultaneously.
It's clear?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
For instance, you can you FindWindow() or EnumWindows() and then send a WM_CLOSE to the unwanted ones.
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.
|
|
|
|
|
Thanks! I'll work around this...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Did you see EnumProcesses on the msdn it has two examples
|
|
|
|
|
I've tested that two. Thanks a lot!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
You're welcome
|
|
|
|
|
RomTibi wrote: Can other programs determine that P.EXE is running at that time?
To add to the excellent replies you've already received...
Yes.
Mark
|
|
|
|