Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Draging buttons at runtime in a dialog Pin
Wes Aday22-Jun-05 9:24
professionalWes Aday22-Jun-05 9:24 
GeneralRe: Draging buttons at runtime in a dialog Pin
Member 206342622-Jun-05 11:04
Member 206342622-Jun-05 11:04 
GeneralCTreeCtrl Pin
bkphat22-Jun-05 7:54
bkphat22-Jun-05 7:54 
GeneralCheck if file is open Pin
kani9822-Jun-05 7:31
kani9822-Jun-05 7:31 
GeneralRe: Check if file is open Pin
David Crow22-Jun-05 7:53
David Crow22-Jun-05 7:53 
GeneralRe: Check if file is open Pin
Toby Opferman22-Jun-05 9:08
Toby Opferman22-Jun-05 9:08 
GeneralRe: Check if file is open Pin
kani9822-Jun-05 11:06
kani9822-Jun-05 11:06 
GeneralRe: Check if file is open Pin
Toby Opferman22-Jun-05 17:08
Toby Opferman22-Jun-05 17:08 
The other process may not really have the file open anymore, it could have read it into memory and closed it.

The one question I have though is if the CD is removed, can you continue your installation? If so, then perhaps the single instance check that Blake Miller proposed is all you need. If not, then I'm not saying you shouldn't implement that you probably should implement that either way, however if it is an issue that you can't continue your installation after the CD was ejected, then I would pop up an error message "CD Ejected, Installation Canceled" and you could even make it a modal parent of the application you just launched.

To close the application is a tough one. The simplest method is simply "TerminateProcess", but that's a rough one and usually a last resort. There is a support article on MSDN that specifies the steps you could do to attempt to shut down an application peacefully.

Terminate an application cleanly[^]

You could do a simple polling to check if a file is on the CD until it fails, but that is kind of ugly. I haven't looked into seeing if there is a callback I would search the windows messages or perhaps WM_DEVICECHANGE may even work.

Registration for device Removals[^]

Alternatively, you could lock the drive so you can't eject then re-enable it after you're done.

Check this URL out for all the IOCTLs:
Locking the drive from being ejected[^]




8bc7c0ec02c0e404c0cc0680f7018827ebee
GeneralRe: Check if file is open Pin
Blake Miller22-Jun-05 12:26
Blake Miller22-Jun-05 12:26 
Generalprocess monitoring Pin
3loka22-Jun-05 7:09
3loka22-Jun-05 7:09 
GeneralRe: process monitoring Pin
Chris Losinger22-Jun-05 7:38
professionalChris Losinger22-Jun-05 7:38 
GeneralRe: process monitoring Pin
3loka22-Jun-05 10:28
3loka22-Jun-05 10:28 
GeneralYet another problem with LPCTSTR Pin
tomek1822-Jun-05 6:04
tomek1822-Jun-05 6:04 
GeneralRe: Yet another problem with LPCTSTR Pin
James R. Twine22-Jun-05 6:43
James R. Twine22-Jun-05 6:43 
GeneralRe: Yet another problem with LPCTSTR Pin
Bob Stanneveld22-Jun-05 6:56
Bob Stanneveld22-Jun-05 6:56 
GeneralRe: Yet another problem with LPCTSTR Pin
Blake Miller22-Jun-05 7:29
Blake Miller22-Jun-05 7:29 
GeneralRe: Yet another problem with LPCTSTR Pin
Bob Stanneveld22-Jun-05 8:43
Bob Stanneveld22-Jun-05 8:43 
GeneralRe: Yet another problem with LPCTSTR Pin
Toby Opferman22-Jun-05 9:17
Toby Opferman22-Jun-05 9:17 
GeneralRe: Yet another problem with LPCTSTR Pin
Bob Stanneveld22-Jun-05 20:27
Bob Stanneveld22-Jun-05 20:27 
GeneralRe: Yet another problem with LPCTSTR Pin
Toby Opferman23-Jun-05 10:10
Toby Opferman23-Jun-05 10:10 
GeneralOT Pin
Bob Stanneveld23-Jun-05 12:05
Bob Stanneveld23-Jun-05 12:05 
GeneralRe: OT Pin
Toby Opferman23-Jun-05 13:40
Toby Opferman23-Jun-05 13:40 
GeneralRe: OT Pin
Bob Stanneveld23-Jun-05 21:17
Bob Stanneveld23-Jun-05 21:17 
GeneralRe: OT Pin
Toby Opferman24-Jun-05 5:28
Toby Opferman24-Jun-05 5:28 
GeneralRe: OT Pin
Bob Stanneveld30-Jun-05 23:31
Bob Stanneveld30-Jun-05 23:31 

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.