Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 10th, 2005, 11:49 AM   #1
hemanth.balaji
Programmer
 
Join Date: May 2005
Posts: 54
Rep Power: 0 hemanth.balaji is an unknown quantity at this point
Send a message via Yahoo to hemanth.balaji Send a message via Skype™ to hemanth.balaji
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.
hemanth.balaji is offline   Reply With Quote
Old Jun 10th, 2005, 12:45 PM   #2
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 599
Rep Power: 4 Ancient Dragon is on a distinguished road
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.
Ancient Dragon is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC