|
If your main frame's resources are loaded by LoadFrame(IDR_xxx) then create/edit an icon resource
with the id == IDR_xxx and it will do WalderMort's suggestion for you. If the icon only has
32x32 size then the system will resize it when necessary. You can always add/remove other sizes
to the icon resource.
Mark
|
|
|
|
|
It's well-hidden in VC8. Right-click in the icon editor->Current icon image types->select a size
|
|
|
|
|
Hi ,
I getting always hFile = 0xfffff and i dont know what i did wrong.
Please help me.
<br />
bool CSearchFile::SearchFileInPath(CString &sFileName, CString &sPath, std::vector<char*>&cResultBuffer)<br />
{<br />
HANDLE hFile;
WIN32_FIND_DATA FileInformation;
bool bRetVal = false;<br />
<br />
if(sPath.IsEmpty() || (sPath.CompareNoCase(_T("*.*")) == -1))<br />
sPath.Format(_T("C:\\"));<br />
<br />
if(cResultBuffer.size() > 1 )<br />
{<br />
cResultBuffer.clear();<br />
}<br />
<br />
sFileName += _T("\\*.*");<br />
<br />
hFile = ::FindFirstFile(sFileName, &FileInformation);<br />
<br />
if(hFile != INVALID_HANDLE_VALUE)<br />
{<br />
.<br />
.<br />
.<br />
.<br />
}<br />
<br />
::FindClose(hFile);<br />
<br />
return bRetVal;<br />
}<br />
|
|
|
|
|
What is in sFileName when you call FindFirstFile() ? The code you posted can end up putting two backslashes in a row, which isn't legal in a file path.
|
|
|
|
|
OK,
My program is simple MFC program that take path ( root path ) and file name and look the file in this path and directories.
The sFileName is the name of the file.
I call FindFirstFile method when user press on button "Search" in the dialog. In this case user can set Path to be *.* or empty Path - in both cases it will look the file in C:\ directorie.
I try to remove the "\\*.*" part but its still dont work and i dont know why.
|
|
|
|
|
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.
|
|
|
|