A quick example of running the image viewer to display an image :
include ImageView.inc
include CstrMacro.asm
.data?
CurDir db 64 dup(?)
buffer db 200 dup(?)
hLib dd ?
hModule dd ?
.code
start:
invoke GetModuleHandle,0
mov hModule,eax
invoke GetCurrentDirectory,64,ADDR CurDir
invoke lstrcat,ADDR CurDir,@Cstr("\ForumLogo.png")
invoke UnicodeStr,ADDR CurDir,ADDR buffer
invoke LoadLibrary,@Cstr("shimgvw.dll")
mov hLib,eax
invoke GetProcAddress,eax,\
@Cstr("ImageView_Fullscreen")
push SW_NORMAL
push OFFSET buffer
push hModule
push 0
call eax
invoke FreeLibrary,hLib
invoke ExitProcess,0
UnicodeStr PROC USES esi src:DWORD,dest:DWORD
mov esi,src
mov edx,dest
xor eax,eax
sub eax,1
@@:
add eax,1
movzx ecx,BYTE PTR [esi+eax]
mov WORD PTR [edx+eax*2],cx
test ecx,ecx
jnz @b
ret
UnicodeStr ENDP
END start
Hi Vortex,
Where can I find shimgvw.dll. The program launch the MS Photo viewer!
Windows\system32 or SysWOW64
Same with C and ANSI version
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
void __stdcall ImageView_Fullscreen(HWND, HINSTANCE, const wchar_t*, int);
void __cdecl WinMainCRTStartup(void)
{
char szBuf[MAX_PATH];
int nLen = GetCurrentDirectory(MAX_PATH, szBuf);
lstrcpy(szBuf + nLen, "\\ForumLogo.png");
HMODULE hMod = GetModuleHandle(NULL);
HMODULE hLib = LoadLibrary("shimgvw.dll");
PROC ImageView_Fullscreen = GetProcAddress(hLib, "ImageView_FullscreenA");
ImageView_Fullscreen(0, hMod, szBuf, SW_NORMAL);
ExitProcess(0);
}
Hi HellOfMice,
This DLL is a component of Windows installation :
C:\Windows\System32\shimgvw.dll
shimgvw.dll is the MS Photo viewer application.
Hi Timo,
Thanks for your code.
Hi all,
Looks like shimgvw.dll is mainly a shell for GDIPLus and some OLE. plus a whole lot a static linkings.
:) maybe that's what the SH in "shimgvw.dll" means ;D
The attached doc has some details but is rather dated.
John Z
Thank you everybody.