1

I readed on a forum that the "Next Desktop Background" command in Windows Aero Slideshow feature calls the stobject.dll file. So I runned the dumpbin to check wheter I could se an exported method to call:

Microsoft Visual Studio 9.0\VC\bin\dumpbin.exe /EXPORTS
     Windows\System32\stobject.dll
Microsoft (R) COFF/PE Dumper Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.
Dump of file C:\Windows\System32\stobject.dll
File Type: DLL
Section contains the following exports for stobject.dll
00000000 characteristics
49EE914D time date stamp Wed Apr 22 00:38:53 2009
    0.00 version
       1 ordinal base
       2 number of functions
       2 number of names
ordinal hint RVA      name
      1    0 00001A28 DllCanUnloadNow
      2    1 000059A9 DllGetClassObject
Summary
    1000 .data
    2000 .reloc
   1A000 .rsrc
   1A000 .text

I guess if I P/Invoke one of those methods it won't work. What do I do?

Jader Dias
  • 88,211
  • 155
  • 421
  • 625

2 Answers2

2

those two exports are standard COM exports, you would have to figure out which COM interface to use and call them in the normal COM way (If you have Visual Studio, you could run the OLE/COM Object Viewer on the dll and look at its type library if it has one)

Anders
  • 97,548
  • 12
  • 110
  • 164
  • --------------------------- OLE/COM Object Viewer --------------------------- IMoniker::BindToObject failed on the file moniker created from ( "C:\Windows\System32\stobject.dll" ). Bad extension for file MK_E_INVALIDEXTENSION ($800401E6) --------------------------- OK --------------------------- – Jader Dias Oct 27 '09 at 23:47
  • --------------------------- OLE/COM Object Viewer --------------------------- LoadTypeLib( C:\Windows\System32\stobject.dll ) failed. Error loading type library/DLL. TYPE_E_CANTLOADLIBRARY ($80029C4A) --------------------------- OK --------------------------- – Jader Dias Oct 27 '09 at 23:48
  • I couldn't realize how to find this library by name or guid. Opening the file in the OLE/COM Object viewer threw the exceptions above. Trying to reference it directly in a Visual Studio Project threw another exception. The bounty goes to who shows the steps I should take. – Jader Dias Oct 28 '09 at 01:19
  • --------------------------- Microsoft Visual Studio --------------------------- A reference to 'C:\WINDOWS\system32\stobject.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. --------------------------- OK --------------------------- – Jader Dias Oct 28 '09 at 11:33
  • I finally found it on the OleViewer, and I could also drag and drop the dll to it. It exposes a few interfaces. Not sure how to proceed. – Jader Dias Oct 28 '09 at 11:37
1

I've had similar problem. The difference is I wanted to delete current wallpaper file and enforce slideshow to go on. I figured out that on the wallpaper change the HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource registry key. So, I tried to delete the file it's pointing on. And... In about ten seconds the wallpaper was changed! Looks like this enforced the slideshow to go on.

So, here's a batch file to do the trick. It gets current wallpaper file value from registry, renames it with temporary name, waits for 10 seconds and renames it back to original.

@echo off

set WallpaperFilePath=

For /F "UseBackQ Tokens=2*" %%I In (`Reg Query "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General" /v WallpaperSource`) Do set WallpaperFilePath=%%J
if "%WallpaperFilePath%" equ "" goto :eof

For %%i In ("%WallpaperFilePath%") Do set WallpaperFileName=%%~nxi
set WallpaperFileNameTmp=__%WallpaperFileName%__

echo "%WallpaperFilePath%" "%WallpaperFileName%" "%WallpaperFileNameTmp%"

ren "%WallpaperFilePath%" "%WallpaperFileNameTmp%"
ping -n 10 localhost > Nul
For %%i In ("%WallpaperFilePath%") Do ren "%%~dpi%WallpaperFileNameTmp%" "%WallpaperFileName%"

Try to increase the time interval if nothing happens.

ExpoSiGHT
  • 33
  • 5