Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have an MFC based application. I have dragged the file created from my application to say(bottom right) of the desktop, it could be any location on the desktop.

Now if I open up my file again and perform a save operation, it always gets auto aligned to left. My application's files could retain their position on Windows XP.It works all fine there. This issue is on Windows 7 and Windows 8.

On debugging my codebase, I found that the call made to ::MoveFile() (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365239%28v=vs.85%29.aspx), is actually putting the file to left of desktop.

I couldn't get any thing much on this issue. It seems nobody else has faced this problem :(.

Any pointers in this direction - What could be wrong, or if such things needs a completely separate handling and if there is a standard way to do that would be of great help.

Also, MS Word, Wordpad, Notepad all works fine on my win 7 and win 8 machine in the mentioned scenario.
Posted
Comments
Richard MacCutchan 5-Mar-13 9:34am    
MoveFile() has nothing to do with the desktop view; unless, of course, you are moving it onto the desktop, in which case it will be stored according to the desktop preferences.

1. Right-Click on an empty space on the Desktop and then click View.
2. Ensure that Auto arrange icons is not checked.
 
Share this answer
 
The problem is that you are using MoveFile so it is not the same file anymore. You can probably know it by checking the creation date of the file which would changes in your case but not when using Notepad or other similar programs.

Thus my suggestion is that you would update existing file instead of replacing it by a moved file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900