setshellview2.exe for windows XP?

Status
Not open for further replies.

OldManBrodie

Ars Legatus Legionis
44,321
Subscriptor
my friend, who knows VB pretty well, is trying to port the vaunted setshellview2.exe (the app that allows you to change the view for the desktop) to XP (b/c apparently, the API calls are different).

the five calls that he's using are:
Public Const IDM_SHVIEW_LARGEICON = &H7029
Public Const IDM_SHVIEW_SMALLICON = &H702A
Public Const IDM_SHVIEW_LIST = &H702B
Public Const IDM_SHVIEW_REPORT = &H702C
Public Const IDM_SHVIEW_PREVIEW = &H702D
is there a different one that would work in place of IDM_SHVIEW_LIST? b/c that doesn't change anything in XP. it works in 2k, though
 
Heres the C code to change the shellview. Works in Win2k and WinXP.

code:<HR>
Code:
#include <windows.h>
#include <commctrl.h><P>int main(void)
{
    HWND progman = FindWindowEx(GetDesktopWindow(), NULL, "Progman", NULL);
    HWND defview = FindWindowEx(progman, NULL, "SHELLDLL_DefView", NULL);
    HWND desklv = FindWindowEx(defview, NULL, "SysListView32", NULL);
    DWORD dwStyle = GetWindowLong(desklv, GWL_STYLE);
    if ((dwStyle & LVS_TYPEMASK) == LVS_ICON)
        SetWindowLong(desklv, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_SMALLICON);
    else
        SetWindowLong(desklv, GWL_STYLE, (dwStyle & ~LVS_TYPEMASK) | LVS_ICON);<P>	return 0;
}<P>

Link to EXE: Deskview

EDIT: changed code to switch between large icons and small icons every time it executes.

[This message was edited by jra101 on January 20, 2002 at 17:48.]
 
Status
Not open for further replies.