ReactOS 0.4.15-dev-5666-gc548b97
DesktopShellView Struct Reference

subclassed ShellView window More...

#include <desktop.h>

Inheritance diagram for DesktopShellView:
Collaboration diagram for DesktopShellView:

Public Types

typedef ExtContextMenuHandlerT< SubclassedWindowsuper
 
- Public Types inherited from ExtContextMenuHandlerT< SubclassedWindow >
typedef SubclassedWindow super
 
- Public Types inherited from SubclassedWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 DesktopShellView (HWND hwnd, IShellView *pShellView)
 
 ~DesktopShellView ()
 
bool InitDragDrop ()
 
- Public Member Functions inherited from ExtContextMenuHandlerT< SubclassedWindow >
 ExtContextMenuHandlerT (HWND hwnd)
 
 ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from SubclassedWindow
 SubclassedWindow (HWND)
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
int Notify (int id, NMHDR *pnmh)
 
bool DoContextMenu (int x, int y)
 
HRESULT DoDesktopContextMenu (int x, int y)
 
void PositionIcons (int dir=1)
 
void refresh ()
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Protected Attributes

IShellView_pShellView
 
HWND _hwndListView
 
int _icon_algo
 
- Protected Attributes inherited from ExtContextMenuHandlerT< SubclassedWindow >
CtxMenuInterfaces _cm_ifs
 
- Protected Attributes inherited from SubclassedWindow
WNDPROC _orgWndProc
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Member Functions inherited from SubclassedWindow
static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

subclassed ShellView window

Definition at line 169 of file desktop.h.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ DesktopShellView()

DesktopShellView::DesktopShellView ( HWND  hwnd,
IShellView pShellView 
)

Definition at line 520 of file desktop.cpp.

521 : super(hwnd),
522 _pShellView(pShellView)
523{
525
526 // work around for Windows NT, Win 98, ...
527 // Without this the desktop has mysteriously only a size of 800x600 pixels.
528 ClientRect rect(hwnd);
529 MoveWindow(_hwndListView, 0, 0, rect.right, rect.bottom, TRUE);
530
531 // subclass background window
533
534 _icon_algo = 0; // default icon arrangement
535
536 InitDragDrop();
537}
#define TRUE
Definition: types.h:120
& rect
Definition: startmenu.cpp:1413
subclassed background window behind the visible desktop window
Definition: desktop.h:36
ExtContextMenuHandlerT< SubclassedWindow > super
Definition: desktop.h:171
bool InitDragDrop()
Definition: desktop.cpp:547
HWND _hwndListView
Definition: desktop.h:191
IShellView * _pShellView
Definition: desktop.h:179
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GetNextWindow(h, c)
Definition: winuser.h:4717
#define GW_CHILD
Definition: winuser.h:758
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

◆ ~DesktopShellView()

DesktopShellView::~DesktopShellView ( )

Definition at line 540 of file desktop.cpp.

541{
542 if (FAILED(RevokeDragDrop(_hwnd)))
543 assert(0);
544}
HRESULT WINAPI RevokeDragDrop(HWND hwnd)
Definition: ole2.c:639
#define assert(x)
Definition: debug.h:53
#define FAILED(hr)
Definition: intsafe.h:51

Member Function Documentation

◆ Command()

int DesktopShellView::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 602 of file desktop.cpp.

603{
604 return super::Command(id, code);
605}
virtual int Command(int id, int code)
Definition: window.cpp:285
Definition: inflate.c:139

◆ DoContextMenu()

bool DesktopShellView::DoContextMenu ( int  x,
int  y 
)
protected

Definition at line 612 of file desktop.cpp.

613{
615
616 HRESULT hr = _pShellView->GetItemObject(SVGIO_SELECTION, IID_IDataObject, (void**)&selection);
617 if (FAILED(hr))
618 return false;
619
620 PIDList pidList;
621
622 hr = pidList.GetData(selection);
623 if (FAILED(hr)) {
624 selection->Release();
625 //CHECKERROR(hr);
626 return false;
627 }
628
629 LPIDA pida = pidList;
630 if (!pida->cidl) {
631 selection->Release();
632 return false;
633 }
634
635 LPCITEMIDLIST parent_pidl = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
636
637 LPCITEMIDLIST* apidl = (LPCITEMIDLIST*) alloca(pida->cidl*sizeof(LPCITEMIDLIST));
638
639 for(int i=pida->cidl; i>0; --i)
640 apidl[i-1] = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[i]);
641
642 hr = ShellFolderContextMenu(ShellFolder(parent_pidl), _hwnd, pida->cidl, apidl, x, y, _cm_ifs);
643
644 selection->Release();
645
646 if (SUCCEEDED(hr))
647 refresh();
648 else
649 CHECKERROR(hr);
650
651 return true;
652}
int selection
Definition: ctm.c:92
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HRESULT GetItemObject([in] UINT uItem, [in] REFIID riid, [out, iid_is(riid)] void **ppv)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define alloca
Definition: malloc.h:357
const GUID IID_IDataObject
HRESULT ShellFolderContextMenu(IShellFolder *shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST *apidl, int x, int y, CtxMenuInterfaces &cm_ifs)
#define CHECKERROR(hr)
Definition: shellclasses.h:162
HRESULT hr
Definition: shlfolder.c:183
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
Definition: shlobj.h:499
UINT aoffset[1]
Definition: shlobj.h:500
UINT cidl
Definition: shlobj.h:499
list of PIDLs
HRESULT GetData(IDataObject *selection)
IShellFolder smart pointer.
Definition: shellclasses.h:594
unsigned char * LPBYTE
Definition: typedefs.h:53

Referenced by WndProc().

◆ DoDesktopContextMenu()

HRESULT DesktopShellView::DoDesktopContextMenu ( int  x,
int  y 
)
protected

Definition at line 654 of file desktop.cpp.

655{
656 IContextMenu* pcm;
657
658 HRESULT hr = DesktopFolder()->GetUIObjectOf(_hwnd, 0, NULL, IID_IContextMenu, NULL, (LPVOID*)&pcm);
659
660 if (SUCCEEDED(hr)) {
661 pcm = _cm_ifs.query_interfaces(pcm);
662
664
665 if (hmenu) {
666 hr = pcm->QueryContextMenu(hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST-1, CMF_NORMAL|CMF_EXPLORE);
667
668 if (SUCCEEDED(hr)) {
671
673
674 _cm_ifs.reset();
675
676 if (idCmd == FCIDM_SHVIEWLAST-1) {
677 explorer_about(_hwnd);
678 } else if (idCmd) {
679 CMINVOKECOMMANDINFO cmi;
680
681 cmi.cbSize = sizeof(CMINVOKECOMMANDINFO);
682 cmi.fMask = 0;
683 cmi.hwnd = _hwnd;
684 cmi.lpVerb = (LPCSTR)(INT_PTR)(idCmd - FCIDM_SHVIEWFIRST);
685 cmi.lpParameters = NULL;
686 cmi.lpDirectory = NULL;
687 cmi.nShow = SW_SHOWNORMAL;
688 cmi.dwHotKey = 0;
689 cmi.hIcon = 0;
690
691 hr = pcm->InvokeCommand(&cmi);
692 }
693 } else
694 _cm_ifs.reset();
696 }
697
698 pcm->Release();
699 }
700
701 return hr;
702}
#define NULL
Definition: types.h:112
nsrefcnt Release()
void explorer_about(HWND hwndParent)
Definition: explorer.cpp:934
#define IDS_ABOUT_EXPLORER
Definition: resource.h:31
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
unsigned int UINT
Definition: ndis.h:50
#define FCIDM_SHVIEWFIRST
Definition: shlobj.h:507
#define FCIDM_SHVIEWLAST
Definition: shlobj.h:541
IContextMenu * query_interfaces(IContextMenu *pcm1)
Shell folder of the desktop.
convenient loading of string resources
Definition: globals.h:304
int32_t INT_PTR
Definition: typedefs.h:64
static HMENU hmenu
Definition: win.c:66
#define SW_SHOWNORMAL
Definition: winuser.h:764
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:846
#define AppendMenu
Definition: winuser.h:5721
#define TPM_RIGHTBUTTON
Definition: winuser.h:2370
#define MF_SEPARATOR
Definition: winuser.h:137
#define TPM_LEFTALIGN
Definition: winuser.h:2367
BOOL WINAPI DestroyMenu(_In_ HMENU)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
#define TPM_RETURNCMD
Definition: winuser.h:2377
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by WndProc().

◆ InitDragDrop()

bool DesktopShellView::InitDragDrop ( )

Definition at line 547 of file desktop.cpp.

548{
549 CONTEXT("DesktopShellView::InitDragDrop()");
550
551 DesktopDropTarget * pDropTarget = new DesktopDropTarget(_hwnd);
552
553 if (!pDropTarget)
554 return false;
555
556 pDropTarget->AddRef();
557
558 if (FAILED(RegisterDragDrop(_hwnd, pDropTarget))) {
559 pDropTarget->Release();
560 return false;
561 }
562
563 FORMATETC ftetc;
564
565 ftetc.dwAspect = DVASPECT_CONTENT;
566 ftetc.lindex = -1;
567 ftetc.tymed = TYMED_HGLOBAL;
568 ftetc.cfFormat = CF_HDROP;
569
570 pDropTarget->AddSuportedFormat(ftetc);
571 pDropTarget->Release();
572
573 return true;
574}
#define CF_HDROP
Definition: constants.h:410
OLE drop target for the desktop window.
Definition: desktop.h:96
void AddSuportedFormat(FORMATETC &ftetc)
Definition: dragdropimpl.h:184
virtual ULONG STDMETHODCALLTYPE AddRef()
Definition: dragdropimpl.h:192
virtual ULONG STDMETHODCALLTYPE Release()
HRESULT WINAPI RegisterDragDrop(HWND hwnd, LPDROPTARGET pDropTarget)
Definition: ole2.c:557
struct _CONTEXT CONTEXT

Referenced by DesktopShellView().

◆ Notify()

int DesktopShellView::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 607 of file desktop.cpp.

608{
609 return super::Notify(id, pnmh);
610}
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:290

◆ PositionIcons()

void DesktopShellView::PositionIcons ( int  dir = 1)
protected
Todo:

Definition at line 757 of file desktop.cpp.

758{
760
761 RECT work_area;
762 SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0);
763
764 /* disable default allignment */
765 SetWindowStyle(_hwndListView, GetWindowStyle(_hwndListView)&~LVS_ALIGNMASK);//|LVS_ALIGNTOP|LVS_AUTOARRANGE);
766
767 const POINTS& dir1 = s_align_dir1[_icon_algo];
768 const POINTS& dir2 = s_align_dir2[_icon_algo];
769 const POINTS& start_pos = s_align_start[_icon_algo];
770
771 int dir_x1 = dir1.x;
772 int dir_y1 = dir1.y;
773 int dir_x2 = dir2.x;
774 int dir_y2 = dir2.y;
775
776 int cx = LOWORD(spacing);
777 int cy = HIWORD(spacing);
778
779 int dx1 = dir_x1 * cx;
780 int dy1 = dir_y1 * cy;
781 int dx2 = dir_x2 * cx;
782 int dy2 = dir_y2 * cy;
783
784 int xoffset = (cx-32)/2;
785 int yoffset = 4/*(cy-32)/2*/;
786
787 int start_x = start_pos.x * (work_area.right - cx) + xoffset;
788 int start_y = start_pos.y * (work_area.bottom - cy) + yoffset;
789
790 int x = start_x;
791 int y = start_y;
792
794 int i1, i2;
795
796 if (dir > 0) {
797 i1 = 0;
798 i2 = all;
799 } else {
800 i1 = all-1;
801 i2 = -1;
802 }
803
804 IconMap pos_idx;
805 int cnt = 0;
806 int xhv = start_x;
807 int yhv = start_y;
808
809 for(int idx=i1; idx!=i2; idx+=dir) {
810 pos_idx[IconPos(y, x)] = idx;
811
813 if (++cnt & 1)
814 x = work_area.right - x - cx + 2*xoffset;
815 else {
816 y += dy1;
817
818 if (y + cy - 2 * yoffset > work_area.bottom) {
819 y = start_y;
820 start_x += dx2;
821 x = start_x;
822 }
823 }
824
825 continue;
826 }
827 else if (_icon_algo == ARRANGE_BORDER_HV) {
828 if (++cnt & 1)
829 x = work_area.right - x - cx + 2*xoffset;
830 else if (cnt & 2) {
831 yhv += cy;
832 y = yhv;
833 x = start_x;
834
835 if (y + cy - 2 * yoffset > work_area.bottom) {
836 start_x += cx;
837 xhv = start_x;
838 x = xhv;
839 start_y += cy;
840 yhv = start_y;
841 y = yhv;
842 }
843 } else {
844 xhv += cx;
845 x = xhv;
846 y = start_y;
847
848 if (x + cx - 2 * xoffset > work_area.right) {
849 start_x += cx;
850 xhv = start_x;
851 x = xhv;
852 start_y += cy;
853 yhv = start_y;
854 y = yhv;
855 }
856 }
857
858 continue;
859 }
860 else if (_icon_algo == ARRANGE_ROUNDABOUT) {
861
863
864 }
865
866 x += dx1;
867 y += dy1;
868
869 if (x<0 || x+cx-2*xoffset>work_area.right) {
870 x = start_x;
871 y += dy2;
872 } else if (y<0 || y+cy-2*yoffset>work_area.bottom) {
873 y = start_y;
874 x += dx2;
875 }
876 }
877
878 // use a little trick to get the icons where we want them to be...
879
880 //for(IconMap::const_iterator it=pos_idx.end(); --it!=pos_idx.begin(); ) {
881 // const IconPos& pos = it->first;
882
883 // ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
884 //}
885
886 for(IconMap::const_iterator it=pos_idx.begin(); it!=pos_idx.end(); ++it) {
887 const IconPos& pos = it->first;
888
889 ListView_SetItemPosition32(_hwndListView, it->second, pos.second, pos.first);
890 }
891}
static int start_x
Definition: maze.c:118
static int start_y
Definition: maze.c:118
unsigned int dir
Definition: maze.c:112
Definition: _map.h:48
iterator end()
Definition: _map.h:165
iterator begin()
Definition: _map.h:163
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
#define FALSE
Definition: types.h:117
unsigned int idx
Definition: utils.c:41
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint xoffset
Definition: gl.h:1547
GLint GLint GLint yoffset
Definition: gl.h:1547
static const POINTS s_align_dir1[]
Definition: desktop.cpp:724
pair< int, int > IconPos
Definition: desktop.cpp:754
static const POINTS s_align_dir2[]
Definition: desktop.cpp:739
#define ARRANGE_BORDER_HV
Definition: desktop.cpp:706
#define ARRANGE_ROUNDABOUT
Definition: desktop.cpp:707
static const POINTS s_align_start[]
Definition: desktop.cpp:709
#define ARRANGE_BORDER_DOWN
Definition: desktop.cpp:705
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
#define LOWORD(l)
Definition: pedump.c:82
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2307
#define ListView_SetItemPosition32(hwndLV, i, x0, y0)
Definition: commctrl.h:2706
#define LVS_ALIGNMASK
Definition: commctrl.h:2281
#define ListView_GetItemSpacing(hwndLV, fSmall)
Definition: commctrl.h:2712
Definition: _pair.h:47
SHORT y
Definition: windef.h:343
SHORT x
Definition: windef.h:342
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
#define HIWORD(l)
Definition: typedefs.h:247
#define GetWindowStyle(hwnd)
Definition: windowsx.h:315
#define SystemParametersInfo
Definition: winuser.h:5848

Referenced by WndProc().

◆ refresh()

void DesktopShellView::refresh ( )
protected
Todo:

Definition at line 894 of file desktop.cpp.

895{
897}

Referenced by DoContextMenu().

◆ WndProc()

LRESULT DesktopShellView::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 576 of file desktop.cpp.

577{
578 switch(nmsg) {
579 case WM_CONTEXTMENU:
582 break;
583
587 break;
588
590 return _icon_algo;
591
593 return SendMessage(_hwndListView, nmsg, wparam, lparam);
594
595 default:
596 return super::WndProc(nmsg, wparam, lparam);
597 }
598
599 return 0;
600}
#define PM_DISPLAY_VERSION
Definition: desktop.h:31
#define PM_SET_ICON_ALGORITHM
Definition: desktop.h:29
#define PM_GET_ICON_ALGORITHM
Definition: desktop.h:30
static UINT WPARAM wparam
Definition: combo.c:716
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_CONTEXTMENU
Definition: richedit.h:64
bool DoContextMenu(int x, int y)
Definition: desktop.cpp:612
HRESULT DoDesktopContextMenu(int x, int y)
Definition: desktop.cpp:654
void PositionIcons(int dir=1)
Definition: desktop.cpp:757
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define SendMessage
Definition: winuser.h:5833

Member Data Documentation

◆ _hwndListView

HWND DesktopShellView::_hwndListView
protected

Definition at line 191 of file desktop.h.

Referenced by DesktopShellView(), PositionIcons(), and WndProc().

◆ _icon_algo

int DesktopShellView::_icon_algo
protected

Definition at line 192 of file desktop.h.

Referenced by DesktopShellView(), PositionIcons(), and WndProc().

◆ _pShellView

IShellView* DesktopShellView::_pShellView
protected

Definition at line 179 of file desktop.h.

Referenced by DoContextMenu().


The documentation for this struct was generated from the following files: