|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Refresh the Windows OS from within Visual Basicand folders. After I've finished it, the main problem is to refresh the Windows OS. I mean the same thing as when we press F5. Than everything refreshes and if we have made changes, they are immediately shown. Could someone help me with this matter? A possible solution or maybe an idea how to do that? Suppose that you see in front of you the Windows XP Desktop and you press F5 or from the menu with mouse right click you choose Refresh. That refreshes the screen. Or in Explorer the same happens. THAT is what I want to do. Not reboot the computer. And, refresh is not equal to Rebooting the machine. I don't know how you came up with this. And about the program, for example: The program moves a file from one place, changes its name, and then again moves the file to the same location. If you open explorer in that folder, and you execute the above explained program, the explorer won't show you the changed name. You must press F5 to refresh the Explorer, in order to see that the file has been changed. Suppose this case: 1. Open Explorer, or my computer and in C:\ open a folder named Temp 2. Create a file there named "text.txt" 3. Leave the explorer open 4. Now make a program in VB, that renames this file into for example: "example.txt" 5. Now compile and run the program. (The filename is changed without a problem) 6. Now go to the Explorer window, and you will still see there the file under the name "text.txt" and not "explorer.txt". 7. Press now F5, and there it is! You see that the file is changed! That is what I want to refresh! When I make a change on the hard disk, I want all the active programs working with the disk (like explorer) to notice the change, and refresh themselfs. I suppose I should do this now through Win API. But I don't know which API command actually does the trick. Was my explanation better ? ps.. And still another thing why I'm moving a file instead of renaming it. Try this: make a program in VB that renames a file called "text.txt" into "Text.txt" with the difference of the second file has a big letter T. Visual basic will report Error, there is already a file named with the same name. Operation failed! Than YOU MUST move the file, and put it back with a new name. Thank you, Robert Mileski. SHChangeNotify API
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shchangenotify.asp Show quoteHide quote "Robert Mileski" <r_mile***@hotmail.com> wrote in message news:%23A6iSiWRGHA.3192@TK2MSFTNGP09.phx.gbl... > I've made some program in Visual Basic 2005 that works with changing files > and folders. After I've finished it, the main problem is to refresh the > Windows OS. I mean the same thing as when we press F5. Than everything > refreshes and if we have made changes, they are immediately shown. > > Could someone help me with this matter? A possible solution or maybe an > idea > how to do that? > > Suppose that you see in front of you the Windows XP Desktop and you press > F5 > or from the menu with mouse right click you choose Refresh. That refreshes > the screen. Or in Explorer the same happens. THAT is what I want to do. > Not > reboot the computer. And, refresh is not equal to Rebooting the machine. I > don't know how you came up with this. > > And about the program, for example: The program moves a file from one > place, > changes its name, and then again moves the file to the same location. If > you > open explorer in that folder, and you execute the above explained program, > the explorer won't show you the changed name. You must press F5 to refresh > the Explorer, in order to see that the file has been changed. > > Suppose this case: > > 1. Open Explorer, or my computer and in C:\ open a folder named Temp > > 2. Create a file there named "text.txt" > > 3. Leave the explorer open > > 4. Now make a program in VB, that renames this file into for example: > "example.txt" > > 5. Now compile and run the program. (The filename is changed without a > problem) > > 6. Now go to the Explorer window, and you will still see there the file > under the name "text.txt" and not "explorer.txt". > > 7. Press now F5, and there it is! You see that the file is changed! > > That is what I want to refresh! When I make a change on the hard disk, I > want all the active programs working with the disk (like explorer) to > notice > the change, and refresh themselfs. > > I suppose I should do this now through Win API. But I don't know which API > command actually does the trick. > > Was my explanation better ? > > ps.. And still another thing why I'm moving a file instead of renaming it. > Try this: make a program in VB that renames a file called "text.txt" into > "Text.txt" with the difference of the second file has a big letter T. > Visual > basic will report Error, there is already a file named with the same name. > Operation failed! Than YOU MUST move the file, and put it back with a new > name. > > > Thank you, > > Robert Mileski. > > > Robert Mileski wrote:
> ps.. And still another thing why I'm moving a file instead of Why not change the name to something else and then name it to what you want? > renaming it. Try this: make a program in VB that renames a file > called "text.txt" into "Text.txt" with the difference of the second > file has a big letter T. Visual basic will report Error, there is > already a file named with the same name. Operation failed! Than YOU > MUST move the file, and put it back with a new name. That way there's no chance that it will end up moving the file between disks, which would be very time-consuming compared to just renaming it twice. There is a function to get a unique filename, but I don't know what it is. Andrew
Need some help with vb StatusStrip Control
How to abort a WinForms apps with no main window [VB.NET] How to store/load XML schema internally... datagridview combo box Fields in Access database returned in alphabetical order latency when loading forms Coding a TimeSpan Best way to implement 2 controls on one window Best way to output form information Best value Help file builder |
|||||||||||||||||||||||