SHAddToRecentDocs problem
I used
SHAddToRecentDocs(2, installpath & myfile) to add myfile to Recent documents.
Then I used the following loop to Wait for the SHAddToRecentDocs to add
shortcut
Do While Dir(RecentPath & myfile & ".lnk") = ""
Loop
The problem is that it never gets out of the loop.
Could anybody help me to point out why ?
I checked the Recent path to be correct and also checked that the 'myfile'
is in the Recent folder.
[479 byte] By [
Saune] at [2008-2-2]
Hi,
Are u making a Win32 API call using Visual Basic.NET?
If so, then you need to make sure you have declared it as a Sub.
| |
Private Declare Sub SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal pv As String)
|
If you have declared it as a Function instead of a Sub then it wont work.
Also make sure the extension of the file you are trying to add as an entry
is registered on your system
Regards,
Vikram
Is it shortcut to an Executable? Windows XP does not allow executables to be added to the Recent Documents.
Also you need to be careful, recent documents can be disabled via Group Policy, so in some situations (which you may be experiencing) your code won't work.