ReactOS  0.4.13-dev-687-g023794c
CMainWindow Class Reference

#include <winproc.h>

Inheritance diagram for CMainWindow:
Collaboration diagram for CMainWindow:

Public Member Functions

LRESULT OnDropFiles (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCreate (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClose (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnInitMenuPopup (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetMinMaxInfo (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetCursor (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKeyDown (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysColorChange (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCommand (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
void alignChildrenToMainWindow ()
 
void saveImage (BOOL overwrite)
 
void UpdateApplicationProperties (HBITMAP bitmap, LPCTSTR newfilepathname)
 
void InsertSelectionFromHBITMAP (HBITMAP bitmap, HWND window)
 
 CMainWindow ()
 
HWND Create ()
 
CStatusBarGetStatusBar ()
 
CAppsListViewGetListView ()
 
CRichEditGetRichEdit ()
 
CAvailableAppsGetAvailableApps ()
 
- Public Member Functions inherited from ATL::CWindowImpl< CMainWindow, CWindow, CFrameWinTraits >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CFrameWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< CWindow >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CWindowImpl< CMainWindow >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 

Static Public Member Functions

static ATL::CWndClassInfoGetWndClassInfo ()
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CMainWindow, CWindow, CFrameWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CFrameWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CMainWindow >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Private Member Functions

VOID InitApplicationsList ()
 
HTREEITEM AddCategory (HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
 
VOID InitCategoriesList ()
 
BOOL CreateStatusBar ()
 
BOOL CreateToolbar ()
 
BOOL CreateTreeView ()
 
BOOL CreateListView ()
 
BOOL CreateRichEdit ()
 
BOOL CreateVSplitter ()
 
BOOL CreateHSplitter ()
 
BOOL CreateSearchBar ()
 
BOOL CreateLayout ()
 
BOOL InitControls ()
 
VOID OnSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
BOOL ProcessWindowMessage (HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 
virtual VOID OnLink (ENLINK *Link)
 
BOOL IsSelectedNodeInstalled ()
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 
VOID FreeInstalledAppList ()
 
VOID UpdateStatusBarText ()
 
VOID UpdateApplicationsList (INT EnumType)
 

Static Private Member Functions

static BOOL SearchPatternMatch (LPCWSTR szHaystack, LPCWSTR szNeedle)
 
static BOOL CALLBACK s_EnumInstalledAppProc (INT ItemIndex, ATL::CStringW &m_szName, PINSTALLED_INFO Info)
 
static BOOL CALLBACK s_EnumAvailableAppProc (CAvailableApplicationInfo *Info, LPCWSTR szFolderPath)
 

Private Attributes

CUiPanelm_ClientPanel
 
CUiSplitPanelm_VSplitter
 
CUiSplitPanelm_HSplitter
 
CMainToolbarm_Toolbar
 
CAppsListViewm_ListView
 
CSideTreeViewm_TreeView
 
CUiWindow< CStatusBar > * m_StatusBar
 
CUiWindow< CRichEdit > * m_RichEdit
 
CUiWindow< CSearchBar > * m_SearchBar
 
CAvailableApps m_AvailableApps
 
LPWSTR pLink
 
INT nSelectedApps
 
BOOL bSearchEnabled
 
BOOL bUpdating
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< CWindow >
enum  
 
- Public Attributes inherited from ATL::CWindowImplBaseT< CWindow, CFrameWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Public Attributes inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 12 of file winproc.h.

Constructor & Destructor Documentation

◆ CMainWindow()

CMainWindow::CMainWindow ( )
inline

Definition at line 749 of file gui.cpp.

749  :
751  pLink(NULL),
753  {
754  }
BOOL bSearchEnabled
Definition: gui.cpp:745
LPWSTR pLink
Definition: gui.cpp:741
smooth NULL
Definition: ftsmooth.c:416
CUiPanel * m_ClientPanel
Definition: gui.cpp:727

Member Function Documentation

◆ AddCategory()

HTREEITEM CMainWindow::AddCategory ( HTREEITEM  hRootItem,
UINT  TextIndex,
UINT  IconIndex 
)
inlineprivate

Definition at line 775 of file gui.cpp.

776  {
777  return m_TreeView->AddCategory(hRootItem, TextIndex, IconIndex);
778  }
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:652
static const WCHAR IconIndex[]
Definition: install.c:51
CSideTreeView * m_TreeView
Definition: gui.cpp:734

Referenced by InitCategoriesList().

◆ alignChildrenToMainWindow()

void CMainWindow::alignChildrenToMainWindow ( )

Definition at line 51 of file winproc.cpp.

52 {
53  int x, y, w, h;
54  RECT clientRect;
55  GetClientRect(&clientRect);
56 
58  {
59  x = 56;
60  w = clientRect.right - 56;
61  }
62  else
63  {
64  x = 0;
65  w = clientRect.right;
66  }
67  if (paletteWindow.IsWindowVisible())
68  {
69  y = 49;
70  h = clientRect.bottom - 49;
71  }
72  else
73  {
74  y = 3;
75  h = clientRect.bottom - 3;
76  }
77 
78  RECT statusBarRect0;
79  SendMessage(hStatusBar, SB_GETRECT, 0, (LPARAM)&statusBarRect0);
80  int statusBarBorders[3];
81  SendMessage(hStatusBar, SB_GETBORDERS, 0, (LPARAM)&statusBarBorders);
82  int statusBarHeight = statusBarRect0.bottom - statusBarRect0.top + statusBarBorders[1];
83 
84  scrollboxWindow.MoveWindow(x, y, w, ::IsWindowVisible(hStatusBar) ? h - statusBarHeight : h, TRUE);
85  paletteWindow.MoveWindow(x, 9, 255, 32, TRUE);
86 }
#define TRUE
Definition: types.h:120
CToolBox toolBoxContainer
Definition: main.cpp:65
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
LONG top
Definition: windef.h:292
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG right
Definition: windef.h:293
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define SB_GETRECT
Definition: commctrl.h:1931
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
#define SB_GETBORDERS
Definition: commctrl.h:1928
LONG_PTR LPARAM
Definition: windef.h:208
HWND hStatusBar
Definition: main.cpp:35
CPaletteWindow paletteWindow
Definition: main.cpp:67
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
CScrollboxWindow scrollboxWindow
Definition: main.cpp:68
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
LONG bottom
Definition: windef.h:294
BOOL IsWindowVisible() const
Definition: atlwin.h:890

Referenced by OnCommand(), and OnSize().

◆ Create()

HWND CMainWindow::Create ( )
inline

Definition at line 1731 of file gui.cpp.

1732  {
1733  ATL::CStringW szWindowName;
1734  szWindowName.LoadStringW(IDS_APPTITLE);
1735 
1736  RECT r = {
1741  };
1742  r.right += r.left;
1743  r.bottom += r.top;
1744 
1746  }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDS_APPTITLE
Definition: resource.h:3
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
_In_ BOOLEAN Create
Definition: pstypes.h:511
INT Height
Definition: winmain.h:17
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:19
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL bSaveWndPos
Definition: winmain.h:7

Referenced by _tWinMain(), and CreateMainWindow().

◆ CreateHSplitter()

BOOL CMainWindow::CreateHSplitter ( )
inlineprivate

Definition at line 880 of file gui.cpp.

881  {
882  m_HSplitter = new CUiSplitPanel();
887  m_HSplitter->m_Pos = INT_MAX; //set INT_MAX to use lowest possible position (m_MinSecond)
888  m_HSplitter->m_MinFirst = 10;
889  m_HSplitter->m_MinSecond = 140;
891 
892  return m_HSplitter->Create(m_hWnd) != NULL;
893  }
CUiSplitPanel * m_VSplitter
Definition: gui.cpp:728
#define TRUE
Definition: types.h:120
CUiCollection & Second()
Definition: rosui.h:555
#define INT_MAX
Definition: limits.h:40
INT m_MinFirst
Definition: rosui.h:531
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
INT m_MinSecond
Definition: rosui.h:532
CUiSplitPanel * m_HSplitter
Definition: gui.cpp:729
HWND Create(HWND hwndParent)
Definition: rosui.h:790
BOOL m_DynamicFirst
Definition: rosui.h:530
BOOL m_Horizontal
Definition: rosui.h:529
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
INT m_Pos
Definition: rosui.h:528

Referenced by CreateLayout().

◆ CreateLayout()

BOOL CMainWindow::CreateLayout ( )
inlineprivate

Definition at line 906 of file gui.cpp.

907  {
908  BOOL b = TRUE;
909  bUpdating = TRUE;
910 
911  m_ClientPanel = new CUiPanel();
914 
915  // Top level
916  b = b && CreateStatusBar();
917  b = b && CreateToolbar();
918  b = b && CreateSearchBar();
919  b = b && CreateVSplitter();
920 
921  // Inside V Splitter
922  b = b && CreateHSplitter();
923  b = b && CreateTreeView();
924 
925  // Inside H Splitter
926  b = b && CreateListView();
927  b = b && CreateRichEdit();
928 
929  if (b)
930  {
931  RECT rTop;
932  RECT rBottom;
933 
934  /* Size status bar */
935  m_StatusBar->SendMessageW(WM_SIZE, 0, 0);
936 
937  /* Size tool bar */
938  m_Toolbar->AutoSize();
939 
940  ::GetWindowRect(m_Toolbar->m_hWnd, &rTop);
941  ::GetWindowRect(m_StatusBar->m_hWnd, &rBottom);
942 
943  m_VSplitter->m_Margin.top = rTop.bottom - rTop.top;
944  m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top;
945  }
946 
947  bUpdating = FALSE;
948  return b;
949  }
CUiSplitPanel * m_VSplitter
Definition: gui.cpp:728
#define TRUE
Definition: types.h:120
BOOL CreateStatusBar()
Definition: gui.cpp:814
BOOL bUpdating
Definition: gui.cpp:746
BOOL CreateTreeView()
Definition: gui.cpp:834
LONG top
Definition: windef.h:292
BOOL CreateHSplitter()
Definition: gui.cpp:880
BOOL CreateSearchBar()
Definition: gui.cpp:895
unsigned int BOOL
Definition: ntddk_ex.h:94
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:764
DWORD AutoSize()
Definition: rosctrls.h:358
BOOL CreateToolbar()
Definition: gui.cpp:824
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define WM_SIZE
Definition: winuser.h:1593
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
BOOL CreateListView()
Definition: gui.cpp:844
CMainToolbar * m_Toolbar
Definition: gui.cpp:731
LONG bottom
Definition: windef.h:294
CUiMargin m_Margin
Definition: rosui.h:236
BOOL CreateVSplitter()
Definition: gui.cpp:865
BOOL CreateRichEdit()
Definition: gui.cpp:855
CUiPanel * m_ClientPanel
Definition: gui.cpp:727
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.cpp:735

Referenced by InitControls().

◆ CreateListView()

BOOL CMainWindow::CreateListView ( )
inlineprivate

Definition at line 844 of file gui.cpp.

845  {
846  m_ListView = new CAppsListView();
850 
852  return hListView != NULL;
853  }
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
CUiSplitPanel * m_HSplitter
Definition: gui.cpp:729
CUiCollection & First()
Definition: rosui.h:554
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
HWND hListView
Definition: gui.cpp:29
HWND Create(HWND hwndParent)
Definition: gui.cpp:545
CAppsListView * m_ListView
Definition: gui.cpp:732

Referenced by CreateLayout().

◆ CreateRichEdit()

BOOL CMainWindow::CreateRichEdit ( )
inlineprivate

Definition at line 855 of file gui.cpp.

856  {
861 
862  return m_RichEdit->Create(m_hWnd) != NULL;
863  }
CUiCollection & Second()
Definition: rosui.h:555
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
CUiSplitPanel * m_HSplitter
Definition: gui.cpp:729
CUiWindow< CRichEdit > * m_RichEdit
Definition: gui.cpp:736
HWND m_hWnd
Definition: atlwin.h:268
HWND Create(HWND hwndParent)
Definition: crichedit.h:95
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239

Referenced by CreateLayout().

◆ CreateSearchBar()

BOOL CMainWindow::CreateSearchBar ( )
inlineprivate

Definition at line 895 of file gui.cpp.

896  {
900  m_SearchBar->m_Margin.top = 4;
902 
903  return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL;
904  }
LONG top
Definition: windef.h:292
LONG right
Definition: windef.h:293
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
HWND Create(HWND hwndParent)
Definition: gui.cpp:707
CUiWindow< CSearchBar > * m_SearchBar
Definition: gui.cpp:738
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
CMainToolbar * m_Toolbar
Definition: gui.cpp:731
CUiMargin m_Margin
Definition: rosui.h:236

Referenced by CreateLayout().

◆ CreateStatusBar()

BOOL CMainWindow::CreateStatusBar ( void  )
inlineprivate

Definition at line 814 of file gui.cpp.

815  {
820 
822  }
#define IDC_STATUSBAR
Definition: resource.h:14
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:442
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
CUiCollection & Children()
Definition: rosui.h:355
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
CUiPanel * m_ClientPanel
Definition: gui.cpp:727
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.cpp:735

Referenced by CreateLayout().

◆ CreateToolbar()

BOOL CMainWindow::CreateToolbar ( )
inlineprivate

Definition at line 824 of file gui.cpp.

825  {
826  m_Toolbar = new CMainToolbar();
830 
831  return m_Toolbar->Create(m_hWnd) != NULL;
832  }
HWND Create(HWND hwndParent)
Definition: gui.cpp:305
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
CMainToolbar * m_Toolbar
Definition: gui.cpp:731
CUiCollection & Children()
Definition: rosui.h:355
CUiPanel * m_ClientPanel
Definition: gui.cpp:727

Referenced by CreateLayout().

◆ CreateTreeView()

BOOL CMainWindow::CreateTreeView ( )
inlineprivate

Definition at line 834 of file gui.cpp.

835  {
836  m_TreeView = new CSideTreeView();
840 
841  return m_TreeView->Create(m_hWnd) != NULL;
842  }
CUiSplitPanel * m_VSplitter
Definition: gui.cpp:728
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
CUiCollection & First()
Definition: rosui.h:554
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
HWND Create(HWND hwndParent)
Definition: rosctrls.h:463
CSideTreeView * m_TreeView
Definition: gui.cpp:734

Referenced by CreateLayout().

◆ CreateVSplitter()

BOOL CMainWindow::CreateVSplitter ( )
inlineprivate

Definition at line 865 of file gui.cpp.

866  {
867  m_VSplitter = new CUiSplitPanel();
872  m_VSplitter->m_MinFirst = 0;
873  m_VSplitter->m_MinSecond = 320;
874  m_VSplitter->m_Pos = 240;
876 
877  return m_VSplitter->Create(m_hWnd) != NULL;
878  }
CUiSplitPanel * m_VSplitter
Definition: gui.cpp:728
INT m_MinFirst
Definition: rosui.h:531
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:238
smooth NULL
Definition: ftsmooth.c:416
INT m_MinSecond
Definition: rosui.h:532
HWND Create(HWND hwndParent)
Definition: rosui.h:790
BOOL m_DynamicFirst
Definition: rosui.h:530
BOOL m_Horizontal
Definition: rosui.h:529
HWND m_hWnd
Definition: atlwin.h:268
CUiAlignment m_VerticalAlignment
Definition: rosui.h:239
INT m_Pos
Definition: rosui.h:528
CUiCollection & Children()
Definition: rosui.h:355
CUiPanel * m_ClientPanel
Definition: gui.cpp:727

Referenced by CreateLayout().

◆ FreeInstalledAppList()

VOID CMainWindow::FreeInstalledAppList ( )
inlineprivate

Definition at line 1522 of file gui.cpp.

1523  {
1524  INT Count = m_ListView->GetItemCount() - 1;
1526 
1527  while (Count >= 0)
1528  {
1530  if (Info)
1531  {
1532  RegCloseKey(Info->hSubKey);
1533  delete Info;
1534  }
1535  Count--;
1536  }
1537  }
DWORD_PTR ListViewGetlParam(INT item)
Definition: gui.cpp:1778
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
int GetItemCount()
Definition: rosctrls.h:121
int32_t INT
Definition: typedefs.h:56
struct TraceInfo Info
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
INSTALLED_INFO * PINSTALLED_INFO
Definition: installed.h:13
CAppsListView * m_ListView
Definition: gui.cpp:732

Referenced by ProcessWindowMessage(), and UpdateApplicationsList().

◆ GetAvailableApps()

CAvailableApps* CMainWindow::GetAvailableApps ( )
inline

Definition at line 1763 of file gui.cpp.

1764  {
1765  return &m_AvailableApps;
1766  }
CAvailableApps m_AvailableApps
Definition: gui.cpp:739

Referenced by GetAvailableApps().

◆ GetListView()

CAppsListView* CMainWindow::GetListView ( )
inline

Definition at line 1753 of file gui.cpp.

1754  {
1755  return m_ListView;
1756  }
CAppsListView * m_ListView
Definition: gui.cpp:732

Referenced by ListViewAddItem(), and ListViewGetlParam().

◆ GetRichEdit()

CRichEdit* CMainWindow::GetRichEdit ( )
inline

Definition at line 1758 of file gui.cpp.

1759  {
1760  return m_RichEdit;
1761  }
CUiWindow< CRichEdit > * m_RichEdit
Definition: gui.cpp:736

Referenced by InsertRichEditText(), and NewRichEditText().

◆ GetStatusBar()

CStatusBar* CMainWindow::GetStatusBar ( )
inline

Definition at line 1748 of file gui.cpp.

1749  {
1750  return m_StatusBar;
1751  }
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.cpp:735

Referenced by SetStatusBarText().

◆ GetWndClassInfo()

static ATL::CWndClassInfo& CMainWindow::GetWndClassInfo ( )
inlinestatic

Definition at line 1707 of file gui.cpp.

1708  {
1709  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
1710  static ATL::CWndClassInfo wc =
1711  {
1712  {
1713  sizeof(WNDCLASSEX),
1714  csStyle,
1716  0,
1717  0,
1718  NULL,
1719  LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)),
1721  (HBRUSH) (COLOR_BTNFACE + 1),
1723  L"RAppsWnd",
1724  NULL
1725  },
1726  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
1727  };
1728  return wc;
1729  }
#define IDR_MAINMENU
Definition: resource.h:40
#define TRUE
Definition: types.h:120
#define CS_HREDRAW
Definition: winuser.h:648
smooth NULL
Definition: ftsmooth.c:416
#define CS_VREDRAW
Definition: winuser.h:653
#define _T(x)
Definition: vfdio.h:22
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
static const WCHAR L[]
Definition: oid.c:1250
#define IDI_MAIN
Definition: resource.h:4
#define COLOR_BTNFACE
Definition: winuser.h:918
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1529
#define IDC_ARROW
Definition: winuser.h:682
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5617

◆ InitApplicationsList()

VOID CMainWindow::InitApplicationsList ( )
inlineprivate

Definition at line 757 of file gui.cpp.

758  {
760 
761  /* Add columns to ListView */
762  szText.LoadStringW(IDS_APP_NAME);
764 
765  szText.LoadStringW(IDS_APP_INST_VERSION);
767 
768  szText.LoadStringW(IDS_APP_DESCRIPTION);
770 
771  // Unnesesary since the list updates on every TreeView selection
772  // UpdateApplicationsList(ENUM_ALL_COMPONENTS);
773  }
#define LVCFMT_RIGHT
Definition: commctrl.h:2571
#define LVCFMT_LEFT
Definition: commctrl.h:2570
static const WCHAR szText[]
Definition: dialog.c:139
#define IDS_APP_DESCRIPTION
Definition: resource.h:129
BOOL AddColumn(INT Index, ATL::CStringW &Text, INT Width, INT Format)
Definition: gui.cpp:483
CAppsListView * m_ListView
Definition: gui.cpp:732
#define IDS_APP_NAME
Definition: resource.h:127
#define IDS_APP_INST_VERSION
Definition: resource.h:128

Referenced by InitControls().

◆ InitCategoriesList()

VOID CMainWindow::InitCategoriesList ( )
inlineprivate

Definition at line 780 of file gui.cpp.

781  {
782  HTREEITEM hRootItemInstalled, hRootItemAvailable;
783 
784  hRootItemInstalled = AddCategory(TVI_ROOT, IDS_INSTALLED, IDI_CATEGORY);
785  AddCategory(hRootItemInstalled, IDS_APPLICATIONS, IDI_APPS);
786  AddCategory(hRootItemInstalled, IDS_UPDATES, IDI_APPUPD);
787 
789 
790  hRootItemAvailable = AddCategory(TVI_ROOT, IDS_AVAILABLEFORINST, IDI_CATEGORY);
791  AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
792  AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
793  AddCategory(hRootItemAvailable, IDS_CAT_GRAPHICS, IDI_CAT_GRAPHICS);
794  AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
795  AddCategory(hRootItemAvailable, IDS_CAT_INTERNET, IDI_CAT_INTERNET);
796  AddCategory(hRootItemAvailable, IDS_CAT_OFFICE, IDI_CAT_OFFICE);
797  AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
798  AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
799  AddCategory(hRootItemAvailable, IDS_CAT_ENGINEER, IDI_CAT_ENGINEER);
800  AddCategory(hRootItemAvailable, IDS_CAT_FINANCE, IDI_CAT_FINANCE);
801  AddCategory(hRootItemAvailable, IDS_CAT_SCIENCE, IDI_CAT_SCIENCE);
802  AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
803  AddCategory(hRootItemAvailable, IDS_CAT_DRIVERS, IDI_CAT_DRIVERS);
804  AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
805  AddCategory(hRootItemAvailable, IDS_CAT_THEMES, IDI_CAT_THEMES);
806  AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
807 
809  m_TreeView->Expand(hRootItemInstalled, TVE_EXPAND);
810  m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
811  m_TreeView->SelectItem(hRootItemAvailable);
812  }
#define IDS_CAT_DEVEL
Definition: resource.h:166
#define IDS_CAT_OFFICE
Definition: resource.h:175
#define IDI_CAT_DEVEL
Definition: resource.h:20
#define IDI_CATEGORY
Definition: resource.h:13
#define IDS_CAT_VIDEO
Definition: resource.h:179
#define IDS_CAT_FINANCE
Definition: resource.h:170
#define IDS_AVAILABLEFORINST
Definition: resource.h:96
#define IDS_INSTALLED
Definition: resource.h:95
#define IDI_CAT_ENGINEER
Definition: resource.h:23
#define IDI_CAT_OFFICE
Definition: resource.h:29
#define IDI_CAT_VIDEO
Definition: resource.h:33
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:579
#define IDS_SELECTEDFORINST
Definition: resource.h:114
#define IDS_CAT_INTERNET
Definition: resource.h:173
HIMAGELIST SetImageList()
Definition: gui.cpp:674
#define IDS_CAT_DRIVERS
Definition: resource.h:167
#define IDI_CAT_OTHER
Definition: resource.h:30
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:584
#define IDS_CAT_OTHER
Definition: resource.h:176
#define IDI_CAT_TOOLS
Definition: resource.h:32
#define IDI_CAT_EDU
Definition: resource.h:22
#define IDI_CAT_INTERNET
Definition: resource.h:27
#define TVE_EXPAND
Definition: commctrl.h:3395
#define TVI_ROOT
Definition: commctrl.h:3340
#define IDS_CAT_LIBS
Definition: resource.h:174
#define IDS_CAT_THEMES
Definition: resource.h:180
#define IDS_CAT_SCIENCE
Definition: resource.h:177
#define IDS_CAT_GRAPHICS
Definition: resource.h:172
#define IDS_CAT_AUDIO
Definition: resource.h:165
#define IDS_CAT_EDU
Definition: resource.h:168
#define IDS_CAT_ENGINEER
Definition: resource.h:169
#define IDS_APPLICATIONS
Definition: resource.h:98
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:775
#define IDI_CAT_LIBS
Definition: resource.h:28
#define IDI_CAT_GRAPHICS
Definition: resource.h:26
#define IDI_CAT_THEMES
Definition: resource.h:34
#define IDI_CAT_FINANCE
Definition: resource.h:24
#define IDS_UPDATES
Definition: resource.h:97
#define IDI_CAT_DRIVERS
Definition: resource.h:21
#define IDI_CAT_AUDIO
Definition: resource.h:19
#define IDI_CAT_GAMES
Definition: resource.h:25
#define IDS_CAT_TOOLS
Definition: resource.h:178
#define IDI_CAT_SCIENCE
Definition: resource.h:31
#define IDI_APPS
Definition: resource.h:11
#define IDS_CAT_GAMES
Definition: resource.h:171
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define IDI_APPUPD
Definition: resource.h:12
CSideTreeView * m_TreeView
Definition: gui.cpp:734

Referenced by InitControls().

◆ InitControls()

BOOL CMainWindow::InitControls ( )
inlineprivate

Definition at line 951 of file gui.cpp.

952  {
953  if (CreateLayout())
954  {
955 
958 
959  nSelectedApps = 0;
961 
962  return TRUE;
963  }
964 
965  return FALSE;
966  }
#define TRUE
Definition: types.h:120
VOID InitApplicationsList()
Definition: gui.cpp:757
INT nSelectedApps
Definition: gui.cpp:743
BOOL CreateLayout()
Definition: gui.cpp:906
VOID UpdateStatusBarText()
Definition: gui.cpp:1621
VOID InitCategoriesList()
Definition: gui.cpp:780

Referenced by ProcessWindowMessage().

◆ InsertSelectionFromHBITMAP()

void CMainWindow::InsertSelectionFromHBITMAP ( HBITMAP  bitmap,
HWND  window 
)

Definition at line 120 of file winproc.cpp.

121 {
122  int width = GetDIBWidth(bitmap);
123  int height = GetDIBHeight(bitmap);
124  int curWidth = imageModel.GetWidth();
125  int curHeight = imageModel.GetHeight();
126 
127  if (width > curWidth || height > curHeight)
128  {
129  BOOL shouldEnlarge = TRUE;
130 
131  if (askBeforeEnlarging)
132  {
133  TCHAR programname[20];
134  TCHAR shouldEnlargePromptText[100];
135 
136  LoadString(hProgInstance, IDS_PROGRAMNAME, programname, SIZEOF(programname));
137  LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, SIZEOF(shouldEnlargePromptText));
138 
139  switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
140  {
141  case IDYES:
142  break;
143  case IDNO:
144  shouldEnlarge = FALSE;
145  break;
146  case IDCANCEL:
147  return;
148  }
149  }
150 
151  if (shouldEnlarge)
152  {
153  if (width > curWidth)
154  curWidth = width;
155 
156  if (height > curHeight)
157  curHeight = height;
158 
159  imageModel.Crop(curWidth, curHeight, 0, 0);
160  }
161  }
162 
166 
169 
170  placeSelWin();
171  selectionWindow.ShowWindow(SW_SHOW);
173 }
GLint GLint GLsizei width
Definition: gl.h:1546
void CopyPrevious(void)
Definition: history.cpp:45
#define TRUE
Definition: types.h:120
CToolBox toolBoxContainer
Definition: main.cpp:65
#define IDYES
Definition: winuser.h:829
#define IDS_PROGRAMNAME
Definition: definitions.h:203
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
int GetDIBHeight(HBITMAP hBitmap)
Definition: dib.cpp:38
SelectionModel selectionModel
Definition: main.cpp:20
BOOL askBeforeEnlarging
Definition: main.cpp:33
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:124
int GetDIBWidth(HBITMAP hBitmap)
Definition: dib.cpp:30
#define SIZEOF(_ar)
Definition: calc.h:97
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDS_ENLARGEPROMPTTEXT
Definition: definitions.h:239
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
smooth NULL
Definition: ftsmooth.c:416
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MB_YESNOCANCEL
Definition: winuser.h:812
#define SW_SHOW
Definition: winuser.h:769
Definition: uimain.c:88
char TCHAR
Definition: xmlstorage.h:189
#define ID_RECTSEL
Definition: definitions.h:118
#define FindWindowEx
Definition: winuser.h:5676
void placeSelWin()
Definition: mouse.cpp:16
int GetWidth()
Definition: history.cpp:195
int GetHeight()
Definition: history.cpp:200
#define TB_CHECKBUTTON
Definition: commctrl.h:1015
ImageModel imageModel
Definition: main.cpp:32
HWND m_hWnd
Definition: atlwin.h:268
#define WM_COMMAND
Definition: winuser.h:1722
HINSTANCE hProgInstance
Definition: main.cpp:50
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void ForceRefreshSelectionContents()
Definition: selection.cpp:56
void InsertFromHBITMAP(HBITMAP hBm)
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
#define IDNO
Definition: winuser.h:830
#define IDCANCEL
Definition: winuser.h:825
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
Definition: atlwin.h:934
#define LoadString
Definition: winuser.h:5717
CSelectionWindow selectionWindow
Definition: main.cpp:70

Referenced by OnCommand().

◆ IsSelectedNodeInstalled()

BOOL CMainWindow::IsSelectedNodeInstalled ( )
inlineprivate

Definition at line 1358 of file gui.cpp.

1359  {
1360  HTREEITEM hSelectedItem = m_TreeView->GetSelection();
1361  TV_ITEM tItem;
1362 
1363  tItem.mask = TVIF_PARAM | TVIF_HANDLE;
1364  tItem.hItem = hSelectedItem;
1365  m_TreeView->GetItem(&tItem);
1366  switch (tItem.lParam)
1367  {
1368  case IDS_INSTALLED:
1369  case IDS_APPLICATIONS:
1370  case IDS_UPDATES:
1371  return TRUE;
1372  default:
1373  return FALSE;
1374  }
1375  }
#define TRUE
Definition: types.h:120
#define IDS_INSTALLED
Definition: resource.h:95
BOOL GetItem(TV_ITEM *pitem)
Definition: rosctrls.h:525
#define TVIF_HANDLE
Definition: commctrl.h:3242
#define IDS_APPLICATIONS
Definition: resource.h:98
#define TV_ITEM
Definition: commctrl.h:3272
#define IDS_UPDATES
Definition: resource.h:97
#define TVIF_PARAM
Definition: commctrl.h:3240
HTREEITEM GetSelection()
Definition: rosctrls.h:574
CSideTreeView * m_TreeView
Definition: gui.cpp:734

Referenced by ProcessWindowMessage().

◆ OnClose()

LRESULT CMainWindow::OnClose ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 205 of file winproc.cpp.

206 {
207  if (!imageModel.IsImageSaved())
208  {
209  CString strProgramName;
210  strProgramName.LoadString(IDS_PROGRAMNAME);
211  CPath pathFileName(filepathname);
212  pathFileName.StripPath();
213  CString strSavePromptText;
214  strSavePromptText.Format(IDS_SAVEPROMPTTEXT, (LPCTSTR)pathFileName);
215  switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
216  {
217  case IDNO:
218  DestroyWindow();
219  break;
220  case IDYES:
221  saveImage(FALSE);
222  if (imageModel.IsImageSaved())
223  DestroyWindow();
224  break;
225  }
226  }
227  else
228  {
229  DestroyWindow();
230  }
231  return 0;
232 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define IDYES
Definition: winuser.h:829
#define IDS_PROGRAMNAME
Definition: definitions.h:203
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
BOOL IsImageSaved()
Definition: history.cpp:168
void saveImage(BOOL overwrite)
Definition: winproc.cpp:88
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MB_YESNOCANCEL
Definition: winuser.h:812
#define IDS_SAVEPROMPTTEXT
Definition: definitions.h:208
TCHAR filepathname[1000]
Definition: main.cpp:52
ImageModel imageModel
Definition: main.cpp:32
BOOL DestroyWindow()
Definition: atlwin.h:428
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
#define IDNO
Definition: winuser.h:830
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
Definition: atlwin.h:934

◆ OnCommand() [1/2]

LRESULT CMainWindow::OnCommand ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 385 of file winproc.cpp.

386 {
387  switch (LOWORD(wParam))
388  {
389  case IDM_HELPINFO:
390  {
392  TCHAR infotitle[100];
393  TCHAR infotext[200];
394  LoadString(hProgInstance, IDS_INFOTITLE, infotitle, SIZEOF(infotitle));
395  LoadString(hProgInstance, IDS_INFOTEXT, infotext, SIZEOF(infotext));
396  ShellAbout(m_hWnd, infotitle, infotext, paintIcon);
397  DeleteObject(paintIcon);
398  break;
399  }
400  case IDM_HELPHELPTOPICS:
401  HtmlHelp(m_hWnd, _T("help\\Paint.chm"), 0, 0);
402  break;
403  case IDM_FILEEXIT:
405  break;
406  case IDM_FILENEW:
407  {
408  BOOL reset = TRUE;
409  if (!imageModel.IsImageSaved())
410  {
411  CString strProgramName;
412  strProgramName.LoadString(IDS_PROGRAMNAME);
413  CPath pathFileName(filepathname);
414  pathFileName.StripPath();
415  CString strSavePromptText;
416  strSavePromptText.Format(IDS_SAVEPROMPTTEXT, (LPCTSTR)pathFileName);
417  switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
418  {
419  case IDNO:
420  imageModel.imageSaved = TRUE; //TODO: move to ImageModel
421  break;
422  case IDYES:
423  saveImage(FALSE);
424  break;
425  case IDCANCEL:
426  reset = FALSE;
427  break;
428  }
429  }
430  if (reset && imageModel.IsImageSaved()) //TODO: move to ImageModel
431  {
432  imageModel.Clear();
434  }
435  break;
436  }
437  case IDM_FILEOPEN:
438  if (GetOpenFileName(&ofn) != 0)
439  {
440  HBITMAP bmNew = NULL;
442  if (bmNew != NULL)
443  {
445  }
446  }
447  break;
448  case IDM_FILESAVE:
449  saveImage(TRUE);
450  break;
451  case IDM_FILESAVEAS:
452  saveImage(FALSE);
453  break;
454  case IDM_FILEPAGESETUP:
455  // DUMMY: Shows the dialog only, no functionality
456  PAGESETUPDLG psd;
457  ZeroMemory(&psd, sizeof(psd));
458  psd.lStructSize = sizeof(psd);
459  psd.hwndOwner = m_hWnd;
460  PageSetupDlg(&psd);
461  break;
462  case IDM_FILEPRINT:
463  // TODO: Test whether it actually works
464  PRINTDLG pd;
465  ZeroMemory(&pd, sizeof(pd));
466  pd.lStructSize = sizeof(pd);
467  pd.hwndOwner = m_hWnd;
468  pd.hDevMode = NULL; // freed by user
469  pd.hDevNames = NULL; // freed by user
471  pd.nCopies = 1;
472  pd.nFromPage = 0xffff;
473  pd.nToPage = 0xffff;
474  pd.nMinPage = 1;
475  pd.nMaxPage = 0xffff;
476  if (PrintDlg(&pd) == TRUE)
477  {
479  DeleteDC(pd.hDC);
480  }
481  if (pd.hDevMode)
482  GlobalFree(pd.hDevMode);
483  if (pd.hDevNames)
484  GlobalFree(pd.hDevNames);
485  break;
488  break;
491  break;
494  break;
495  case IDM_FILE1:
496  {
497  HBITMAP bmNew = NULL;
499  if (bmNew != NULL)
500  {
502  }
503  break;
504  }
505  case IDM_FILE2:
506  {
507  HBITMAP bmNew = NULL;
509  if (bmNew != NULL)
510  {
512  }
513  break;
514  }
515  case IDM_FILE3:
516  {
517  HBITMAP bmNew = NULL;
519  if (bmNew != NULL)
520  {
522  }
523  break;
524  }
525  case IDM_FILE4:
526  {
527  HBITMAP bmNew = NULL;
529  if (bmNew != NULL)
530  {
532  }
533  break;
534  }
535  case IDM_EDITUNDO:
536  imageModel.Undo();
538  break;
539  case IDM_EDITREDO:
540  imageModel.Redo();
542  break;
543  case IDM_EDITCOPY:
544  OpenClipboard();
545  EmptyClipboard();
547  CloseClipboard();
548  break;
549  case IDM_EDITCUT:
550  /* Copy */
552  /* Delete selection */
554  break;
555  case IDM_EDITPASTE:
556  OpenClipboard();
558  {
560  }
561  CloseClipboard();
562  break;
564  {
565  /* remove selection window and already painted content using undo */
566  imageModel.Undo();
567  break;
568  }
569  case IDM_EDITSELECTALL:
570  {
574  //TODO: do this properly
578  break;
579  }
580  case IDM_EDITCOPYTO:
581  if (GetSaveFileName(&ofn) != 0)
583  break;
584  case IDM_EDITPASTEFROM:
585  if (GetOpenFileName(&ofn) != 0)
586  {
587  HBITMAP bmNew = NULL;
589  if (bmNew != NULL)
590  {
592  DeleteObject(bmNew);
593  }
594  }
595  break;
597  if (ChooseColor(&choosecolor))
599  break;
602  break;
605  break;
607  {
609  break;
610  }
615  break;
617  switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
618  {
619  case 1: /* flip horizontally */
620  if (selectionWindow.IsWindowVisible())
622  else
624  break;
625  case 2: /* flip vertically */
626  if (selectionWindow.IsWindowVisible())
628  else
630  break;
631  case 3: /* rotate 90 degrees */
632  break;
633  case 4: /* rotate 180 degrees */
634  if (selectionWindow.IsWindowVisible())
636  else
638  break;
639  case 5: /* rotate 270 degrees */
640  break;
641  }
642  break;
643  case IDM_IMAGEATTRIBUTES:
644  {
645  if (attributesDialog.DoModal(mainWindow.m_hWnd))
646  {
648  }
649  break;
650  }
652  {
653  if (stretchSkewDialog.DoModal(mainWindow.m_hWnd))
654  {
657  }
658  break;
659  }
660  case IDM_IMAGEDRAWOPAQUE:
662  break;
663  case IDM_IMAGECROP:
665  break;
666 
667  case IDM_VIEWTOOLBOX:
670  break;
672  paletteWindow.ShowWindow(paletteWindow.IsWindowVisible() ? SW_HIDE : SW_SHOW);
674  break;
675  case IDM_VIEWSTATUSBAR:
678  break;
679  case IDM_FORMATICONBAR:
680  textEditWindow.ShowWindow(textEditWindow.IsWindowVisible() ? SW_HIDE : SW_SHOW);
681  break;
682  case IDM_VIEWSHOWGRID:
683  showGrid = !showGrid;
685  break;
688  miniature.ShowWindow(showMiniature ? SW_SHOW : SW_HIDE);
689  break;
690 
691  case IDM_VIEWZOOM125:
692  zoomTo(125, 0, 0);
693  break;
694  case IDM_VIEWZOOM25:
695  zoomTo(250, 0, 0);
696  break;
697  case IDM_VIEWZOOM50:
698  zoomTo(500, 0, 0);
699  break;
700  case IDM_VIEWZOOM100:
701  zoomTo(1000, 0, 0);
702  break;
703  case IDM_VIEWZOOM200:
704  zoomTo(2000, 0, 0);
705  break;
706  case IDM_VIEWZOOM400:
707  zoomTo(4000, 0, 0);
708  break;
709  case IDM_VIEWZOOM800:
710  zoomTo(8000, 0, 0);
711  break;
712 
713  case IDM_VIEWFULLSCREEN:
714  fullscreenWindow.ShowWindow(SW_SHOW);
716  break;
717  }
718  return 0;
719 }
#define IDM_IMAGEROTATEMIRROR
Definition: definitions.h:101
void FlipHorizontally()
Definition: history.cpp:224
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define IDM_EDITUNDO
Definition: definitions.h:75
ToolsModel toolsModel
Definition: main.cpp:18
void CopyPrevious(void)
Definition: history.cpp:45
#define IDM_EDITPASTEFROM
Definition: definitions.h:84
static HICON
Definition: imagelist.c:84
#define IDM_IMAGEINVERTCOLORS
Definition: definitions.h:104
#define TRUE
Definition: types.h:120
CToolBox toolBoxContainer
Definition: main.cpp:65
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
void RotateNTimes90Degrees(int iN)
WORD nMaxPage
Definition: commdlg.h:474
int fileSize
Definition: main.cpp:54
#define IDM_VIEWZOOM125
Definition: definitions.h:90
long y
Definition: polytest.cpp:48
#define PageSetupDlg
Definition: commdlg.h:667
#define IDM_VIEWSHOWGRID
Definition: definitions.h:98
void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes)
Definition: dib.cpp:46
#define IDYES
Definition: winuser.h:829
long x
Definition: polytest.cpp:48
#define IDM_VIEWZOOM400
Definition: definitions.h:95
#define IDM_EDITSELECTALL
Definition: definitions.h:82
#define ChooseColor
Definition: commdlg.h:661
void endPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:218
BOOL showGrid
Definition: main.cpp:59
#define SW_HIDE
Definition: winuser.h:762
#define IDM_EDITCOPY
Definition: definitions.h:78
#define IDS_PROGRAMNAME
Definition: definitions.h:203
HWND hwndOwner
Definition: commdlg.h:434
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define IDM_IMAGECROP
Definition: definitions.h:103
#define IDM_VIEWCOLORPALETTE
Definition: definitions.h:87
OPENFILENAME ofn
Definition: main.cpp:37
void InvertColors()
Definition: history.cpp:205
#define IDM_EDITCOPYTO
Definition: definitions.h:83
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDM_COLORSEDITPALETTE
Definition: definitions.h:109
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
WORD nCopies
Definition: commdlg.h:475
CString strFile2
Definition: registry.h:31
#define IDM_VIEWSTATUSBAR
Definition: definitions.h:88
SelectionModel selectionModel
Definition: main.cpp:20
#define IDM_COLORSOLDPALETTE
Definition: definitions.h:111
BOOL IsImageSaved()
Definition: history.cpp:168
static void SetWallpaper(LPCTSTR szFileName, WallpaperStyle style)
Definition: registry.cpp:38
void Redo(void)
Definition: history.cpp:75
COLORREF rgbResult
Definition: commdlg.h:242
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define GetOpenFileName
Definition: commdlg.h:665
WPARAM wParam
Definition: combotst.c:138
#define IDM_IMAGEDELETEIMAGE
Definition: definitions.h:106
void whilePaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:125
#define IDM_FILEPAGESETUP
Definition: definitions.h:58
WORD nMinPage
Definition: commdlg.h:473
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:124
#define IDM_IMAGEATTRIBUTES
Definition: definitions.h:105
CImgAreaWindow imageArea
Definition: main.cpp:71
#define GetSaveFileName
Definition: commdlg.h:666
void LoadDIBFromFile(HBITMAP *hBitmap, LPCTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
Definition: dib.cpp:84
#define PrintDlg
Definition: commdlg.h:668
#define LR_COPYRETURNORG
Definition: winuser.h:1080
#define IDM_FILEPRINT
Definition: definitions.h:59
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define IDM_VIEWZOOM100
Definition: definitions.h:93
SYSTEMTIME fileTime
Definition: main.cpp:57
#define SIZEOF(_ar)
Definition: calc.h:97
CMirrorRotateDialog mirrorRotateDialog
Definition: dialogs.cpp:19
void startPaintingL(HDC hdc, LONG x, LONG y, COLORREF fg, COLORREF bg)
Definition: mouse.cpp:56
void ClearHistory(void)
Definition: history.cpp:102
#define IDM_FILE1
Definition: definitions.h:68
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDM_FILEASWALLPAPERCENTERED
Definition: definitions.h:64
void saveImage(BOOL overwrite)
Definition: winproc.cpp:88
#define IDM_VIEWFULLSCREEN
Definition: definitions.h:97
HDC GetDC()
Definition: history.cpp:219
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:98
#define CF_BITMAP
Definition: constants.h:397
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
CMiniatureWindow miniature
Definition: main.cpp:64
WORD nFromPage
Definition: commdlg.h:471
smooth NULL
Definition: ftsmooth.c:416
#define IDM_HELPHELPTOPICS
Definition: definitions.h:113
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MB_YESNOCANCEL
Definition: winuser.h:812
int fileHPPM
Definition: main.cpp:55
#define PD_RETURNDC
Definition: commdlg.h:155
#define IDM_VIEWZOOM25
Definition: definitions.h:91
CStretchSkewDialog stretchSkewDialog
Definition: dialogs.cpp:21
DWORD lStructSize
Definition: commdlg.h:433
#define IDS_SAVEPROMPTTEXT
Definition: definitions.h:208
#define SW_SHOW
Definition: winuser.h:769
#define IDS_INFOTEXT
Definition: definitions.h:206
#define IDM_FILE4
Definition: definitions.h:71
void SelectPalette(int nPalette)
void Insert(HBITMAP hbm)
Definition: history.cpp:108
#define IDS_INFOTITLE
Definition: definitions.h:205
char TCHAR
Definition: xmlstorage.h:189
void Clear(COLORREF color=0x00ffffff)
Definition: history.cpp:213
BOOL IsBackgroundTransparent()
Definition: toolsmodel.cpp:93
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
#define _T(x)
Definition: vfdio.h:22
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: definitions.h:65
void InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
Definition: winproc.cpp:120
#define ID_RECTSEL
Definition: definitions.h:118
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
Definition: history.cpp:183
#define FindWindowEx
Definition: winuser.h:5676
BOOL OpenClipboard()
Definition: atlwin.h:970
#define WM_CLOSE
Definition: winuser.h:1603
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:240
#define IDM_FORMATICONBAR
Definition: definitions.h:89
HGLOBAL hDevMode
Definition: commdlg.h:467
BOOL imageSaved
Definition: history.h:24
CFullscreenWindow fullscreenWindow
Definition: main.cpp:63
HWND hStatusBar
Definition: main.cpp:35
#define ShellAbout
Definition: shellapi.h:688
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL showMiniature
Definition: main.cpp:60
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
int GetWidth()
Definition: history.cpp:195
TCHAR filepathname[1000]
Definition: main.cpp:52
CAttributesDialog attributesDialog
Definition: dialogs.cpp:20
void alignChildrenToMainWindow()
Definition: winproc.cpp:51
int GetHeight()
Definition: history.cpp:200
#define IDM_VIEWZOOM50
Definition: definitions.h:92
#define IDM_FILEEXIT
Definition: definitions.h:73
#define TB_CHECKBUTTON
Definition: commctrl.h:1015
void SetFgColor(int newColor)
ImageModel imageModel
Definition: main.cpp:32
HWND m_hWnd
Definition: atlwin.h:268
#define IDM_FILEASWALLPAPERPLANE
Definition: definitions.h:63
#define IDM_EDITCUT
Definition: definitions.h:77
#define WM_COMMAND
Definition: winuser.h:1722
#define IDM_EDITPASTE
Definition: definitions.h:79
CPaletteWindow paletteWindow
Definition: main.cpp:67
HINSTANCE hProgInstance
Definition: main.cpp:50
#define IDI_APPICON
Definition: resource.h:166
CString strFile1
Definition: registry.h:30
#define IDM_IMAGESTRETCHSKEW
Definition: definitions.h:102
#define IDM_HELPINFO
Definition: definitions.h:114
HWND hwndOwner
Definition: commdlg.h:466
void UpdateApplicationProperties(HBITMAP bitmap, LPCTSTR newfilepathname)
Definition: winproc.cpp:105
CString strFile4
Definition: registry.h:33
#define IDM_IMAGEDRAWOPAQUE
Definition: definitions.h:107
#define IDM_EDITDELETESELECTION
Definition: definitions.h:80
#define IDM_COLORSMODERNPALETTE
Definition: definitions.h:110
#define IDM_EDITREDO
Definition: definitions.h:76
POINT percentage
Definition: dialogs.h:86
#define IDM_FILESAVEAS
Definition: definitions.h:53
GLboolean reset
Definition: glext.h:5666
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1265
#define IDM_FILE2
Definition: definitions.h:69
PaletteModel paletteModel
Definition: main.cpp:28
BOOL WINAPI DeleteDC(_In_ HDC)
#define IDM_FILESAVE
Definition: definitions.h:52
LPSTR lpstrFile
Definition: commdlg.h:336
HGLOBAL hDevNames
Definition: commdlg.h:468
#define IMAGE_BITMAP
Definition: winuser.h:211
HANDLE WINAPI GetClipboardData(_In_ UINT)
DWORD lStructSize
Definition: commdlg.h:465
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:828
void Undo(void)
Definition: history.cpp:57
void FlipVertically()
Definition: history.cpp:232
WORD nToPage
Definition: commdlg.h:472
#define IDM_FILEOPEN
Definition: definitions.h:51
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:21
#define IDM_FILE3
Definition: definitions.h:70
#define IDM_VIEWZOOM200
Definition: definitions.h:94
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:506
#define IDM_VIEWZOOM800
Definition: definitions.h:96
DWORD Flags
Definition: commdlg.h:470
#define IDM_FILENEW
Definition: definitions.h:50
static HBITMAP
Definition: button.c:44
#define LoadIcon
Definition: winuser.h:5711
#define IDNO
Definition: winuser.h:830
CTextEditWindow textEditWindow
Definition: main.cpp:80
CHOOSECOLOR choosecolor
Definition: main.cpp:36
#define IDCANCEL
Definition: winuser.h:825
RegistrySettings registrySettings
Definition: main.cpp:30
int MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
Definition: atlwin.h:934
#define HtmlHelp
Definition: htmlhelp.h:425
HDC hDC
Definition: commdlg.h:469
#define IDM_VIEWSHOWMINIATURE
Definition: definitions.h:99
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SRCCOPY
Definition: wingdi.h:332
#define LoadString
Definition: winuser.h:5717
int fileVPPM
Definition: main.cpp:56
struct Rect Rect
BOOL IsWindowVisible() const
Definition: atlwin.h:890
CSelectionWindow selectionWindow
Definition: main.cpp:70
#define IDM_VIEWTOOLBOX
Definition: definitions.h:86
CMainWindow mainWindow
Definition: main.cpp:62
CString strFile3
Definition: registry.h:32

Referenced by ProcessWindowMessage().

◆ OnCommand() [2/2]

VOID CMainWindow::OnCommand ( WPARAM  wParam,
LPARAM  lParam 
)
inlineprivate

Definition at line 1377 of file gui.cpp.

1378  {
1379  WORD wCommand = LOWORD(wParam);
1380 
1381  if (lParam == (LPARAM) m_SearchBar->m_hWnd)
1382  {
1383  ATL::CStringW szBuf;
1384 
1385  switch (HIWORD(wParam))
1386  {
1387  case EN_SETFOCUS:
1388  {
1389  ATL::CStringW szWndText;
1390 
1391  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1392  m_SearchBar->GetWindowTextW(szWndText);
1393  if (szBuf == szWndText)
1394  {
1396  m_SearchBar->SetWindowTextW(L"");
1397  }
1398  }
1399  break;
1400 
1401  case EN_KILLFOCUS:
1402  {
1403  m_SearchBar->GetWindowTextW(szBuf);
1404  if (szBuf.IsEmpty())
1405  {
1406  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1408  m_SearchBar->SetWindowTextW(szBuf.GetString());
1409  }
1410  }
1411  break;
1412 
1413  case EN_CHANGE:
1414  {
1415  ATL::CStringW szWndText;
1416 
1417  if (!bSearchEnabled)
1418  {
1419  bSearchEnabled = TRUE;
1420  break;
1421  }
1422 
1423  szBuf.LoadStringW(IDS_SEARCH_TEXT);
1424  m_SearchBar->GetWindowTextW(szWndText);
1425  if (szBuf == szWndText)
1426  {
1428  }
1429  else
1430  {
1431  szSearchPattern = szWndText;
1432  }
1433 
1434  DWORD dwDelay;
1435  SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
1436  SetTimer(SEARCH_TIMER_ID, dwDelay);
1437  }
1438  break;
1439  }
1440 
1441  return;
1442  }
1443 
1444  switch (wCommand)
1445  {
1446  case ID_OPEN_LINK:
1448  HeapFree(GetProcessHeap(), 0, pLink);
1449  break;
1450 
1451  case ID_COPY_LINK:
1453  HeapFree(GetProcessHeap(), 0, pLink);
1454  break;
1455 
1456  case ID_SETTINGS:
1458  break;
1459 
1460  case ID_EXIT:
1461  PostMessageW(WM_CLOSE, 0, 0);
1462  break;
1463 
1464  case ID_SEARCH:
1466  break;
1467 
1468  case ID_INSTALL:
1470  {
1471  if (nSelectedApps > 0)
1472  {
1476  }
1478  {
1480  }
1481 
1482  }
1483  break;
1484 
1485  case ID_UNINSTALL:
1486  if (UninstallApplication(-1, FALSE))
1488  break;
1489 
1490  case ID_MODIFY:
1491  if (UninstallApplication(-1, TRUE))
1493  break;
1494 
1495  case ID_REGREMOVE:
1497  break;
1498 
1499  case ID_REFRESH:
1501  break;
1502 
1503  case ID_RESETDB:
1506  break;
1507 
1508  case ID_HELP:
1509  MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
1510  break;
1511 
1512  case ID_ABOUT:
1513  ShowAboutDialog();
1514  break;
1515 
1516  case ID_CHECK_ALL:
1517  m_ListView->CheckAll();
1518  break;
1519  }
1520  }
#define TRUE
Definition: types.h:120
HWND SetFocus()
Definition: atlwin.h:1130
#define ID_REFRESH
Definition: resource.h:18
#define ID_SETTINGS
Definition: resource.h:78
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define ID_REGREMOVE
Definition: resource.h:80
VOID RemoveAppFromRegistry(INT Index)
Definition: installed.cpp:136
#define ID_RESETDB
Definition: resource.h:81
#define IDS_SEARCH_TEXT
Definition: resource.h:87
CAvailableApplicationInfo * GetSelectedData()
Definition: gui.cpp:626
#define ID_UNINSTALL
Definition: resource.h:72
WPARAM wParam
Definition: combotst.c:138
ATL::CStringW szSearchPattern
Definition: winmain.cpp:21
ATL::CSimpleArray< CAvailableApplicationInfo > GetSelected() const
Definition: available.cpp:427
BOOL bSearchEnabled
Definition: gui.cpp:745
LPWSTR pLink
Definition: gui.cpp:741
#define EN_KILLFOCUS
Definition: winuser.h:2007
#define EN_SETFOCUS
Definition: winuser.h:2009
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1190
INT nSelectedApps
Definition: gui.cpp:743
smooth NULL
Definition: ftsmooth.c:416
VOID SetSelected(INT item, BOOL value)
Definition: gui.cpp:575
LONG_PTR LPARAM
Definition: windef.h:208
BOOL IsAvailableEnum(INT x)
Definition: defines.h:64
#define ID_ABOUT
Definition: charmap.c:18
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define GetProcessHeap()
Definition: compat.h:395
VOID ShowAboutDialog()
Definition: aboutdlg.cpp:22
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define WM_CLOSE
Definition: winuser.h:1603
PCXSTR GetString() const
Definition: atlsimpstr.h:361
unsigned short WORD
Definition: ntddk_ex.h:93
VOID GetWindowTextW(ATL::CStringW &szText)
Definition: rosui.h:501
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ID_COPY_LINK
Definition: resource.h:77
#define ID_CHECK_ALL
Definition: resource.h:82
CUiWindow< CSearchBar > * m_SearchBar
Definition: gui.cpp:738
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
VOID CreateSettingsDlg(HWND hwnd)
static BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:930
static BOOL ForceUpdateAppsDB()
Definition: available.cpp:317
#define ID_EXIT
Definition: resource.h:10
VOID CopyTextToClipboard(LPCWSTR lpszText)
Definition: misc.cpp:49
CAvailableApps m_AvailableApps
Definition: gui.cpp:739
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define SEARCH_TIMER_ID
Definition: gui.cpp:25
#define ID_SEARCH
Definition: resource.h:83
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:1632
#define ID_INSTALL
Definition: resource.h:71
static BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:947
CAppsListView * m_ListView
Definition: gui.cpp:732
#define MB_OK
Definition: winuser.h:784
#define ID_OPEN_LINK
Definition: resource.h:76
VOID CheckAll()
Definition: gui.cpp:598
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2236
#define HIWORD(l)
Definition: typedefs.h:246
INT SelectedEnumType
Definition: winmain.cpp:18
#define ID_HELP
Definition: resource.h:28
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define ID_MODIFY
Definition: resource.h:75
#define HeapFree(x, y, z)
Definition: compat.h:394
BOOL UninstallApplication(INT Index, BOOL bModify)
Definition: installed.cpp:41
#define EN_CHANGE
Definition: winuser.h:2004

◆ OnCreate()

LRESULT CMainWindow::OnCreate ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 191 of file winproc.cpp.

192 {
195  return 0;
196 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
#define ICON_SMALL
Definition: tnclass.cpp:48
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hProgInstance
Definition: main.cpp:50
#define IDI_APPICON
Definition: resource.h:166
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
#define LoadIcon
Definition: winuser.h:5711
#define ICON_BIG
Definition: tnclass.cpp:51

◆ OnDestroy()

LRESULT CMainWindow::OnDestroy ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 198 of file winproc.cpp.

199 {
201  PostQuitMessage(0); /* send a WM_QUIT to the message queue */
202  return 0;
203 }
WINDOWPLACEMENT WindowPlacement
Definition: registry.h:28
BOOL GetWindowPlacement(WINDOWPLACEMENT *lpwndpl) const
Definition: atlwin.h:750
RegistrySettings registrySettings
Definition: main.cpp:30
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

◆ OnDropFiles()

LRESULT CMainWindow::OnDropFiles ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 175 of file winproc.cpp.

176 {
177  HDROP drophandle;
178  TCHAR droppedfile[MAX_PATH];
179  HBITMAP bmNew = NULL;
180  drophandle = (HDROP)wParam;
181  DragQueryFile(drophandle, 0, droppedfile, SIZEOF(droppedfile));
182  DragFinish(drophandle);
183  LoadDIBFromFile(&bmNew, droppedfile, &fileTime, &fileSize, &fileHPPM, &fileVPPM);
184  if (bmNew != NULL)
185  {
186  UpdateApplicationProperties(bmNew, droppedfile);
187  }
188  return 0;
189 }
int fileSize
Definition: main.cpp:54
WPARAM wParam
Definition: combotst.c:138
void LoadDIBFromFile(HBITMAP *hBitmap, LPCTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
Definition: dib.cpp:84
SYSTEMTIME fileTime
Definition: main.cpp:57
#define SIZEOF(_ar)
Definition: calc.h:97
smooth NULL
Definition: ftsmooth.c:416
int fileHPPM
Definition: main.cpp:55
char TCHAR
Definition: xmlstorage.h:189
#define MAX_PATH
Definition: compat.h:26
void UpdateApplicationProperties(HBITMAP bitmap, LPCTSTR newfilepathname)
Definition: winproc.cpp:105
#define DragQueryFile
Definition: shellapi.h:682
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:543
static HBITMAP
Definition: button.c:44
int fileVPPM
Definition: main.cpp:56

◆ OnGetMinMaxInfo()

LRESULT CMainWindow::OnGetMinMaxInfo ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 327 of file winproc.cpp.

328 {
330  mm->ptMinTrackSize.x = 330;
331  mm->ptMinTrackSize.y = 430;
332  return 0;
333 }
POINT ptMinTrackSize
Definition: winuser.h:3604
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
struct tagMINMAXINFO * LPMINMAXINFO
LPARAM lParam
Definition: combotst.c:139

◆ OnInitMenuPopup()

LRESULT CMainWindow::OnInitMenuPopup ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 234 of file winproc.cpp.

235 {
236  HMENU menu = GetMenu();
237  BOOL trueSelection = (selectionWindow.IsWindowVisible() && ((toolsModel.GetActiveTool() == TOOL_FREESEL) || (toolsModel.GetActiveTool() == TOOL_RECTSEL)));
238  switch (lParam)
239  {
240  case 0: /* File menu */
241  if ((HMENU)wParam != GetSubMenu(menu, 0))
242  break;
251  {
253  CPath pathFile1(registrySettings.strFile1);
254  pathFile1.CompactPathEx(30);
256  {
257  CPath pathFile2(registrySettings.strFile2);
258  pathFile2.CompactPathEx(30);
260  {
261  CPath pathFile3(registrySettings.strFile3);
262  pathFile3.CompactPathEx(30);
264  {
265  CPath pathFile4(registrySettings.strFile4);
266  pathFile4.CompactPathEx(30);
267  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE4, _T("4 ") + pathFile4);
268  }
269  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE3, _T("3 ") + pathFile3);
270  }
271  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE2, _T("2 ") + pathFile2);
272  }
273  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE1, _T("1 ") + pathFile1);
274  }
275  break;
276  case 1: /* Edit menu */
279  EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(trueSelection));
280  EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(trueSelection));
281  EnableMenuItem(menu, IDM_EDITDELETESELECTION, ENABLED_IF(trueSelection));
282  EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
283  EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
284  OpenClipboard();
286  CloseClipboard();
287  break;
288  case 2: /* View menu */
290  CheckMenuItem(menu, IDM_VIEWCOLORPALETTE, CHECKED_IF(paletteWindow.IsWindowVisible()));
292  CheckMenuItem(menu, IDM_FORMATICONBAR, CHECKED_IF(textEditWindow.IsWindowVisible()));
294 
297  break;
298  case 3: /* Image menu */
299  EnableMenuItem(menu, IDM_IMAGECROP, ENABLED_IF(selectionWindow.IsWindowVisible()));
301  break;
302  }
303 
311 
314  return 0;
315 }
BOOL isAFile
Definition: main.cpp:53
int SelectedPalette()
#define IDM_EDITUNDO
Definition: definitions.h:75
ToolsModel toolsModel
Definition: main.cpp:18
CToolBox toolBoxContainer
Definition: main.cpp:65
#define MF_BYCOMMAND
Definition: winuser.h:202
#define IDM_VIEWZOOM125
Definition: definitions.h:90
#define TOOL_TEXT
Definition: definitions.h:144
#define IDM_VIEWSHOWGRID
Definition: definitions.h:98
#define IDM_VIEWZOOM400
Definition: definitions.h:95
#define InsertMenu
Definition: winuser.h:5701
BOOL showGrid
Definition: main.cpp:59
#define IDM_EDITCOPY
Definition: definitions.h:78
#define IDM_IMAGECROP
Definition: definitions.h:103
#define IDM_VIEWCOLORPALETTE
Definition: definitions.h:87
#define MF_STRING
Definition: winuser.h:138
#define IDM_EDITCOPYTO
Definition: definitions.h:83
CString strFile2
Definition: registry.h:31
#define IDM_VIEWSTATUSBAR
Definition: definitions.h:88
#define IDM_COLORSOLDPALETTE
Definition: definitions.h:111
BOOL HasRedoSteps()
Definition: history.cpp:178
WPARAM wParam
Definition: combotst.c:138
int GetZoom()
Definition: toolsmodel.cpp:104
#define IDM_VIEWZOOM100
Definition: definitions.h:93
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define IDM_FILE1
Definition: definitions.h:68
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDM_FILEASWALLPAPERCENTERED
Definition: definitions.h:64
#define MF_BYPOSITION
Definition: winuser.h:203
#define CF_BITMAP
Definition: constants.h:397
smooth NULL
Definition: ftsmooth.c:416
#define IDM_VIEWZOOM25
Definition: definitions.h:91
#define IDM_FILE4
Definition: definitions.h:71
HMENU GetMenu() const
Definition: atlwin.h:636
BOOL IsBackgroundTransparent()
Definition: toolsmodel.cpp:93
#define _T(x)
Definition: vfdio.h:22
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: definitions.h:65
#define IDM_FILEMOSTRECENTLYUSEDFILE
Definition: definitions.h:67
BOOL OpenClipboard()
Definition: atlwin.h:970
#define IDM_FORMATICONBAR
Definition: definitions.h:89
HWND hStatusBar
Definition: main.cpp:35
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL showMiniature
Definition: main.cpp:60
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
#define IDM_EDITINVERTSELECTION
Definition: definitions.h:81
#define IDM_VIEWZOOM50
Definition: definitions.h:92
#define CHECKED_IF(a)
Definition: definitions.h:25
ImageModel imageModel
Definition: main.cpp:32
#define TOOL_FREESEL
Definition: definitions.h:135
#define IDM_FILEASWALLPAPERPLANE
Definition: definitions.h:63
#define IDM_EDITCUT
Definition: definitions.h:77
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define IDM_EDITPASTE
Definition: definitions.h:79
CPaletteWindow paletteWindow
Definition: main.cpp:67
BOOL HasUndoSteps()
Definition: history.cpp:173
CString strFile1
Definition: registry.h:30
#define TOOL_RECTSEL
Definition: definitions.h:136
CString strFile4
Definition: registry.h:33
#define IDM_IMAGEDRAWOPAQUE
Definition: definitions.h:107
#define IDM_EDITDELETESELECTION
Definition: definitions.h:80
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define IDM_COLORSMODERNPALETTE
Definition: definitions.h:110
#define IDM_EDITREDO
Definition: definitions.h:76
#define IDM_FILE2
Definition: definitions.h:69
PaletteModel paletteModel
Definition: main.cpp:28
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
int GetActiveTool()
Definition: toolsmodel.cpp:60
#define ENABLED_IF(a)
Definition: definitions.h:27
HANDLE WINAPI GetClipboardData(_In_ UINT)
#define IDM_FILE3
Definition: definitions.h:70
#define IDM_VIEWZOOM200
Definition: definitions.h:94
#define IDM_VIEWZOOM800
Definition: definitions.h:96
CTextEditWindow textEditWindow
Definition: main.cpp:80
RegistrySettings registrySettings
Definition: main.cpp:30
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define IDM_VIEWSHOWMINIATURE
Definition: definitions.h:99
LPARAM lParam
Definition: combotst.c:139
BOOL IsWindowVisible() const
Definition: atlwin.h:890
CSelectionWindow selectionWindow
Definition: main.cpp:70
#define IDM_VIEWTOOLBOX
Definition: definitions.h:86
CString strFile3
Definition: registry.h:32

◆ OnKeyDown()

LRESULT CMainWindow::OnKeyDown ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 342 of file winproc.cpp.

343 {
344  if (wParam == VK_ESCAPE)
345  {
346  HWND hwndCapture = GetCapture();
347  if (hwndCapture)
348  {
349  if (selectionWindow.m_hWnd == hwndCapture ||
350  imageArea.m_hWnd == hwndCapture ||
351  fullscreenWindow.m_hWnd == hwndCapture ||
352  sizeboxLeftTop.m_hWnd == hwndCapture ||
353  sizeboxCenterTop.m_hWnd == hwndCapture ||
354  sizeboxRightTop.m_hWnd == hwndCapture ||
355  sizeboxLeftCenter.m_hWnd == hwndCapture ||
356  sizeboxRightCenter.m_hWnd == hwndCapture ||
357  sizeboxLeftBottom.m_hWnd == hwndCapture ||
358  sizeboxCenterBottom.m_hWnd == hwndCapture ||
359  sizeboxRightBottom.m_hWnd == hwndCapture)
360  {
361  SendMessage(hwndCapture, nMsg, wParam, lParam);
362  }
363  }
364  else
365  {
366  switch (toolsModel.GetActiveTool())
367  {
368  case TOOL_SHAPE: case TOOL_BEZIER:
370  break;
371  }
372  }
373  }
374  return 0;
375 }
ToolsModel toolsModel
Definition: main.cpp:18
CSizeboxWindow sizeboxRightCenter
Definition: main.cpp:76
#define TOOL_SHAPE
Definition: definitions.h:148
#define VK_ESCAPE
Definition: winuser.h:2189
WPARAM wParam
Definition: combotst.c:138
CImgAreaWindow imageArea
Definition: main.cpp:71
CSizeboxWindow sizeboxCenterTop
Definition: main.cpp:73
CSizeboxWindow sizeboxRightTop
Definition: main.cpp:74
CSizeboxWindow sizeboxCenterBottom
Definition: main.cpp:78
#define TOOL_BEZIER
Definition: definitions.h:146
HWND WINAPI GetCapture(void)
Definition: message.c:2879
CSizeboxWindow sizeboxRightBottom
Definition: main.cpp:79
CFullscreenWindow fullscreenWindow
Definition: main.cpp:63
CSizeboxWindow sizeboxLeftCenter
Definition: main.cpp:75
HWND m_hWnd
Definition: atlwin.h:268
CSizeboxWindow sizeboxLeftBottom
Definition: main.cpp:77
int GetActiveTool()
Definition: toolsmodel.cpp:60
CSizeboxWindow sizeboxLeftTop
Definition: main.cpp:72
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
LPARAM lParam
Definition: combotst.c:139
CSelectionWindow selectionWindow
Definition: main.cpp:70

◆ OnLink()

virtual VOID CMainWindow::OnLink ( ENLINK Link)
inlineprivatevirtual

Definition at line 1331 of file gui.cpp.

1332  {
1333  switch (Link->msg)
1334  {
1335  case WM_LBUTTONUP:
1336  case WM_RBUTTONUP:
1337  {
1338  if (pLink) HeapFree(GetProcessHeap(), 0, pLink);
1339 
1341  (max(Link->chrg.cpMin, Link->chrg.cpMax) -
1342  min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR));
1343  if (!pLink)
1344  {
1345  /* TODO: Error message */
1346  return;
1347  }
1348 
1349  m_RichEdit->SendMessageW(EM_SETSEL, Link->chrg.cpMin, Link->chrg.cpMax);
1350  m_RichEdit->SendMessageW(EM_GETSELTEXT, 0, (LPARAM) pLink);
1351 
1352  ShowPopupMenu(m_RichEdit->m_hWnd, IDR_LINKMENU, -1);
1353  }
1354  break;
1355  }
1356  }
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:89
#define max(a, b)
Definition: svc.c:63
static int Link(const char **args)
Definition: vfdcmd.c:2414
LPWSTR pLink
Definition: gui.cpp:741
LONG_PTR LPARAM
Definition: windef.h:208
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define EM_SETSEL
Definition: winuser.h:2000
#define WM_RBUTTONUP
Definition: winuser.h:1762
CUiWindow< CRichEdit > * m_RichEdit
Definition: gui.cpp:736
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define min(a, b)
Definition: monoChain.cc:55
#define IDR_LINKMENU
Definition: resource.h:66
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define EM_GETSELTEXT
Definition: richedit.h:95
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by ProcessWindowMessage().

◆ OnSetCursor()

LRESULT CMainWindow::OnSetCursor ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 335 of file winproc.cpp.

336 {
338  bHandled = FALSE;
339  return 0;
340 }
smooth NULL
Definition: ftsmooth.c:416
#define LoadCursor
Definition: winuser.h:5710
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define IDC_ARROW
Definition: winuser.h:682

◆ OnSize() [1/2]

LRESULT CMainWindow::OnSize ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 317 of file winproc.cpp.

318 {
319  int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 };
323  Invalidate(TRUE);
324  return 0;
325 }
#define TRUE
Definition: types.h:120
#define test
Definition: rosglue.h:37
WPARAM wParam
Definition: combotst.c:138
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_SIZE
Definition: winuser.h:1593
HWND hStatusBar
Definition: main.cpp:35
void alignChildrenToMainWindow()
Definition: winproc.cpp:51
#define SB_SETPARTS
Definition: commctrl.h:1926
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:828
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by ProcessWindowMessage().

◆ OnSize() [2/2]

VOID CMainWindow::OnSize ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
inlineprivate

Definition at line 968 of file gui.cpp.

969  {
970  if (wParam == SIZE_MINIMIZED)
971  return;
972 
973  /* Size status bar */
974  m_StatusBar->SendMessage(WM_SIZE, 0, 0);
975 
976  /* Size tool bar */
977  m_Toolbar->AutoSize();
978 
979  /* Automatically hide captions */
980  DWORD dToolbarTreshold = m_Toolbar->GetMaxButtonsWidth();
981  DWORD dSearchbarMargin = (LOWORD(lParam) - m_SearchBar->m_Width);
982 
983  if (dSearchbarMargin > dToolbarTreshold)
984  {
986  }
987  else if (dSearchbarMargin < dToolbarTreshold)
988  {
990  }
991 
992  RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
993  HDWP hdwp = NULL;
995 
996  hdwp = BeginDeferWindowPos(count);
997  if (hdwp)
998  {
999  hdwp = m_ClientPanel->OnParentSize(r, hdwp);
1000  if (hdwp)
1001  {
1002  EndDeferWindowPos(hdwp);
1003  }
1004 
1005  }
1006 
1007  // TODO: Sub-layouts for children of children
1009  hdwp = BeginDeferWindowPos(count);
1010  if (hdwp)
1011  {
1012  hdwp = m_SearchBar->OnParentSize(r, hdwp);
1013  if (hdwp)
1014  {
1015  EndDeferWindowPos(hdwp);
1016  }
1017  }
1018 
1019  }
DWORD GetMaxButtonsWidth() const
Definition: gui.cpp:375
HDWP WINAPI BeginDeferWindowPos(_In_ int)
VOID ShowButtonCaption()
Definition: gui.cpp:369
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:472
GLuint GLuint GLsizei count
Definition: gl.h:1545
const INT m_Width
Definition: gui.cpp:695
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:417
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
smooth NULL
Definition: ftsmooth.c:416
DWORD AutoSize()
Definition: rosctrls.h:358
#define WM_SIZE
Definition: winuser.h:1593
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SIZE_MINIMIZED
Definition: winuser.h:2481
CUiWindow< CSearchBar > * m_SearchBar
Definition: gui.cpp:738
VOID HideButtonCaption()
Definition: gui.cpp:363
CMainToolbar * m_Toolbar
Definition: gui.cpp:731
#define HIWORD(l)
Definition: typedefs.h:246
CUiPanel * m_ClientPanel
Definition: gui.cpp:727
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:403
LPARAM lParam
Definition: combotst.c:139
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:477
#define LOWORD(l)
Definition: pedump.c:82
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.cpp:735

◆ OnSysColorChange()

LRESULT CMainWindow::OnSysColorChange ( UINT  nMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)

Definition at line 377 of file winproc.cpp.

378 {
379  /* Redirect message to common controls */
381  SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0);
382  return 0;
383 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
CToolBox toolBoxContainer
Definition: main.cpp:65
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
smooth NULL
Definition: ftsmooth.c:416
#define FindWindowEx
Definition: winuser.h:5676
HWND m_hWnd
Definition: atlwin.h:268
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048

◆ ProcessWindowMessage()

BOOL CMainWindow::ProcessWindowMessage ( HWND  hwnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT theResult,
DWORD  dwMapId 
)
inlineprivatevirtual

Implements ATL::CMessageMap.

Definition at line 1021 of file gui.cpp.

1022  {
1023  theResult = 0;
1024  switch (Msg)
1025  {
1026  case WM_CREATE:
1027  if (!InitControls())
1028  ::PostMessageW(hwnd, WM_CLOSE, 0, 0);
1029  break;
1030 
1031  case WM_DESTROY:
1032  {
1034  SaveSettings(hwnd);
1035 
1036  FreeLogs();
1038 
1041 
1042  delete m_ClientPanel;
1043 
1044  PostQuitMessage(0);
1045  return 0;
1046  }
1047 
1048  case WM_COMMAND:
1050  break;
1051 
1052  case WM_NOTIFY:
1053  {
1054  LPNMHDR data = (LPNMHDR) lParam;
1055 
1056  switch (data->code)
1057  {
1058  case TVN_SELCHANGED:
1059  {
1060  if (data->hwndFrom == m_TreeView->m_hWnd)
1061  {
1062  switch (((LPNMTREEVIEW) lParam)->itemNew.lParam)
1063  {
1064  case IDS_INSTALLED:
1066  break;
1067 
1068  case IDS_APPLICATIONS:
1070  break;
1071 
1072  case IDS_UPDATES:
1074  break;
1075 
1076  case IDS_AVAILABLEFORINST:
1078  break;
1079 
1080  case IDS_CAT_AUDIO:
1082  break;
1083 
1084  case IDS_CAT_DEVEL:
1086  break;
1087 
1088  case IDS_CAT_DRIVERS:
1090  break;
1091 
1092  case IDS_CAT_EDU:
1094  break;
1095 
1096  case IDS_CAT_ENGINEER:
1098  break;
1099 
1100  case IDS_CAT_FINANCE:
1102  break;
1103 
1104  case IDS_CAT_GAMES:
1106  break;
1107 
1108  case IDS_CAT_GRAPHICS:
1110  break;
1111 
1112  case IDS_CAT_INTERNET:
1114  break;
1115 
1116  case IDS_CAT_LIBS:
1118  break;
1119 
1120  case IDS_CAT_OFFICE:
1122  break;
1123 
1124  case IDS_CAT_OTHER:
1126  break;
1127 
1128  case IDS_CAT_SCIENCE:
1130  break;
1131 
1132  case IDS_CAT_TOOLS:
1134  break;
1135 
1136  case IDS_CAT_VIDEO:
1138  break;
1139 
1140  case IDS_CAT_THEMES:
1142  break;
1143 
1144  case IDS_SELECTEDFORINST:
1146  break;
1147  }
1148  }
1149 
1150  HMENU mainMenu = ::GetMenu(hwnd);
1151  HMENU lvwMenu = ::GetMenu(m_ListView->m_hWnd);
1152 
1153  /* Disable/enable items based on treeview selection */
1155  {
1157  EnableMenuItem(mainMenu, ID_INSTALL, MF_GRAYED);
1159  EnableMenuItem(mainMenu, ID_MODIFY, MF_ENABLED);
1160 
1162  EnableMenuItem(lvwMenu, ID_INSTALL, MF_GRAYED);
1164  EnableMenuItem(lvwMenu, ID_MODIFY, MF_ENABLED);
1165 
1166  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, TRUE);
1167  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE);
1168  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE);
1169  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE);
1170  }
1171  else
1172  {
1174  EnableMenuItem(mainMenu, ID_INSTALL, MF_ENABLED);
1176  EnableMenuItem(mainMenu, ID_MODIFY, MF_GRAYED);
1177 
1181  EnableMenuItem(lvwMenu, ID_MODIFY, MF_GRAYED);
1182 
1183  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, FALSE);
1184  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE);
1185  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, FALSE);
1186  m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE);
1187  }
1188  }
1189  break;
1190 
1191  case LVN_ITEMCHANGED:
1192  {
1193  LPNMLISTVIEW pnic = (LPNMLISTVIEW) lParam;
1194 
1195  if (pnic->hdr.hwndFrom == m_ListView->m_hWnd)
1196  {
1197  /* Check if this is a valid item
1198  * (technically, it can be also an unselect) */
1199  INT ItemIndex = pnic->iItem;
1200  if (ItemIndex == -1 ||
1201  ItemIndex >= ListView_GetItemCount(pnic->hdr.hwndFrom))
1202  {
1203  break;
1204  }
1205 
1206  /* Check if the focus has been moved to another item */
1207  if ((pnic->uChanged & LVIF_STATE) &&
1208  (pnic->uNewState & LVIS_FOCUSED) &&
1209  !(pnic->uOldState & LVIS_FOCUSED))
1210  {
1212  ShowInstalledAppInfo(ItemIndex);
1215  }
1216  /* Check if the item is checked */
1217  if ((pnic->uNewState & LVIS_STATEIMAGEMASK) && !bUpdating)
1218  {
1219  BOOL checked = m_ListView->GetCheckState(pnic->iItem);
1220  /* FIXME: HAX!
1221  - preventing decremention below zero as a safeguard for ReactOS
1222  In ReactOS this action is triggered whenever user changes *selection*, but should be only when *checkbox* state toggled
1223  Maybe LVIS_STATEIMAGEMASK is set incorrectly
1224  */
1225  nSelectedApps +=
1226  (checked)
1227  ? 1
1228  : ((nSelectedApps > 0)
1229  ? -1
1230  : 0);
1231 
1232  /* Update item's selection status */
1233  m_ListView->SetSelected(pnic->iItem, checked);
1234 
1236  }
1237  }
1238  }
1239  break;
1240 
1241  case LVN_COLUMNCLICK:
1242  {
1243  LPNMLISTVIEW pnmv = (LPNMLISTVIEW) lParam;
1244 
1245  m_ListView->ColumnClick(pnmv);
1246  }
1247  break;
1248 
1249  case NM_CLICK:
1250  {
1251  if (data->hwndFrom == m_ListView->m_hWnd && ((LPNMLISTVIEW) lParam)->iItem != -1)
1252  {
1257  }
1258  }
1259  break;
1260 
1261  case NM_DBLCLK:
1262  {
1263  if (data->hwndFrom == m_ListView->m_hWnd && ((LPNMLISTVIEW) lParam)->iItem != -1)
1264  {
1265  /* this won't do anything if the program is already installed */
1267  }
1268  }
1269  break;
1270 
1271  case NM_RCLICK:
1272  {
1273  if (data->hwndFrom == m_ListView->m_hWnd && ((LPNMLISTVIEW) lParam)->iItem != -1)
1274  {
1275  ShowPopupMenu(m_ListView->m_hWnd, 0, ID_INSTALL);
1276  }
1277  }
1278  break;
1279 
1280  case EN_LINK:
1281  OnLink((ENLINK*) lParam);
1282  break;
1283 
1284  case TTN_GETDISPINFO:
1286  break;
1287  }
1288  }
1289  break;
1290 
1291  case WM_SIZE:
1292  OnSize(hwnd, wParam, lParam);
1293  break;
1294 
1295  case WM_SIZING:
1296  {
1297  LPRECT pRect = (LPRECT) lParam;
1298 
1299  if (pRect->right - pRect->left < 565)
1300  pRect->right = pRect->left + 565;
1301 
1302  if (pRect->bottom - pRect->top < 300)
1303  pRect->bottom = pRect->top + 300;
1304 
1305  return TRUE;
1306  }
1307 
1308  case WM_SYSCOLORCHANGE:
1309  {
1310  /* Forward WM_SYSCOLORCHANGE to common controls */
1311  m_ListView->SendMessageW(WM_SYSCOLORCHANGE, 0, 0);
1312  m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, 0, 0);
1313  m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, 0, 0);
1315  }
1316  break;
1317 
1318  case WM_TIMER:
1319  if (wParam == SEARCH_TIMER_ID)
1320  {
1322  if (bSearchEnabled)
1324  }
1325  break;
1326  }
1327 
1328  return FALSE;
1329  }
VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem)
Definition: misc.cpp:89
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
VOID OnGetDispInfo(LPTOOLTIPTEXT lpttt)
Definition: gui.cpp:269
#define TRUE
Definition: types.h:120
BOOL InitControls()
Definition: gui.cpp:951
UINT uNewState
Definition: commctrl.h:3008
#define ID_REGREMOVE
Definition: resource.h:80
#define SW_HIDE
Definition: winuser.h:762
#define IDS_CAT_DEVEL
Definition: resource.h:166
BOOL bUpdating
Definition: gui.cpp:746
#define LVN_ITEMCHANGED
Definition: commctrl.h:3103
LONG top
Definition: windef.h:292
#define LPNMTREEVIEW
Definition: commctrl.h:3615
#define IDS_CAT_OFFICE
Definition: resource.h:175
LONG left
Definition: windef.h:291
#define IDS_CAT_VIDEO
Definition: resource.h:179
VOID FreeLogs()
Definition: misc.cpp:247
LONG right
Definition: windef.h:293
#define IDS_CAT_FINANCE
Definition: resource.h:170
#define ID_UNINSTALL
Definition: resource.h:72
int32_t INT
Definition: typedefs.h:56
DWORD WINAPI GetSysColor(_In_ int)
WPARAM wParam
Definition: combotst.c:138
#define IDS_AVAILABLEFORINST
Definition: resource.h:96
struct tagNMHDR * LPNMHDR
#define IDS_INSTALLED
Definition: resource.h:95
VOID ColumnClick(LPNMLISTVIEW pnmv)
Definition: gui.cpp:419
BOOL IsSelectedNodeInstalled()
Definition: gui.cpp:1358
BOOL bSearchEnabled
Definition: gui.cpp:745
void SaveSettings(void)
Definition: settings.c:113
VOID FreeInstalledAppList()
Definition: gui.cpp:1522
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TTN_GETDISPINFO
Definition: commctrl.h:1850
#define TB_ENABLEBUTTON
Definition: commctrl.h:1014
BOOL KillTimer(UINT_PTR nIDEvent)
Definition: atlwin.h:908
VOID FreeCachedEntries()
Definition: available.cpp:249
#define WM_SIZING
Definition: winuser.h:1789
virtual VOID OnLink(ENLINK *Link)
Definition: gui.cpp:1331
BOOL GetCheckState(INT item)
Definition: gui.cpp:561
INT nSelectedApps
Definition: gui.cpp:743
VOID SetSelected(INT item, BOOL value)
Definition: gui.cpp:575
UINT uOldState
Definition: commctrl.h:3009
#define LPRECT
Definition: precomp.h:28
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
#define IDS_SELECTEDFORINST
Definition: resource.h:114
BOOL IsAvailableEnum(INT x)
Definition: defines.h:64
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define IDS_CAT_INTERNET
Definition: resource.h:173
#define LVIS_STATEIMAGEMASK
Definition: commctrl.h:2298
static BOOL ShowAvailableAppInfo(INT Index)
Definition: gui.cpp:189
#define WM_DESTROY
Definition: winuser.h:1591
#define IDS_CAT_DRIVERS
Definition: resource.h:167
#define LPTOOLTIPTEXT
Definition: commctrl.h:1862
HMENU GetMenu() const
Definition: atlwin.h:636
#define IDS_CAT_OTHER
Definition: resource.h:176
#define WM_SIZE
Definition: winuser.h:1593
#define TVN_SELCHANGED
Definition: commctrl.h:3707
#define WM_TIMER
Definition: winuser.h:1724
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1603
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BOOL IsInstalledEnum(INT x)
Definition: defines.h:69
#define IDS_CAT_LIBS
Definition: resource.h:174
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:317
#define IDS_CAT_THEMES
Definition: resource.h:180
#define COLOR_BTNFACE
Definition: winuser.h:918
VOID UpdateStatusBarText()
Definition: gui.cpp:1621
#define IDS_CAT_SCIENCE
Definition: resource.h:177
#define IDS_CAT_GRAPHICS
Definition: resource.h:172
#define IDS_CAT_AUDIO
Definition: resource.h:165
#define WM_COMMAND
Definition: winuser.h:1722
HWND hwndFrom
Definition: winuser.h:3131
#define NM_CLICK
Definition: commctrl.h:130
struct @1574 Msg[]
#define IDS_CAT_EDU
Definition: resource.h:168
#define IDS_CAT_ENGINEER
Definition: resource.h:169
CAvailableApps m_AvailableApps
Definition: gui.cpp:739
#define IDS_APPLICATIONS
Definition: resource.h:98
#define SEARCH_TIMER_ID
Definition: gui.cpp:25
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:1632
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1265
#define NM_DBLCLK
Definition: commctrl.h:131
#define ID_INSTALL
Definition: resource.h:71
CMainToolbar * m_Toolbar
Definition: gui.cpp:731
struct tagNMLISTVIEW * LPNMLISTVIEW
#define NM_RCLICK
Definition: commctrl.h:133
#define EN_LINK
Definition: richedit.h:202
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
CAppsListView * m_ListView
Definition: gui.cpp:732
#define IDS_UPDATES
Definition: resource.h:97
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:385
#define LVN_COLUMNCLICK
Definition: commctrl.h:3111
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_CAT_TOOLS
Definition: resource.h:178
#define WM_CREATE
Definition: winuser.h:1590
LONG bottom
Definition: windef.h:294
INT SelectedEnumType
Definition: winmain.cpp:18
BOOL ShowInstalledAppInfo(INT Index)
Definition: installed.cpp:95
#define MF_GRAYED
Definition: winuser.h:129
#define LVIF_STATE
Definition: commctrl.h:2284
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
CUiPanel * m_ClientPanel
Definition: gui.cpp:727
#define IDS_CAT_GAMES
Definition: resource.h:171
LPARAM lParam
Definition: combotst.c:139
#define ID_MODIFY
Definition: resource.h:75
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define LVIS_FOCUSED
Definition: commctrl.h:2290
#define WM_NOTIFY
Definition: richedit.h:61
CSideTreeView * m_TreeView
Definition: gui.cpp:734

◆ s_EnumAvailableAppProc()

static BOOL CALLBACK CMainWindow::s_EnumAvailableAppProc ( CAvailableApplicationInfo Info,
LPCWSTR  szFolderPath 
)
inlinestaticprivate

Definition at line 1579 of file gui.cpp.

1580  {
1581  INT Index;
1582  HICON hIcon = NULL;
1583 
1585 
1586  if (!SearchPatternMatch(Info->m_szName.GetString(), szSearchPattern) &&
1588  {
1589  return TRUE;
1590  }
1591 
1592  /* Load icon from file */
1593  ATL::CStringW szIconPath;
1594  szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath, Info->m_szName.GetString());
1595  hIcon = (HICON) LoadImageW(NULL,
1596  szIconPath.GetString(),
1597  IMAGE_ICON,
1600  LR_LOADFROMFILE);
1601 
1602  if (!hIcon || GetLastError() != ERROR_SUCCESS)
1603  {
1604  /* Load default icon */
1606  }
1607 
1608  Index = ImageList_AddIcon(hImageListView, hIcon);
1609  DestroyIcon(hIcon);
1610 
1611  Index = ListViewAddItem(Info->m_Category, Index, Info->m_szName.GetString(), (LPARAM) Info);
1612  ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL);
1613 
1614  ListView_SetItemText(hListView, Index, 1, const_cast<LPWSTR>(Info->m_szVersion.GetString()));
1615  ListView_SetItemText(hListView, Index, 2, const_cast<LPWSTR>(Info->m_szDesc.GetString()));
1616  ListView_SetCheckState(hListView, Index, Info->m_IsSelected);
1617 
1618  return TRUE;
1619  }
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define IMAGE_ICON
Definition: winuser.h:212
#define LVSIL_SMALL
Definition: commctrl.h:2271
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define LR_LOADFROMFILE
Definition: winuser.h:1082
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:668
int32_t INT
Definition: typedefs.h:56
ATL::CStringW szSearchPattern
Definition: winmain.cpp:21
struct TraceInfo Info
#define ListView_GetImageList(hwnd, iImageList)
Definition: commctrl.h:2268
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define LISTVIEW_ICON_SIZE
Definition: gui.cpp:26
#define ListView_SetImageList(hwnd, himl, iImageList)
Definition: commctrl.h:2276
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
Definition: commctrl.h:2663
INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam)
Definition: gui.cpp:1792