![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
Win32 File Switching within a directory
Hi guys,
How do you implement ACDSEE like file switching within a current directory using win32 Api. As in, in my project I am reading a "DICOM" file as input and now I want a way in which I can view the next file by just clicking on a "Button" on the Toolbar. How do I implement such kind of File Switching in the Win32 Api. Like "Previous Button" for previous file and "next button" for next file instead of clicking File->Open and all that stuff. |
|
|
|
|
|
#2 |
|
PFO God In Training
![]() Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 599
Rep Power: 4
![]() |
See functions FindFirstFile() and FindNextFile(). There is no FindPreviousFile(). If you want to do that, then you might want to create a list of files in memory before starting, then scroll back and forth through that list. Of course the danger with that is it is not real-time -- files can be added or deleted and your program would never know it unless you restarted it.
Now, when you click the Next button, the program finds the next file name, closes the currently-opened file, and opens the new one. If you get the list of filenames ahead of times you could display them all in a list box so that the user can select any file at random. If you have 100 files you certainly don't want to click the Next button 100 times just to get to the last file in the list. Last edited by Ancient Dragon; Jun 10th, 2005 at 12:49 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|