|
SHFileOperation() will do it. I have a wrapper class in the Shell section here on CP to make it easier to use, as well.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
BOOL ClearDirectory(const char *path, BOOL recurs, BOOL deldirs)
{
if(!path)
return FALSE;
char xpath[512]="";
strcpy(xpath,path);
HANDLE hFile;
WIN32_FIND_DATA findData;
BOOL Go=TRUE;
char fullp[500]="";
char pattern[500]="";
if(xpath[strlen(xpath)-1]!='\\')
strcat(xpath,"\\");
if(!IsDirectory(xpath))
return FALSE;
strcpy(pattern,xpath);
strcat(pattern,"*.*");
hFile=FindFirstFile(pattern,&findData);
while((hFile!=INVALID_HANDLE_VALUE)&&(Go))
{
if((strcmp(findData.cFileName,".")!=0)&&(strcmp(findData.cFileName,"..")!=0))
{
strcpy(fullp,"");
sprintf(fullp,"%s%s",xpath,findData.cFileName);
if(IsDirectory(fullp))
{
ClearDirectory(fullp,recurs,deldirs);
strcat(fullp,"\\");
if(deldirs)
RemoveDirectory(fullp);
}
else
{
SetFileAttributes(fullp,128);
DeleteFile(fullp);
}
}
ZeroMemory((void*)&findData,sizeof(findData));
Go=FindNextFile(hFile,&findData);
}
FindClose(hFile);
if(deldirs)
RemoveDirectory(xpath);
return TRUE;
}
//rate me or hate
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Hi Folks,
this problem:
I have a filled CRect:
kind of: dc.FillRect(MyRect, &MyBrush);
Thow I want to create a Progressbar.
Can somebody explain me, how to make shaded one ?
Or more general how to make a gradient flow, from e.g. black to white?
thx a lot
bye
murphman;P
|
|
|
|
|
As FillRect is so fast you could fill different sized Rect's. Example,
int iWidth;
CRect MyRect;
MyRect.Left = 0;
MyRect.top = 0;
MyRect.bottom = 50;
for( MyRect.right = 1; MyRect.right < SOME_VALUE ; MyRect.right++)
{
dc.FillRect,MyRect,&MyBrush);
//do some of whatever your progress bar is monitoring
}
Now then. I'm not one to pass up an opertunity to add a thing or two so,
Once you have got the idea of a progress bar written like this, and assuming you don't want to use a ready made one, you now want to turn your progress bar into something you never have to write again. There are two ways, you could write an ActiveX control, which is fine if you like that sort of thing. Or you could simply keep it as a class (help in your library of classes).
Ex
class CMyProgressBar : public CObject
{
Create(int FromValue, int ToValue, int NumberOfSteps,CRect PossitionAndSize);
StepProgress(CDC* pDC);
};
etc
We do it for the joy of seeing the users struggle.
|
|
|
|
|
how to insert variable into database.For example,there r 4 food in the menu,how am i going to insert the chosen food into my database???is there other alternative besides using hardcoding???
|
|
|
|
|
|
Does anyone have an example of how to make those little animated Desktop pals.
They are little windows that sit ontop of the Active window.
I would love to see how this works.
Anyone ?
|
|
|
|
|
Has anyone developed a Visual C++ module to automatically report feedback on bugs, program exceptions (call stack and other program details), etc.. back to a developers web-site? IE6 has this behaviour, if the program crashes, the user can submit the info back to Microsoft. This would be a great addition to our software, but I wondered whether anyone has already developed a great utility to do this, including uploading the info to a web-site?
|
|
|
|
|
|
Hi,
Please tell me of sites where I can find an overview of Sequent Calculus. Also if you know some good books on this subject then let me know.
Thanks,
Mike.
|
|
|
|
|
I am calling an API function that returns an Integer. MSDN documentation states 'The only valid bits in the return value are those that correspond to the bits set in the mask parameter' How do I read these individual bit values.
Regards,
SAK
|
|
|
|
|
The API documentation probably has a list of values that can be ORed together to make the mask that you pass in as the mask parameter. To check if a bit is set, take the return value and AND it with the bit value you want.
ie
int ret = APIFunc(MASK1 | MASK2);
if (ret & MASK1)
{
}
etc.
---
The Center for Disease Control in Atlanta announced that Clinton has proven
that you can get sex from Aides.
|
|
|
|
|
An alternate solution that I have found useful when having to check a specific bit, like checking whether bit 29 in a 32 bit value is on or off, is using the std::bitset class.
std::bitset<32> keyBits;
if ( keyBits[29] == 1 ) { //bit 29 is set
//do something
}
|
|
|
|
|
I am trying to implement a linked list which will store large numbers(one digit in each node). I am not really familiar with the different math functions and was wondering what would be the easiest way to add and multiply some of these numbers. Thanks in advance for the help.
|
|
|
|
|
You mean big integers ?
Knuth has written a lot of algorithms for these type of integers. In fact they are the kernels of RSA cryptographic algortihms. I don't know if there are available libraries but you should read the following book to understand the theory behing those numbers:
"The art of computer programming. 2 : Seminumerical algorithms" / Donald E. Knuth
Jonathan de Halleux, Belgium.
|
|
|
|
|
Hello,
I want to write / find a program which dials to a given number wait till the anwering machine to answer, wait to the "beep" (online voice recognition) and play a recorded msg.
I'm searching for a week now for an already existing prog but all my searchings failed.
pls help me soon.
10x, tal.
|
|
|
|
|
Is there an existing class or library that allows your (MFC) app to work with file type associations? I know they are stored in the registry, but I am not quite sure how to properly set them, and have not been able to find documentation about this on MSDN. If there is not an existing class to do this, can someone explain how to set them directly in the registry? Or where I can find the information?
|
|
|
|
|
hi all
im using c++ and i need to check whether the computer is connected to the internet, without dialing to get the connection.
i hope someone can help me
dills
|
|
|
|
|
InternetCheckConnection(NULL, FLAG_ICC_FORCE_CONNECTION, 0) returns true if connection is available otherwise false.
|
|
|
|
|
hi all
im using c++ and i need to check whether the computer is connected to the internet, without dialing to get the connection.
i hope some can help me
dills
|
|
|
|
|
Hello,
I am trying to implement a bar like the outlook bar and want to insert drag and drop functionality in that bar. For example if you check the outlook bar you can move the 'contacts' to the end of the list of items in the bar i.e. drag contacts at the end of the list and drop it there. So is there any example that does a similar thing. Please let me know.
Thank you
vg
|
|
|
|
|
How could I intercept outgoing packets from a windows machine on a specified port? Would I need to go lower level than winsock?
|
|
|
|
|
i posted an articlein the win2000 / xp section about winsock hooking ! read it and leave me you impressions there !
be cool
//rate me or hate me
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
Please help me anyone.
I must write optimized version of applying filters to the image? but i don't know, hot to did it.
Dmitriy Golubev
|
|
|
|
|
Check Intel Image Library:
http://developer.intel.com/software/products/perflib/
Jonathan de Halleux, Belgium.
|
|
|
|