Click here to Skip to main content
15,917,577 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Deriving a template from a template Pin
aka the guy17-Aug-03 15:54
aka the guy17-Aug-03 15:54 
GeneralProblem with AddNew of CRecordset Pin
Vassilis Papoulidis16-Aug-03 13:22
Vassilis Papoulidis16-Aug-03 13:22 
GeneralWSABUF WSASend and WSAReceive and server question Pin
Kuniva16-Aug-03 12:05
Kuniva16-Aug-03 12:05 
GeneralRe: WSABUF WSASend and WSAReceive and server question Pin
valikac16-Aug-03 15:01
valikac16-Aug-03 15:01 
GeneralRe: WSABUF WSASend and WSAReceive and server question Pin
Kuniva17-Aug-03 2:09
Kuniva17-Aug-03 2:09 
GeneralRe: WSABUF WSASend and WSAReceive and server question Pin
Kuniva17-Aug-03 2:18
Kuniva17-Aug-03 2:18 
GeneralRe: WSABUF WSASend and WSAReceive and server question Pin
valikac17-Aug-03 5:34
valikac17-Aug-03 5:34 
GeneralCancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Kayembi16-Aug-03 8:25
Kayembi16-Aug-03 8:25 
Hi,

I'm writing an application that stores some temporary files on disk and deletes them on closing (there is no way around this). To be tidy, I want to tell the application to delete the files if the computer is restarted whilst it is running, and thus I have used MoveFileEx with MOVEFILE_DELAY_UNTIL_REBOOT for Win2000 etc, and the WinInit.ini file for Windows 9x.

When the program ends, it is easy to cancel the "DeleteFileOnReboot" function I am using for Win 9x, as all I have to do before amending WinInit.ini is check if it exists (if it doesn't I can just create it then delete it on closing), and if it does save its settings using GetPrivateProfileSection and then restore them when my app ends using WritePrivateProfileSection.

However, I have no idea how to cancel MoveFileEx for Win2000/NT/XP platforms, as this stores all the files to be deleted in the registry. (I am a relative novice, and have never played with the registry before in an application.)

MSDN gives the following info:

[quote]
The function stores the locations of the files to be renamed at restart in the following registry value:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
This registry value is of type REG_MULTI_SZ. Each rename operation stores the following pair of NULL-terminated strings:
szDstFile\0\0
szSrcFile\0szDstFile\0\0
[/quote]

Unfortunately, I have no idea how to use this information... If anybody could tell me how I can cancel MoveFileEx after it has been called for files using the MOVEFILE_DELAY_UNTIL_REBOOT flag, I would be really grateful.

Many thanks,
KB

P.S. I am using the straight Windows API with *no* MFC.
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Michael Dunn16-Aug-03 9:01
sitebuilderMichael Dunn16-Aug-03 9:01 
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Kayembi16-Aug-03 11:57
Kayembi16-Aug-03 11:57 
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Michael Dunn16-Aug-03 13:11
sitebuilderMichael Dunn16-Aug-03 13:11 
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Kayembi16-Aug-03 14:54
Kayembi16-Aug-03 14:54 
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
PJ Arends16-Aug-03 15:38
professionalPJ Arends16-Aug-03 15:38 
GeneralRe: Cancelling MoveFileExe with MOVEFILE_DELAY_UNTIL_REBOOT Pin
Kayembi16-Aug-03 22:52
Kayembi16-Aug-03 22:52 
GeneralChange mouse button Pin
Svinnn16-Aug-03 7:41
sussSvinnn16-Aug-03 7:41 
GeneralRe: Change mouse button Pin
John R. Shaw16-Aug-03 8:42
John R. Shaw16-Aug-03 8:42 
GeneralMDIChildWnd flicker !!! Pin
_skidrow_vn_16-Aug-03 7:41
_skidrow_vn_16-Aug-03 7:41 
GeneralRe: MDIChildWnd flicker !!! Pin
John R. Shaw16-Aug-03 8:56
John R. Shaw16-Aug-03 8:56 
GeneralRe: MDIChildWnd flicker !!! Pin
_skidrow_vn_17-Aug-03 13:04
_skidrow_vn_17-Aug-03 13:04 
GeneralRe: MDIChildWnd flicker !!! Pin
John R. Shaw19-Aug-03 9:50
John R. Shaw19-Aug-03 9:50 
GeneralSerial Ports Pin
Nnamdi Onyeyiri16-Aug-03 7:10
Nnamdi Onyeyiri16-Aug-03 7:10 
GeneralRe: Serial Ports Pin
Trollslayer16-Aug-03 8:18
mentorTrollslayer16-Aug-03 8:18 
GeneralRe: Serial Ports Pin
Nnamdi Onyeyiri16-Aug-03 8:22
Nnamdi Onyeyiri16-Aug-03 8:22 
GeneralRe: Serial Ports Pin
Trollslayer16-Aug-03 8:56
mentorTrollslayer16-Aug-03 8:56 
GeneralRe: Serial Ports Pin
pxw16-Aug-03 11:20
pxw16-Aug-03 11:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.