|
chandu004 wrote: am i right or not?
yes, but not CodeGuru !!!
moreover, when you answer like that, take the time yourself to provide the link, or don't answer at all, because it's useless (I mean, yes, the OP should have searched at first, so you don't bring something new then)
BTW, your Signature is a bit too aggressive. you should consider reduce its size and/or add a separator because most of the time, it looks like it's part of the body of your answer
|
|
|
|
|
toxcct wrote: yes, but not CodeGuru !!!
iam sorry if it has hurt the ego of any body.
toxcct wrote: take the time yourself to provide the link,
yah you are right i would have done that. but now only i came to know that, quoting the competor site, would be inconvinient to some people.
toxcct wrote: BTW, your Signature is a bit too aggressive. you should consider reduce its size and/or add a separator because most of the time, it looks like it's part of the body of your answer
thanks for the advice, i shall do the same.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
norm .net wrote: Yes but he is on CodeProject NOT Codeguru.
Well said.;)
|
|
|
|
|
|
I know, strange advice being handed out by the newbie
WPF - Imagineers Wanted
Follow your nose using DoubleAnimationUsingPath
|
|
|
|
|
|
It will be better if you provide the Link also. Or some keywords to find the thing.
|
|
|
|
|
self deleting an application
or
"an application that deletes itself."
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Hey Thnx,
Got the link. Coming back to you after Checking.
|
|
|
|
|
Now I am using the MoveFileEx Function to delete the File at reboot. as Follows
GetModuleFileName(0,FileName,MAX_PATH);
if ( ! MoveFileEx(FileName,NULL,MOVEFILE_DELAY_UNTIL_REBOOT ) )
dError = GetLastError() ;
PostQuitMessage(0);
But the Problem is that it is Not supported in Windows 95/98/Me. MSDN has provided the solution for that also. And trying to implement it
|
|
|
|
|
Use a .bat file. It will work on all version of Windows.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Notice that if you put:
del %0.bat
in a batch file and run it from a command prompt, it will remove itself. You can take advantage of this by creating a similar batch file from within the program you are wanting to delete:
:DoItAgain
del MyProg.exe
if exist MyProg.exe goto DoItAgain
rem del folder that MyProg.exe was in
del %0.bat Use CreateProcess() to run the batch file. Note that I've not actually tested this so you may have to tweak it for your situation (e.g., add paths, hide console window).
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Now I am Creating the batch File at run time and Its working fine.
|
|
|
|
|
GetModuleFileName(0,FileName,MAX_PATH);
char strFileName[MAX_PATH]= {} ;
int a = WideCharToMultiByte(CP_ACP,0,FileName,-1,strFileName,MAX_PATH,NULL,NULL);
FILE *fwin = fopen("Uninstall.bat","w+");
fprintf(fwin,"@echo off \n");
fprintf(fwin,":back \n");
fprintf(fwin,"del \"%s\"\n",strFileName);
fprintf(fwin,"if exist \"%s\" goto back: \n ",strFileName);
char Buffer[]= "%0.bat";
fprintf(fwin,"del %s \n",Buffer);
OpenProc(L"Uninstall.bat");
-- modified at 3:11 Tuesday 16th October, 2007
|
|
|
|
|
GauranG33 wrote: char Buffer[]= "%0.bat";
Use an absolute path for this. What you have now is relative to whatever the CWD happens to be at the moment.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I Need help to set unicode string in menu and dialogs in nonunicode program by enable Os Settings. Expecting any articles are suggestions.
thanks in advance!
Have A Nice Day!
Murali.M
|
|
|
|
|
Using the W versions of APIs directly wont help?
- NS -
|
|
|
|
|
No, W will not be enough: the windows that are created w/o the W are non-unicode windows (there is a special API to check the Unicodeness of a window), and they cannot accept unicode strings in menus and other places; the system standard controls, like editbox or button, do support unicode, but the top level windows and dialogs must be created differently.
Cheers,
Alex
|
|
|
|
|
Thank you for the information provided
- NS -
|
|
|
|
|
i am developing a small dialog based application where in i am stuck at someplace. just wanted to know how do i display the directories of a system in a combo box. it would be great if i get a solution as soon as possible
Thanks in Advance.
Chandru080
|
|
|
|
|
use _chdir(),_findfirst(),_findnext() etc
in proper combination to achieve your task.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Chandrasekharanp wrote: just wanted to know how do i display the directories of a system in a combo box.
Look up DlgDirListComboBox .
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
See CComboBox::Dir
- NS -
|
|
|
|
|
use the following code.Here m_letter is the member variable of combo box.
int k = 0;
DWORD MaxDriveSet, CurDriveSet;
DWORD drive, drivetype;
TCHAR szBuf[300];
HANDLE hDevice;
PSTORAGE_DEVICE_DESCRIPTOR pDevDesc;
for(k=0; k<26; k++)
szMoveDiskName[k] = '\0';
k = 1;
// Get available drives we can monitor
MaxDriveSet = CurDriveSet = 0;
MaxDriveSet = GetLogicalDrives();
CurDriveSet = MaxDriveSet;
for ( drive = 0; drive < 32; ++drive )
{
if ( MaxDriveSet & (1 << drive) )
{
DWORD temp = 1<<drive;
_stprintf(="" szdrvname,="" _t("%c:"),="" 'a'+drive="" );
="" m_letter.addstring(szdrvname);
="" switch="" (="" getdrivetype(="" szdrvname="" )=""
="" {
="" case="" 0:="" the="" drive="" type="" cannot="" be="" determined.
="" 1:="" root="" directory="" does="" not="" exist.
="" drivetype="DRVUNKNOWN;
" break;
="" drive_removable:="" can="" removed="" szmovediskname[k]="chFirstDriveFromMask(temp);
" szmovediskname[0]="k;
" k++;
="" drive_cdrom:="" is="" a="" cd-rom="" drive.
="" drive_fixed:="" disk="" sprintf(szbuf,="" "\\\\?\\%c:",="" 'a'+drive);
="" hdevice="CreateFile(szBuf," generic_read,
="" file_share_read="" |="" file_share_write,="" null,="" open_existing,="" null);
="" if="" (hdevice="" !="INVALID_HANDLE_VALUE)
" {
="" pdevdesc="(PSTORAGE_DEVICE_DESCRIPTOR)new" byte[sizeof(storage_device_descriptor)="" +="" 512="" -="" 1];
="" pdevdesc-="">Size = sizeof(STORAGE_DEVICE_DESCRIPTOR) + 512 - 1;
if(GetDisksProperty(hDevice, pDevDesc))
{
if(pDevDesc->BusType == BusTypeUsb)
{
szMoveDiskName[k] = chFirstDriveFromMask(temp);
szMoveDiskName[0]=k;
k++;
}
}
delete pDevDesc;
CloseHandle(hDevice);
}
break;
case DRIVE_REMOTE:// The drive is a remote
drivetype = DRVREMOTE;
szMoveDiskName[k] = chFirstDriveFromMask(temp);
szMoveDiskName[0]=k;
k++;
break;
case DRIVE_RAMDISK:// The drive is a RAM disk.
drivetype = DRVRAM;
break;
}
}
}
|
|
|
|