Is there a way to prevent a file I create with CreateFile from being locked by the shell under Win9x? I see there is a FILE_SHARE_DELETE attribute that is NT only. Any way to delete the file while it's still open under win98?
Posted on 2002-02-02 19:13:18 by grv575
Also any way to completely hide a dialog box? ShowWindow w/ SW_HIDE doesn't work for DialogBoxParam apps it seems.
Posted on 2002-02-03 01:52:25 by grv575
Here's wat it says in the Win32.hlp API reference.



Windows 95: This function deletes a file even if it is open for normal I/O or as a memory-mapped file. To prevent loss of data, close files before attempting to delete them.



If this is true or not I leave it up to you to find out with some tests.

-huh
Posted on 2002-02-03 01:57:43 by huh
any way to completely hide a dialog box?

Do you mean a dialog box created by your program? Couldn't you just close it
Posted on 2002-02-03 03:00:55 by Quantum
huh: I mean when I have a program running and writing to a file I want to be able to delete it through explorer and then have windows automatically recreate the file with the same filename but an empty file. Thought I've seen this before but I could be mistaken. You might have to close the handle after each write and reopen it to allow the user delete access?

quantum: The application doesn't run in a window but uses a dialog box as the main window. But I want to be able to hide it and just place an icon in the system tray.
Posted on 2002-02-03 15:12:49 by grv575
When you use CreateWindowEx, you can create a toolwindow, which does not have a taskbar button. Similarly, you can create a toolwindow dialog box, which won't have a taskbar button. Try hiding that and see if it works. If not, try to minimize it. Because it does not have a taskbar button, it should go away, although I'm quite sure the user can bring it back.
Setting the system tray icon is a separate issue that can be accomplished easily .
Posted on 2002-02-03 23:19:18 by Hel