advertisement

Find Code  Advanced Search   

Free Newsletters:   
browse free vb code
Submit Code
ASP,  HTML, and XML
Database
Dates  and Math
Files  and Directories
Forms  and Controls
Lists,  Collections, and Arrays
Miscellaneous
Multimedia/Games
Office/VBA
Network/Internet
Registry
Screen/Graphics
String  Manipulation
System/API
Windows  2000/XP
VB.NET/ASP.NET



advertisement
Shuffle Desktop Icons Using Interprocess Memory Communication

Author: Arkadiy Olovyannikov (Featured Developer)
Category: System/API
Type: Applications
Difficulty: Advanced

Version Compatibility:  Visual Basic 5   Visual Basic 6  

More information: This application shows you how to send a pointer to a structure filled with data to a window owned by another process. If the windows was owned by your own process, you can use the SendMessage API call for this purpose; but if you try this in communicating with another process, a GPF will occur. In Windows 9x/ME, the workaround it to use File Mapping, because the OS places mapped files into shareable memory space. In NT/2000/XP, files are mapped into the calling process's memory area, so in this case, we can use VirtualAllocEx function to reserve memory inside the target process.

The demo here changes the position of desktop icons and uses the techniques described above to save the original positions, in order to restore them later. For this purpose, we need to pass a POINTAPI structure into the Shell memory space.

This code has been viewed 58447 times.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

source/ShuffleDesktop.zip

Sponsored Links