ReactOS  0.4.15-dev-3723-g8d70159
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)
 
LRESULT OnMouseWheel (UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
void alignChildrenToMainWindow ()
 
void saveImage (BOOL overwrite)
 
void InsertSelectionFromHBITMAP (HBITMAP bitmap, HWND window)
 
BOOL ConfirmSave ()
 
 CMainWindow ()
 
 ~CMainWindow ()
 
HWND Create ()
 
BOOL ItemCheckStateChanged (BOOL bChecked, LPVOID CallbackParam)
 
BOOL InstallApplication (CAvailableApplicationInfo *Info)
 
BOOL SearchTextChanged (ATL::CStringW &SearchText)
 
void HandleTabOrder (int direction)
 
- 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)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
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 (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ 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 (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
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)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
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 InitCategoriesList ()
 
BOOL CreateStatusBar ()
 
BOOL CreateTreeView ()
 
BOOL CreateApplicationView ()
 
BOOL CreateVSplitter ()
 
BOOL CreateLayout ()
 
VOID LayoutCleanup ()
 
BOOL InitControls ()
 
VOID OnSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
BOOL RemoveSelectedAppFromRegistry ()
 
BOOL UninstallSelectedApp (BOOL bModify)
 
BOOL ProcessWindowMessage (HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT &theResult, DWORD dwMapId)
 
BOOL IsSelectedNodeInstalled ()
 
VOID ShowAboutDlg ()
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 
BOOL CALLBACK EnumInstalledAppProc (CInstalledApplicationInfo *Info)
 
BOOL CALLBACK EnumAvailableAppProc (CAvailableApplicationInfo *Info, BOOL bInitialCheckState)
 
VOID UpdateStatusBarText ()
 
VOID UpdateApplicationsList (INT EnumType)
 

Static Private Member Functions

static BOOL CALLBACK s_EnumInstalledAppProc (CInstalledApplicationInfo *Info, PVOID param)
 
static BOOL CALLBACK s_EnumAvailableAppProc (CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
 
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc (CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
 

Private Attributes

CUiPanelm_ClientPanel = NULL
 
CUiSplitPanelm_VSplitter = NULL
 
CSideTreeViewm_TreeView = NULL
 
CUiWindow< CStatusBar > * m_StatusBar = NULL
 
CApplicationViewm_ApplicationView = NULL
 
CAvailableApps m_AvailableApps
 
CInstalledApps m_InstalledApps
 
BOOL bUpdating = FALSE
 
ATL::CStringW szSearchPattern
 
INT SelectedEnumType
 

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 ( )

Definition at line 95 of file gui.cpp.

95  :
98 {
99 }
INT SelectedEnumType
Definition: gui.h:63
#define NULL
Definition: types.h:112
CUiPanel * m_ClientPanel
Definition: gui.h:49

◆ ~CMainWindow()

CMainWindow::~CMainWindow ( )

Definition at line 101 of file gui.cpp.

102 {
103  LayoutCleanup();
104 }
VOID LayoutCleanup()
Definition: gui.cpp:220

Member Function Documentation

◆ alignChildrenToMainWindow()

void CMainWindow::alignChildrenToMainWindow ( )

Definition at line 48 of file winproc.cpp.

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

Referenced by OnCommand(), and OnSize().

◆ ConfirmSave()

BOOL CMainWindow::ConfirmSave ( )

Definition at line 239 of file winproc.cpp.

240 {
241  if (imageModel.IsImageSaved())
242  return TRUE;
243 
244  CString strProgramName;
245  strProgramName.LoadString(IDS_PROGRAMNAME);
246 
247  CString strSavePromptText;
249 
250  switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
251  {
252  case IDYES:
253  saveImage(TRUE);
254  return imageModel.IsImageSaved();
255  case IDNO:
256  return TRUE;
257  case IDCANCEL:
258  return FALSE;
259  }
260 
261  return TRUE;
262 }
#define IDYES
Definition: winuser.h:829
#define TRUE
Definition: types.h:120
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
#define FALSE
Definition: types.h:117
void saveImage(BOOL overwrite)
Definition: winproc.cpp:90
#define IDS_SAVEPROMPTTEXT
Definition: resource.h:184
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MB_YESNOCANCEL
Definition: winuser.h:812
#define PathFindFileName
Definition: shlwapi.h:911
TCHAR filepathname[1000]
Definition: main.cpp:52
ImageModel imageModel
Definition: main.cpp:32
#define IDS_PROGRAMNAME
Definition: resource.h:179
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:591
#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:968
BOOL IsImageSaved() const
Definition: history.cpp:172

Referenced by OnClose(), OnCommand(), and OnDropFiles().

◆ Create()

HWND CMainWindow::Create ( )

Definition at line 744 of file gui.cpp.

745 {
746  ATL::CStringW szWindowName;
747  szWindowName.LoadStringW(IDS_APPTITLE);
748 
749  RECT r = {
754  };
755  r.right += r.left;
756  r.bottom += r.top;
757 
759 }
#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:527
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:308
#define CW_USEDEFAULT
Definition: winuser.h:225
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
PCXSTR GetString() const
Definition: atlsimpstr.h:361
#define NULL
Definition: types.h:112
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL bSaveWndPos
Definition: settings.h:7

Referenced by _tWinMain(), and MainWindowLoop().

◆ CreateApplicationView()

BOOL CMainWindow::CreateApplicationView ( )
private

Definition at line 160 of file gui.cpp.

161 {
162  m_ApplicationView = new CApplicationView(this); // pass this to ApplicationView for callback purpose
166 
167  return m_ApplicationView->Create(m_hWnd) != NULL;
168 }
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
CUiCollection & Second()
Definition: rosui.h:568
HWND Create(HWND hwndParent)
Definition: appview.cpp:1967
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CApplicationView * m_ApplicationView
Definition: gui.h:55
HWND m_hWnd
Definition: atlwin.h:267
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112

Referenced by CreateLayout().

◆ CreateLayout()

BOOL CMainWindow::CreateLayout ( )
private

Definition at line 187 of file gui.cpp.

188 {
189  BOOL b = TRUE;
190  bUpdating = TRUE;
191 
192  m_ClientPanel = new CUiPanel();
195 
196  // Top level
197  b = b && CreateStatusBar();
198  b = b && CreateVSplitter();
199 
200  // Inside V Splitter
201  b = b && CreateTreeView();
202  b = b && CreateApplicationView();
203 
204  if (b)
205  {
206  RECT rBottom;
207 
208  /* Size status bar */
209  m_StatusBar->SendMessageW(WM_SIZE, 0, 0);
210 
211  ::GetWindowRect(m_StatusBar->m_hWnd, &rBottom);
212 
213  m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top;
214  }
215 
216  bUpdating = FALSE;
217  return b;
218 }
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
BOOL CreateStatusBar()
Definition: gui.cpp:140
#define TRUE
Definition: types.h:120
BOOL bUpdating
Definition: gui.h:60
BOOL CreateTreeView()
Definition: gui.cpp:150
LONG top
Definition: windef.h:307
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:782
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define WM_SIZE
Definition: winuser.h:1598
BOOL CreateApplicationView()
Definition: gui.cpp:160
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
LONG bottom
Definition: windef.h:309
CUiMargin m_Margin
Definition: rosui.h:240
BOOL CreateVSplitter()
Definition: gui.cpp:170
CUiPanel * m_ClientPanel
Definition: gui.h:49
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53

Referenced by InitControls().

◆ CreateStatusBar()

BOOL CMainWindow::CreateStatusBar ( void  )
private

Definition at line 140 of file gui.cpp.

141 {
146 
148 }
#define IDC_STATUSBAR
Definition: resource.h:12
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:462
HWND m_hWnd
Definition: atlwin.h:267
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112
CUiCollection & Children()
Definition: rosui.h:359
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
CUiPanel * m_ClientPanel
Definition: gui.h:49
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53

Referenced by CreateLayout().

◆ CreateTreeView()

BOOL CMainWindow::CreateTreeView ( )
private

Definition at line 150 of file gui.cpp.

151 {
152  m_TreeView = new CSideTreeView();
156 
157  return m_TreeView->Create(m_hWnd) != NULL;
158 }
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
INT Append(T *ptr)
Definition: rosui.h:79
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
CUiCollection & First()
Definition: rosui.h:567
HWND m_hWnd
Definition: atlwin.h:267
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
#define NULL
Definition: types.h:112
HWND Create(HWND hwndParent)
Definition: rosctrls.h:483
CSideTreeView * m_TreeView
Definition: gui.h:52

Referenced by CreateLayout().

◆ CreateVSplitter()

BOOL CMainWindow::CreateVSplitter ( )
private

Definition at line 170 of file gui.cpp.

171 {
172  m_VSplitter = new CUiSplitPanel();
177  m_VSplitter->m_MinFirst = 0;
178 
179  // TODO: m_MinSecond should be calculate dynamically instead of hard-coded
180  m_VSplitter->m_MinSecond = 480;
181  m_VSplitter->m_Pos = 240;
183 
184  return m_VSplitter->Create(m_hWnd) != NULL;
185 }
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
INT m_MinFirst
Definition: rosui.h:544
INT Append(T *ptr)
Definition: rosui.h:79
#define FALSE
Definition: types.h:117
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:242
INT m_MinSecond
Definition: rosui.h:545
HWND Create(HWND hwndParent)
Definition: rosui.h:803
BOOL m_DynamicFirst
Definition: rosui.h:543
BOOL m_Horizontal
Definition: rosui.h:542
HWND m_hWnd
Definition: atlwin.h:267
CUiAlignment m_VerticalAlignment
Definition: rosui.h:243
INT m_Pos
Definition: rosui.h:541
#define NULL
Definition: types.h:112
CUiCollection & Children()
Definition: rosui.h:359
CUiPanel * m_ClientPanel
Definition: gui.h:49

Referenced by CreateLayout().

◆ EnumAvailableAppProc()

BOOL CALLBACK CMainWindow::EnumAvailableAppProc ( CAvailableApplicationInfo Info,
BOOL  bInitialCheckState 
)
private

Definition at line 635 of file gui.cpp.

636 {
637  if (!SearchPatternMatch(Info->m_szName.GetString(), szSearchPattern) &&
638  !SearchPatternMatch(Info->m_szDesc.GetString(), szSearchPattern))
639  {
640  return TRUE;
641  }
642  return m_ApplicationView->AddAvailableApplication(Info, bInitialCheckState, Info); // currently, the callback param is Info itself
643 }
BOOL AddAvailableApplication(CAvailableApplicationInfo *AvlbAppInfo, BOOL InitCheckState, LPVOID param)
Definition: appview.cpp:2039
ATL::CStringW szSearchPattern
Definition: gui.h:62
#define TRUE
Definition: types.h:120
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:404
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
CApplicationView * m_ApplicationView
Definition: gui.h:55

Referenced by s_EnumAvailableAppProc().

◆ EnumInstalledAppProc()

BOOL CALLBACK CMainWindow::EnumInstalledAppProc ( CInstalledApplicationInfo Info)
private

Definition at line 626 of file gui.cpp.

627 {
628  if (!SearchPatternMatch(Info->szDisplayName.GetString(), szSearchPattern))
629  {
630  return TRUE;
631  }
632  return m_ApplicationView->AddInstalledApplication(Info, Info); // currently, the callback param is Info itself
633 }
ATL::CStringW szSearchPattern
Definition: gui.h:62
BOOL AddInstalledApplication(CInstalledApplicationInfo *InstAppInfo, LPVOID param)
Definition: appview.cpp:2030
#define TRUE
Definition: types.h:120
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:404
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
CApplicationView * m_ApplicationView
Definition: gui.h:55

Referenced by s_EnumInstalledAppProc().

◆ GetWndClassInfo()

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

Definition at line 720 of file gui.cpp.

721 {
722  DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
723  static ATL::CWndClassInfo wc =
724  {
725  {
726  sizeof(WNDCLASSEX),
727  csStyle,
729  0,
730  0,
731  NULL,
732  LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)),
734  (HBRUSH)(COLOR_BTNFACE + 1),
737  NULL
738  },
739  NULL, NULL, IDC_ARROW, TRUE, 0, _T("")
740  };
741  return wc;
742 }
#define IDR_MAINMENU
Definition: resource.h:40
#define TRUE
Definition: types.h:120
#define CS_HREDRAW
Definition: winuser.h:648
const TCHAR szWindowClass[]
Definition: magnifier.c:28
#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
#define IDI_MAIN
Definition: resource.h:4
#define COLOR_BTNFACE
Definition: winuser.h:922
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1585
#define NULL
Definition: types.h:112
#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:5699

◆ HandleTabOrder()

void CMainWindow::HandleTabOrder ( int  direction)

Definition at line 840 of file gui.cpp.

841 {
842  ATL::CSimpleArray<HWND> TabOrderHwndList;
843 
844  m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
845  m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
846 
847 
848  if (TabOrderHwndList.GetSize() == 0)
849  {
850  // in case the list is empty
851  return;
852  }
853 
854  int FocusIndex;
855 
856  if ((FocusIndex = TabOrderHwndList.Find(GetFocus())) == -1)
857  {
858  FocusIndex = 0; // focus the first window in the list
859  }
860  else
861  {
862  FocusIndex += direction;
863  FocusIndex += TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
864  FocusIndex %= TabOrderHwndList.GetSize();
865  }
866 
867  ::SetFocus(TabOrderHwndList[FocusIndex]);
868  return;
869 }
HWND SetFocus()
Definition: atlwin.h:1164
int GetSize() const
Definition: atlsimpcoll.h:104
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2071
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:500
CApplicationView * m_ApplicationView
Definition: gui.h:55
HWND WINAPI GetFocus(void)
Definition: window.c:1894
int Find(const T &t) const
Definition: atlsimpcoll.h:82
CSideTreeView * m_TreeView
Definition: gui.h:52

Referenced by MainWindowLoop().

◆ InitCategoriesList()

VOID CMainWindow::InitCategoriesList ( )
private

Definition at line 106 of file gui.cpp.

107 {
108  HTREEITEM hRootItemInstalled, hRootItemAvailable;
109 
110  hRootItemInstalled = m_TreeView->AddCategory(TVI_ROOT, IDS_INSTALLED, IDI_CATEGORY);
111  m_TreeView->AddCategory(hRootItemInstalled, IDS_APPLICATIONS, IDI_APPS);
112  m_TreeView->AddCategory(hRootItemInstalled, IDS_UPDATES, IDI_APPUPD);
113 
115 
117  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
118  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
120  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
122  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OFFICE, IDI_CAT_OFFICE);
123  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
124  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
126  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_FINANCE, IDI_CAT_FINANCE);
127  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_SCIENCE, IDI_CAT_SCIENCE);
128  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
129  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DRIVERS, IDI_CAT_DRIVERS);
130  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
131  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_THEMES, IDI_CAT_THEMES);
132  m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
133 
135  m_TreeView->Expand(hRootItemInstalled, TVE_EXPAND);
136  m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
137  m_TreeView->SelectItem(hRootItemAvailable);
138 }
#define IDS_CAT_DEVEL
Definition: resource.h:178
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:52
#define IDS_CAT_OFFICE
Definition: resource.h:187
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDI_CATEGORY
Definition: resource.h:13
#define IDS_CAT_VIDEO
Definition: resource.h:191
#define IDS_CAT_FINANCE
Definition: resource.h:182
#define IDS_AVAILABLEFORINST
Definition: resource.h:100
#define IDS_INSTALLED
Definition: resource.h:99
#define IDI_CAT_ENGINEER
Definition: resource.h:24
#define IDI_CAT_OFFICE
Definition: resource.h:30
#define IDI_CAT_VIDEO
Definition: resource.h:34
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:599
#define IDS_SELECTEDFORINST
Definition: resource.h:119
#define IDS_CAT_INTERNET
Definition: resource.h:185
HIMAGELIST SetImageList()
Definition: gui.cpp:74
#define IDS_CAT_DRIVERS
Definition: resource.h:179
#define IDI_CAT_OTHER
Definition: resource.h:31
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:604
#define IDS_CAT_OTHER
Definition: resource.h:188
#define IDI_CAT_TOOLS
Definition: resource.h:33
#define IDI_CAT_EDU
Definition: resource.h:23
#define IDI_CAT_INTERNET
Definition: resource.h:28
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368
#define IDS_CAT_LIBS
Definition: resource.h:186
#define IDS_CAT_THEMES
Definition: resource.h:192
#define IDS_CAT_SCIENCE
Definition: resource.h:189
#define IDS_CAT_GRAPHICS
Definition: resource.h:184
#define IDS_CAT_AUDIO
Definition: resource.h:177
#define IDS_CAT_EDU
Definition: resource.h:180
#define IDS_CAT_ENGINEER
Definition: resource.h:181
#define IDS_APPLICATIONS
Definition: resource.h:102
#define IDI_CAT_LIBS
Definition: resource.h:29
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
#define IDI_CAT_THEMES
Definition: resource.h:35
#define IDI_CAT_FINANCE
Definition: resource.h:25
#define IDS_UPDATES
Definition: resource.h:101
#define IDI_CAT_DRIVERS
Definition: resource.h:22
#define IDI_CAT_AUDIO
Definition: resource.h:20
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDS_CAT_TOOLS
Definition: resource.h:190
#define IDI_CAT_SCIENCE
Definition: resource.h:32
#define IDI_APPS
Definition: resource.h:11
#define IDS_CAT_GAMES
Definition: resource.h:183
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define IDI_APPUPD
Definition: resource.h:12
CSideTreeView * m_TreeView
Definition: gui.h:52

Referenced by InitControls().

◆ InitControls()

BOOL CMainWindow::InitControls ( )
private

Definition at line 229 of file gui.cpp.

230 {
231  if (CreateLayout())
232  {
234 
236 
237  return TRUE;
238  }
239 
240  return FALSE;
241 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL CreateLayout()
Definition: gui.cpp:187
VOID UpdateStatusBarText()
Definition: gui.cpp:664
VOID InitCategoriesList()
Definition: gui.cpp:106

Referenced by ProcessWindowMessage().

◆ InsertSelectionFromHBITMAP()

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

Definition at line 107 of file winproc.cpp.

108 {
109  int width = GetDIBWidth(bitmap);
110  int height = GetDIBHeight(bitmap);
111  int curWidth = imageModel.GetWidth();
112  int curHeight = imageModel.GetHeight();
113 
114  if (width > curWidth || height > curHeight)
115  {
116  BOOL shouldEnlarge = TRUE;
117 
118  if (askBeforeEnlarging)
119  {
120  TCHAR programname[20];
121  TCHAR shouldEnlargePromptText[100];
122 
123  LoadString(hProgInstance, IDS_PROGRAMNAME, programname, _countof(programname));
124  LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, _countof(shouldEnlargePromptText));
125 
126  switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
127  {
128  case IDYES:
129  break;
130  case IDNO:
131  shouldEnlarge = FALSE;
132  break;
133  case IDCANCEL:
134  return;
135  }
136  }
137 
138  if (shouldEnlarge)
139  {
140  if (width > curWidth)
141  curWidth = width;
142 
143  if (height > curHeight)
144  curHeight = height;
145 
146  imageModel.Crop(curWidth, curHeight, 0, 0);
147  }
148  }
149 
153 
156 
157  placeSelWin();
158  selectionWindow.ShowWindow(SW_SHOW);
160 }
GLint GLint GLsizei width
Definition: gl.h:1546
void CopyPrevious(void)
Definition: history.cpp:47
CToolBox toolBoxContainer
Definition: main.cpp:66
#define IDYES
Definition: winuser.h:829
#define IDS_ENLARGEPROMPTTEXT
Definition: resource.h:215
void placeSelWin(void)
Definition: mouse.cpp:20
#define TRUE
Definition: types.h:120
#define MAKELPARAM(l, h)
Definition: winuser.h:3988
int GetDIBHeight(HBITMAP hBitmap)
Definition: dib.cpp:61
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:129
int GetDIBWidth(HBITMAP hBitmap)
Definition: dib.cpp:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MB_YESNOCANCEL
Definition: winuser.h:812
#define SW_SHOW
Definition: winuser.h:769
int GetWidth() const
Definition: history.cpp:199
Definition: uimain.c:88
char TCHAR
Definition: xmlstorage.h:189
#define _countof(array)
Definition: sndvol32.h:68
#define ID_RECTSEL
Definition: resource.h:107
#define FindWindowEx
Definition: winuser.h:5758
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
ImageModel imageModel
Definition: main.cpp:32
HWND m_hWnd
Definition: atlwin.h:267
#define WM_COMMAND
Definition: winuser.h:1727
HINSTANCE hProgInstance
Definition: main.cpp:50
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void ForceRefreshSelectionContents()
Definition: selection.cpp:58
int GetHeight() const
Definition: history.cpp:204
void InsertFromHBITMAP(HBITMAP hBm)
#define IDS_PROGRAMNAME
Definition: resource.h:179
#define NULL
Definition: types.h:112
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1082
#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:968
#define LoadString
Definition: winuser.h:5799
CSelectionWindow selectionWindow
Definition: main.cpp:71

Referenced by OnCommand().

◆ InstallApplication()

BOOL CMainWindow::InstallApplication ( CAvailableApplicationInfo Info)

Definition at line 793 of file gui.cpp.

794 {
795  if (Info)
796  {
798  {
800  return TRUE;
801  }
802  }
803  else
804  {
806 
807  // enum all selected apps
809 
810  if (AppsList.GetSize())
811  {
812  if (DownloadListOfApplications(AppsList, FALSE))
813  {
816  return TRUE;
817  }
818  }
819  }
820 
821  return FALSE;
822 }
#define TRUE
Definition: types.h:120
VOID RemoveAllSelected()
Definition: available.cpp:571
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:657
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo)
Definition: loaddlg.cpp:1039
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:448
CAvailableApps m_AvailableApps
Definition: gui.h:57
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:675
BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1022

Referenced by CApplicationView::OnCommand(), and CApplicationView::ProcessWindowMessage().

◆ IsSelectedNodeInstalled()

BOOL CMainWindow::IsSelectedNodeInstalled ( )
private

Definition at line 500 of file gui.cpp.

501 {
502  HTREEITEM hSelectedItem = m_TreeView->GetSelection();
503  TV_ITEM tItem;
504 
505  tItem.mask = TVIF_PARAM | TVIF_HANDLE;
506  tItem.hItem = hSelectedItem;
507  m_TreeView->GetItem(&tItem);
508  switch (tItem.lParam)
509  {
510  case IDS_INSTALLED:
511  case IDS_APPLICATIONS:
512  case IDS_UPDATES:
513  return TRUE;
514  default:
515  return FALSE;
516  }
517 }
#define TRUE
Definition: types.h:120
#define IDS_INSTALLED
Definition: resource.h:99
#define FALSE
Definition: types.h:117
BOOL GetItem(TV_ITEM *pitem)
Definition: rosctrls.h:545
#define TVIF_HANDLE
Definition: commctrl.h:3270
#define IDS_APPLICATIONS
Definition: resource.h:102
#define TV_ITEM
Definition: commctrl.h:3300
#define IDS_UPDATES
Definition: resource.h:101
#define TVIF_PARAM
Definition: commctrl.h:3268
HTREEITEM GetSelection()
Definition: rosctrls.h:594
CSideTreeView * m_TreeView
Definition: gui.h:52

Referenced by ProcessWindowMessage().

◆ ItemCheckStateChanged()

BOOL CMainWindow::ItemCheckStateChanged ( BOOL  bChecked,
LPVOID  CallbackParam 
)

Definition at line 763 of file gui.cpp.

764 {
765  if (!bUpdating)
766  {
767  if (bChecked)
768  {
770  {
771  return FALSE;
772  }
773  }
774  else
775  {
777  {
778  return FALSE;
779  }
780  }
781 
783  return TRUE;
784  }
785  else
786  {
787  return TRUE;
788  }
789 }
#define TRUE
Definition: types.h:120
BOOL bUpdating
Definition: gui.h:60
#define FALSE
Definition: types.h:117
VOID UpdateStatusBarText()
Definition: gui.cpp:664
BOOL AddSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:555
CAvailableApps m_AvailableApps
Definition: gui.h:57
BOOL RemoveSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:560

Referenced by CApplicationView::ItemCheckStateChanged().

◆ LayoutCleanup()

VOID CMainWindow::LayoutCleanup ( )
private

Definition at line 220 of file gui.cpp.

221 {
222  delete m_TreeView;
223  delete m_ApplicationView;
224  delete m_VSplitter;
225  delete m_StatusBar;
226  return;
227 }
CUiSplitPanel * m_VSplitter
Definition: gui.h:50
CApplicationView * m_ApplicationView
Definition: gui.h:55
CSideTreeView * m_TreeView
Definition: gui.h:52
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53

Referenced by ~CMainWindow().

◆ OnClose()

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

Definition at line 264 of file winproc.cpp.

265 {
266  if (ConfirmSave())
267  {
268  DestroyWindow();
269  }
270  return 0;
271 }
BOOL DestroyWindow()
Definition: atlwin.h:428
BOOL ConfirmSave()
Definition: winproc.cpp:239

◆ OnCommand() [1/2]

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

Definition at line 431 of file winproc.cpp.

432 {
433  switch (LOWORD(wParam))
434  {
435  case IDM_HELPINFO:
436  {
438  TCHAR infotitle[100];
439  TCHAR infotext[200];
440  LoadString(hProgInstance, IDS_INFOTITLE, infotitle, _countof(infotitle));
441  LoadString(hProgInstance, IDS_INFOTEXT, infotext, _countof(infotext));
442  ShellAbout(m_hWnd, infotitle, infotext, paintIcon);
443  DeleteObject(paintIcon);
444  break;
445  }
446  case IDM_HELPHELPTOPICS:
447  HtmlHelp(m_hWnd, _T("help\\Paint.chm"), 0, 0);
448  break;
449  case IDM_FILEEXIT:
451  break;
452  case IDM_FILENEW:
453  if (ConfirmSave())
454  {
456  }
457  break;
458  case IDM_FILEOPEN:
459  if (ConfirmSave() && GetOpenFileName(&ofn))
460  {
462  }
463  break;
464  case IDM_FILESAVE:
465  saveImage(TRUE);
466  break;
467  case IDM_FILESAVEAS:
468  saveImage(FALSE);
469  break;
470  case IDM_FILEPAGESETUP:
471  // DUMMY: Shows the dialog only, no functionality
472  PAGESETUPDLG psd;
473  ZeroMemory(&psd, sizeof(psd));
474  psd.lStructSize = sizeof(psd);
475  psd.hwndOwner = m_hWnd;
476  PageSetupDlg(&psd);
477  break;
478  case IDM_FILEPRINT:
479  // TODO: Test whether it actually works
480  PRINTDLG pd;
481  ZeroMemory(&pd, sizeof(pd));
482  pd.lStructSize = sizeof(pd);
483  pd.hwndOwner = m_hWnd;
484  pd.hDevMode = NULL; // freed by user
485  pd.hDevNames = NULL; // freed by user
487  pd.nCopies = 1;
488  pd.nFromPage = 0xffff;
489  pd.nToPage = 0xffff;
490  pd.nMinPage = 1;
491  pd.nMaxPage = 0xffff;
492  if (PrintDlg(&pd) == TRUE)
493  {
495  DeleteDC(pd.hDC);
496  }
497  if (pd.hDevMode)
498  GlobalFree(pd.hDevMode);
499  if (pd.hDevNames)
500  GlobalFree(pd.hDevNames);
501  break;
504  break;
507  break;
510  break;
511  case IDM_FILE1:
512  {
514  break;
515  }
516  case IDM_FILE2:
517  {
519  break;
520  }
521  case IDM_FILE3:
522  {
524  break;
525  }
526  case IDM_FILE4:
527  {
529  break;
530  }
531  case IDM_EDITUNDO:
533  break;
534  imageModel.Undo();
536  break;
537  case IDM_EDITREDO:
539  break;
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  {
572  {
573  textEditWindow.SendMessage(EM_SETSEL, 0, -1);
574  break;
575  }
580  break;
581  }
582  case IDM_EDITCOPYTO:
583  if (GetSaveFileName(&ofn))
585  break;
586  case IDM_EDITPASTEFROM:
587  if (GetOpenFileName(&ofn))
588  {
590  if (hbmNew)
591  {
593  DeleteObject(hbmNew);
594  }
595  }
596  break;
598  if (ChooseColor(&choosecolor))
600  break;
603  break;
606  break;
608  {
610  break;
611  }
616  break;
618  switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
619  {
620  case 1: /* flip horizontally */
623  else
625  break;
626  case 2: /* flip vertically */
629  else
631  break;
632  case 3: /* rotate 90 degrees */
633  break;
634  case 4: /* rotate 180 degrees */
637  else
639  break;
640  case 5: /* rotate 270 degrees */
641  break;
642  }
643  break;
644  case IDM_IMAGEATTRIBUTES:
645  {
646  if (attributesDialog.DoModal(mainWindow.m_hWnd))
647  {
649  }
650  break;
651  }
653  {
654  if (stretchSkewDialog.DoModal(mainWindow.m_hWnd))
655  {
658  }
659  break;
660  }
661  case IDM_IMAGEDRAWOPAQUE:
663  break;
664  case IDM_IMAGECROP:
666  break;
667 
668  case IDM_VIEWTOOLBOX:
671  break;
675  break;
676  case IDM_VIEWSTATUSBAR:
679  break;
680  case IDM_FORMATICONBAR:
682  {
683  if (!fontsDialog.IsWindow())
684  {
685  fontsDialog.Create(mainWindow);
686  }
689  fontsDialog.SendMessage(DM_REPOSITION, 0, 0);
690  }
691  break;
692  case IDM_VIEWSHOWGRID:
693  showGrid = !showGrid;
695  break;
698  miniature.ShowWindow(showMiniature ? SW_SHOW : SW_HIDE);
699  break;
700 
701  case IDM_VIEWZOOM125:
702  zoomTo(125, 0, 0);
703  break;
704  case IDM_VIEWZOOM25:
705  zoomTo(250, 0, 0);
706  break;
707  case IDM_VIEWZOOM50:
708  zoomTo(500, 0, 0);
709  break;
710  case IDM_VIEWZOOM100:
711  zoomTo(1000, 0, 0);
712  break;
713  case IDM_VIEWZOOM200:
714  zoomTo(2000, 0, 0);
715  break;
716  case IDM_VIEWZOOM400:
717  zoomTo(4000, 0, 0);
718  break;
719  case IDM_VIEWZOOM800:
720  zoomTo(8000, 0, 0);
721  break;
722 
723  case IDM_VIEWFULLSCREEN:
724  fullscreenWindow.ShowWindow(SW_SHOW);
726  break;
727  }
728  return 0;
729 }
#define IDM_IMAGESTRETCHSKEW
Definition: resource.h:86
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCTSTR name, DWORD dwFileSize, BOOL isFile)
Definition: dib.cpp:108
#define IDM_EDITPASTE
Definition: resource.h:63
#define IDM_EDITCUT
Definition: resource.h:61
void FlipHorizontally()
Definition: history.cpp:228
#define MAKEINTRESOURCE
Definition: winuser.h:591
ToolsModel toolsModel
Definition: main.cpp:18
void CopyPrevious(void)
Definition: history.cpp:47
static HICON
Definition: imagelist.c:84
CToolBox toolBoxContainer
Definition: main.cpp:66
void RotateNTimes90Degrees(int iN)
WORD nMaxPage
Definition: commdlg.h:474
#define IDM_FILEEXIT
Definition: resource.h:57
#define IDM_VIEWTOOLBOX
Definition: resource.h:70
long y
Definition: polytest.cpp:48
#define PageSetupDlg
Definition: commdlg.h:667
void SelectPalette(PAL_TYPE nPalette)
void SetFgColor(COLORREF newColor)
long x
Definition: polytest.cpp:48
static HBITMAP CopyDIBImage(HBITMAP hbm, INT cx=0, INT cy=0)
Definition: dib.h:14
#define ChooseColor
Definition: commdlg.h:661
#define IDM_VIEWFULLSCREEN
Definition: resource.h:81
#define IDM_FILEPAGESETUP
Definition: resource.h:42
#define TRUE
Definition: types.h:120
BOOL showGrid
Definition: main.cpp:60
#define SW_HIDE
Definition: winuser.h:762
#define IDM_FILEASWALLPAPERCENTERED
Definition: resource.h:48
HWND hwndOwner
Definition: commdlg.h:434
#define MAKELPARAM(l, h)
Definition: winuser.h:3988
#define IDM_IMAGEDELETEIMAGE
Definition: resource.h:90
#define IDM_VIEWSTATUSBAR
Definition: resource.h:72
OPENFILENAME ofn
Definition: main.cpp:37
#define IDM_EDITPASTEFROM
Definition: resource.h:68
void InvertColors()
Definition: history.cpp:209
#define ZeroMemory
Definition: winbase.h:1664
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define IDM_VIEWZOOM125
Definition: resource.h:74
#define IDM_IMAGEINVERTCOLORS
Definition: resource.h:88
WORD nCopies
Definition: commdlg.h:475
CString strFile2
Definition: registry.h:31
SelectionModel selectionModel
Definition: main.cpp:20
#define IDM_VIEWSHOWMINIATURE
Definition: resource.h:83
static void SetWallpaper(LPCTSTR szFileName, WallpaperStyle style)
Definition: registry.cpp:42
#define IDM_VIEWSHOWGRID
Definition: resource.h:82
void Redo(void)
Definition: history.cpp:79
#define IDM_HELPINFO
Definition: resource.h:98
#define IDM_EDITREDO
Definition: resource.h:60
COLORREF rgbResult
Definition: commdlg.h:242
#define IDM_FILEASWALLPAPERPLANE
Definition: resource.h:47
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
#define GetOpenFileName
Definition: commdlg.h:665
WPARAM wParam
Definition: combotst.c:138
COLORREF GetBgColor() const
WORD nMinPage
Definition: commdlg.h:473
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:129
#define IDM_FILE3
Definition: resource.h:54
CImgAreaWindow imageArea
Definition: main.cpp:72
#define GetSaveFileName
Definition: commdlg.h:666
#define PrintDlg
Definition: commdlg.h:668
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define IDS_INFOTITLE
Definition: resource.h:181
CMirrorRotateDialog mirrorRotateDialog
Definition: dialogs.cpp:19
#define FALSE
Definition: types.h:117
void saveImage(BOOL overwrite)
Definition: winproc.cpp:90
#define IDM_FORMATICONBAR
Definition: resource.h:73
HDC GetDC()
Definition: history.cpp:223
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:143
#define CF_BITMAP
Definition: constants.h:397
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
CMiniatureWindow miniature
Definition: main.cpp:65
WORD nFromPage
Definition: commdlg.h:471
#define PD_RETURNDC
Definition: commdlg.h:155
#define IDM_VIEWZOOM400
Definition: resource.h:79
CStretchSkewDialog stretchSkewDialog
Definition: dialogs.cpp:21
DWORD lStructSize
Definition: commdlg.h:433
#define IDM_FILEOPEN
Definition: resource.h:35
#define IDM_VIEWZOOM800
Definition: resource.h:80
#define SW_SHOW
Definition: winuser.h:769
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: resource.h:49
void Insert(HBITMAP hbm)
Definition: history.cpp:113
DWORD ShowTextTool
Definition: registry.h:43
int GetWidth() const
Definition: history.cpp:199
char TCHAR
Definition: xmlstorage.h:189
#define IDM_FILE4
Definition: resource.h:55
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
#define _T(x)
Definition: vfdio.h:22
#define IDM_FILESAVE
Definition: resource.h:36
void InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
Definition: winproc.cpp:107
#define _countof(array)
Definition: sndvol32.h:68
#define ID_RECTSEL
Definition: resource.h:107
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
Definition: history.cpp:187
#define FindWindowEx
Definition: winuser.h:5758
BOOL OpenClipboard()
Definition: atlwin.h:1004
#define WM_CLOSE
Definition: winuser.h:1608
#define IDM_VIEWZOOM25
Definition: resource.h:75
#define IDM_VIEWZOOM200
Definition: resource.h:78
#define EM_SETSEL
Definition: winuser.h:2005
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:244
HGLOBAL hDevMode
Definition: commdlg.h:467
CFullscreenWindow fullscreenWindow
Definition: main.cpp:64
HWND hStatusBar
Definition: main.cpp:35
#define ShellAbout
Definition: shellapi.h:690
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
BOOL showMiniature
Definition: main.cpp:61
#define IDM_FILENEW
Definition: resource.h:34
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
#define DM_REPOSITION
Definition: winuser.h:2087
void selectAll()
Definition: toolsmodel.cpp:225
TCHAR filepathname[1000]
Definition: main.cpp:52
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:76
CAttributesDialog attributesDialog
Definition: dialogs.cpp:20
void alignChildrenToMainWindow()
Definition: winproc.cpp:48
#define IDM_EDITUNDO
Definition: resource.h:59
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
ImageModel imageModel
Definition: main.cpp:32
HWND m_hWnd
Definition: atlwin.h:267
#define WM_COMMAND
Definition: winuser.h:1727
CPaletteWindow paletteWindow
Definition: main.cpp:68
#define IDM_FILE1
Definition: resource.h:52
HINSTANCE hProgInstance
Definition: main.cpp:50
#define IDI_APPICON
Definition: resource.h:166
CString strFile1
Definition: registry.h:30
BOOL SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
Definition: dib.cpp:68
HWND hwndOwner
Definition: commdlg.h:466
CString strFile4
Definition: registry.h:33
#define IDM_VIEWZOOM50
Definition: resource.h:76
#define IDM_FILEPRINT
Definition: resource.h:43
POINT percentage
Definition: dialogs.h:86
#define IDM_IMAGEATTRIBUTES
Definition: resource.h:89
#define IDM_IMAGEDRAWOPAQUE
Definition: resource.h:91
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1299
int GetHeight() const
Definition: history.cpp:204
PaletteModel paletteModel
Definition: main.cpp:28
BOOL WINAPI DeleteDC(_In_ HDC)
LPSTR lpstrFile
Definition: commdlg.h:336
CFontsDialog fontsDialog
Definition: dialogs.cpp:22
HGLOBAL hDevNames
Definition: commdlg.h:468
HBITMAP GetBitmap() const
#define IDM_IMAGECROP
Definition: resource.h:87
HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile)
Definition: dib.cpp:159
#define NULL
Definition: types.h:112
#define IDM_COLORSOLDPALETTE
Definition: resource.h:95
HANDLE WINAPI GetClipboardData(_In_ UINT)
DWORD lStructSize
Definition: commdlg.h:465
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:862
void Undo(void)
Definition: history.cpp:60
void FlipVertically()
Definition: history.cpp:236
WORD nToPage
Definition: commdlg.h:472
#define IDM_FILE2
Definition: resource.h:53
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:19
#define IDM_EDITSELECTALL
Definition: resource.h:66
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1082
#define IDM_HELPHELPTOPICS
Definition: resource.h:97
#define IDM_COLORSMODERNPALETTE
Definition: resource.h:94
DWORD Flags
Definition: commdlg.h:470
#define IDM_EDITDELETESELECTION
Definition: resource.h:64
#define IDM_COLORSEDITPALETTE
Definition: resource.h:93
static HBITMAP
Definition: button.c:44
#define IDM_EDITCOPYTO
Definition: resource.h:67
#define LoadIcon
Definition: winuser.h:5793
CTextEditWindow textEditWindow
Definition: main.cpp:81
CHOOSECOLOR choosecolor
Definition: main.cpp:36
RegistrySettings registrySettings
Definition: main.cpp:30
#define HtmlHelp
Definition: htmlhelp.h:425
HDC hDC
Definition: commdlg.h:469
#define IDM_FILESAVEAS
Definition: resource.h:37
#define IDS_INFOTEXT
Definition: resource.h:182
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define IDM_EDITCOPY
Definition: resource.h:62
BOOL ConfirmSave()
Definition: winproc.cpp:239
#define SRCCOPY
Definition: wingdi.h:333
#define LoadString
Definition: winuser.h:5799
#define IDM_VIEWZOOM100
Definition: resource.h:77
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
struct Rect Rect
#define IDM_VIEWCOLORPALETTE
Definition: resource.h:71
BOOL IsWindowVisible() const
Definition: atlwin.h:924
CSelectionWindow selectionWindow
Definition: main.cpp:71
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:138
CMainWindow mainWindow
Definition: main.cpp:63
CString strFile3
Definition: registry.h:32
#define IDM_IMAGEROTATEMIRROR
Definition: resource.h:85

Referenced by ProcessWindowMessage().

◆ OnCommand() [2/2]

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

Definition at line 532 of file gui.cpp.

533 {
534  WORD wCommand = LOWORD(wParam);
535 
536  if (!lParam)
537  {
538  switch (wCommand)
539  {
540  case ID_SETTINGS:
542  break;
543 
544  case ID_EXIT:
545  PostMessageW(WM_CLOSE, 0, 0);
546  break;
547 
548  case ID_SEARCH:
550  break;
551 
552  case ID_INSTALL:
554  {
556 
557  // enum all selected apps
559 
560  if (AppsList.GetSize())
561  {
562  if (DownloadListOfApplications(AppsList, FALSE))
563  {
566  }
567  }
568  else
569  {
570  // use the currently focused item in application-view
572  if (FocusedApps)
573  {
574  if (DownloadApplication(FocusedApps))
575  {
577  }
578  }
579  else
580  {
581  // TODO: in this case, Install button in toolbar (and all other places) should be disabled
582  // or at least popup a messagebox telling user to select/check some app first
583  }
584  }
585  }
586  break;
587 
588  case ID_UNINSTALL:
591  break;
592 
593  case ID_MODIFY:
596  break;
597 
598  case ID_REGREMOVE:
600  break;
601 
602  case ID_REFRESH:
604  break;
605 
606  case ID_RESETDB:
609  break;
610 
611  case ID_HELP:
612  MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
613  break;
614 
615  case ID_ABOUT:
616  ShowAboutDlg();
617  break;
618 
619  case ID_CHECK_ALL:
621  break;
622  }
623  }
624 }
#define ID_REFRESH
Definition: resource.h:16
BOOL RemoveSelectedAppFromRegistry()
Definition: gui.cpp:267
#define ID_SETTINGS
Definition: resource.h:81
#define ID_REGREMOVE
Definition: resource.h:83
#define TRUE
Definition: types.h:120
VOID RemoveAllSelected()
Definition: available.cpp:571
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:657
#define ID_RESETDB
Definition: resource.h:84
INT SelectedEnumType
Definition: gui.h:63
#define ID_UNINSTALL
Definition: resource.h:75
WPARAM wParam
Definition: combotst.c:138
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
BOOL IsAvailableEnum(INT x)
Definition: defines.h:65
#define ID_ABOUT
Definition: charmap.c:18
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo)
Definition: loaddlg.cpp:1039
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:448
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define WM_CLOSE
Definition: winuser.h:1608
VOID ShowAboutDlg()
Definition: gui.cpp:519
unsigned short WORD
Definition: ntddk_ex.h:93
#define ID_CHECK_ALL
Definition: resource.h:85
void SetFocusOnSearchBar()
Definition: appview.cpp:1746
CApplicationView * m_ApplicationView
Definition: gui.h:55
HWND m_hWnd
Definition: atlwin.h:267
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:299
VOID CreateSettingsDlg(HWND hwnd)
static BOOL ForceUpdateAppsDB()
Definition: available.cpp:442
#define ID_EXIT
Definition: resource.h:10
CAvailableApps m_AvailableApps
Definition: gui.h:57
#define ID_SEARCH
Definition: resource.h:86
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:675
#define ID_INSTALL
Definition: resource.h:74
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
BOOL DownloadListOfApplications(const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1022
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ID_HELP
Definition: resource.h:26
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define ID_MODIFY
Definition: resource.h:78
PVOID GetFocusedItemData()
Definition: appview.cpp:2061

◆ OnCreate()

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

Definition at line 225 of file winproc.cpp.

226 {
229  return 0;
230 }
#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:1082
#define LoadIcon
Definition: winuser.h:5793
#define ICON_BIG
Definition: tnclass.cpp:51

◆ OnDestroy()

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

Definition at line 232 of file winproc.cpp.

233 {
235  PostQuitMessage(0); /* send a WM_QUIT to the message queue */
236  return 0;
237 }
WINDOWPLACEMENT WindowPlacement
Definition: registry.h:28
BOOL GetWindowPlacement(WINDOWPLACEMENT *lpwndpl) const
Definition: atlwin.h:768
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 212 of file winproc.cpp.

213 {
214  TCHAR droppedfile[MAX_PATH];
215 
216  HDROP hDrop = (HDROP)wParam;
217  DragQueryFile(hDrop, 0, droppedfile, _countof(droppedfile));
218  DragFinish(hDrop);
219 
220  ConfirmSave() && DoLoadImageFile(m_hWnd, droppedfile, TRUE);
221 
222  return 0;
223 }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
char TCHAR
Definition: xmlstorage.h:189
#define _countof(array)
Definition: sndvol32.h:68
#define MAX_PATH
Definition: compat.h:34
HWND m_hWnd
Definition: atlwin.h:267
HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile)
Definition: dib.cpp:159
#define DragQueryFile
Definition: shellapi.h:684
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
BOOL ConfirmSave()
Definition: winproc.cpp:239

◆ OnGetMinMaxInfo()

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

Definition at line 371 of file winproc.cpp.

372 {
374  mm->ptMinTrackSize.x = 330;
375  mm->ptMinTrackSize.y = 430;
376  return 0;
377 }
POINT ptMinTrackSize
Definition: winuser.h:3610
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 273 of file winproc.cpp.

274 {
275  HMENU menu = GetMenu();
276  BOOL trueSelection =
279  switch (lParam)
280  {
281  case 0: /* File menu */
282  if ((HMENU)wParam != GetSubMenu(menu, 0))
283  break;
292  {
294  CPath pathFile1(registrySettings.strFile1);
295  pathFile1.CompactPathEx(30);
297  {
298  CPath pathFile2(registrySettings.strFile2);
299  pathFile2.CompactPathEx(30);
301  {
302  CPath pathFile3(registrySettings.strFile3);
303  pathFile3.CompactPathEx(30);
305  {
306  CPath pathFile4(registrySettings.strFile4);
307  pathFile4.CompactPathEx(30);
308  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE4, _T("4 ") + pathFile4);
309  }
310  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE3, _T("3 ") + pathFile3);
311  }
312  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE2, _T("2 ") + pathFile2);
313  }
314  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE1, _T("1 ") + pathFile1);
315  }
316  break;
317  case 1: /* Edit menu */
320  EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(trueSelection));
321  EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(trueSelection));
322  EnableMenuItem(menu, IDM_EDITDELETESELECTION, ENABLED_IF(trueSelection));
323  EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
324  EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
325  OpenClipboard();
327  CloseClipboard();
328  break;
329  case 2: /* View menu */
335 
338  break;
339  case 3: /* Image menu */
342  break;
343  }
344 
352 
355  return 0;
356 }
BOOL isAFile
Definition: main.cpp:53
#define IDM_FILEMOSTRECENTLYUSEDFILE
Definition: resource.h:51
#define IDM_EDITPASTE
Definition: resource.h:63
#define IDM_EDITCUT
Definition: resource.h:61
ToolsModel toolsModel
Definition: main.cpp:18
CToolBox toolBoxContainer
Definition: main.cpp:66
#define IDM_VIEWTOOLBOX
Definition: resource.h:70
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL HasUndoSteps() const
Definition: history.cpp:177
#define InsertMenu
Definition: winuser.h:5783
BOOL showGrid
Definition: main.cpp:60
#define IDM_FILEASWALLPAPERCENTERED
Definition: resource.h:48
#define MF_STRING
Definition: winuser.h:138
#define IDM_VIEWSTATUSBAR
Definition: resource.h:72
#define IDM_VIEWZOOM125
Definition: resource.h:74
CString strFile2
Definition: registry.h:31
#define CHECKED_IF(a)
Definition: common.h:24
#define IDM_VIEWSHOWMINIATURE
Definition: resource.h:83
#define IDM_VIEWSHOWGRID
Definition: resource.h:82
#define IDM_EDITREDO
Definition: resource.h:60
BOOL HasRedoSteps() const
Definition: history.cpp:182
#define IDM_FILEASWALLPAPERPLANE
Definition: resource.h:47
WPARAM wParam
Definition: combotst.c:138
#define IDM_FILE3
Definition: resource.h:54
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDM_FORMATICONBAR
Definition: resource.h:73
#define MF_BYPOSITION
Definition: winuser.h:203
#define CF_BITMAP
Definition: constants.h:397
#define ENABLED_IF(a)
Definition: common.h:27
#define IDM_VIEWZOOM400
Definition: resource.h:79
#define IDM_VIEWZOOM800
Definition: resource.h:80
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: resource.h:49
HMENU GetMenu() const
Definition: atlwin.h:648
#define IDM_FILE4
Definition: resource.h:55
#define _T(x)
Definition: vfdio.h:22
BOOL OpenClipboard()
Definition: atlwin.h:1004
#define IDM_VIEWZOOM25
Definition: resource.h:75
#define IDM_VIEWZOOM200
Definition: resource.h:78
HWND hStatusBar
Definition: main.cpp:35
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL showMiniature
Definition: main.cpp:61
int GetZoom() const
Definition: toolsmodel.cpp:149
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:76
#define IDM_EDITUNDO
Definition: resource.h:59
ImageModel imageModel
Definition: main.cpp:32
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
CPaletteWindow paletteWindow
Definition: main.cpp:68
#define IDM_FILE1
Definition: resource.h:52
CString strFile1
Definition: registry.h:30
CString strFile4
Definition: registry.h:33
#define IDM_VIEWZOOM50
Definition: resource.h:76
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define IDM_IMAGEDRAWOPAQUE
Definition: resource.h:91
PaletteModel paletteModel
Definition: main.cpp:28
CFontsDialog fontsDialog
Definition: dialogs.cpp:22
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define IDM_EDITINVERTSELECTION
Definition: resource.h:65
#define IDM_IMAGECROP
Definition: resource.h:87
#define NULL
Definition: types.h:112
#define IDM_COLORSOLDPALETTE
Definition: resource.h:95
HANDLE WINAPI GetClipboardData(_In_ UINT)
#define IDM_FILE2
Definition: resource.h:53
PAL_TYPE SelectedPalette()
#define IDM_COLORSMODERNPALETTE
Definition: resource.h:94
#define IDM_EDITDELETESELECTION
Definition: resource.h:64
#define IDM_EDITCOPYTO
Definition: resource.h:67
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
LPARAM lParam
Definition: combotst.c:139
#define IDM_EDITCOPY
Definition: resource.h:62
#define IDM_VIEWZOOM100
Definition: resource.h:77
#define IDM_VIEWCOLORPALETTE
Definition: resource.h:71
BOOL IsWindowVisible() const
Definition: atlwin.h:924
CSelectionWindow selectionWindow
Definition: main.cpp:71
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:138
CString strFile3
Definition: registry.h:32

◆ OnKeyDown()

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

Definition at line 386 of file winproc.cpp.

387 {
388  if (wParam == VK_ESCAPE)
389  {
390  HWND hwndCapture = GetCapture();
391  if (hwndCapture)
392  {
393  if (selectionWindow.m_hWnd == hwndCapture ||
394  imageArea.m_hWnd == hwndCapture ||
395  fullscreenWindow.m_hWnd == hwndCapture ||
396  sizeboxLeftTop.m_hWnd == hwndCapture ||
397  sizeboxCenterTop.m_hWnd == hwndCapture ||
398  sizeboxRightTop.m_hWnd == hwndCapture ||
399  sizeboxLeftCenter.m_hWnd == hwndCapture ||
400  sizeboxRightCenter.m_hWnd == hwndCapture ||
401  sizeboxLeftBottom.m_hWnd == hwndCapture ||
402  sizeboxCenterBottom.m_hWnd == hwndCapture ||
403  sizeboxRightBottom.m_hWnd == hwndCapture)
404  {
405  SendMessage(hwndCapture, nMsg, wParam, lParam);
406  }
407  }
408  else
409  {
410  switch (toolsModel.GetActiveTool())
411  {
412  case TOOL_SHAPE: case TOOL_BEZIER:
414  break;
415  default:
416  break;
417  }
418  }
419  }
420  return 0;
421 }
ToolsModel toolsModel
Definition: main.cpp:18
CSizeboxWindow sizeboxRightCenter
Definition: main.cpp:77
#define VK_ESCAPE
Definition: winuser.h:2194
WPARAM wParam
Definition: combotst.c:138
CImgAreaWindow imageArea
Definition: main.cpp:72
CSizeboxWindow sizeboxCenterTop
Definition: main.cpp:74
CSizeboxWindow sizeboxRightTop
Definition: main.cpp:75
CSizeboxWindow sizeboxCenterBottom
Definition: main.cpp:79
HWND WINAPI GetCapture(void)
Definition: message.c:2880
CSizeboxWindow sizeboxRightBottom
Definition: main.cpp:80
CFullscreenWindow fullscreenWindow
Definition: main.cpp:64
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:76
CSizeboxWindow sizeboxLeftCenter
Definition: main.cpp:76
HWND m_hWnd
Definition: atlwin.h:267
CSizeboxWindow sizeboxLeftBottom
Definition: main.cpp:78
CSizeboxWindow sizeboxLeftTop
Definition: main.cpp:73
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1082
LPARAM lParam
Definition: combotst.c:139
CSelectionWindow selectionWindow
Definition: main.cpp:71

◆ OnMouseWheel()

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

Definition at line 162 of file winproc.cpp.

163 {
164  INT zDelta = (SHORT)HIWORD(wParam);
165 
166  if (::GetAsyncKeyState(VK_CONTROL) < 0)
167  {
168  if (zDelta < 0)
169  {
170  if (toolsModel.GetZoom() > MIN_ZOOM)
171  zoomTo(toolsModel.GetZoom() / 2, 0, 0);
172  }
173  else if (zDelta > 0)
174  {
175  if (toolsModel.GetZoom() < MAX_ZOOM)
176  zoomTo(toolsModel.GetZoom() * 2, 0, 0);
177  }
178  }
179  else
180  {
181  UINT nCount = 3;
182  if (::GetAsyncKeyState(VK_SHIFT) < 0)
183  {
184 #ifndef SPI_GETWHEELSCROLLCHARS
185  #define SPI_GETWHEELSCROLLCHARS 0x006C // Needed for pre-NT6 PSDK
186 #endif
188  for (UINT i = 0; i < nCount; ++i)
189  {
190  if (zDelta < 0)
192  else if (zDelta > 0)
194  }
195  }
196  else
197  {
198  SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &nCount, 0);
199  for (UINT i = 0; i < nCount; ++i)
200  {
201  if (zDelta < 0)
203  else if (zDelta > 0)
205  }
206  }
207  }
208 
209  return 0;
210 }
ToolsModel toolsModel
Definition: main.cpp:18
#define MAKEWPARAM(l, h)
Definition: winuser.h:3989
#define MAX_ZOOM
Definition: common.h:15
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
#define SPI_GETWHEELSCROLLCHARS
short SHORT
Definition: pedump.c:59
#define VK_SHIFT
Definition: winuser.h:2182
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
#define MIN_ZOOM
Definition: common.h:14
int GetZoom() const
Definition: toolsmodel.cpp:149
SHORT WINAPI GetAsyncKeyState(_In_ int)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define SB_LINEDOWN
Definition: winuser.h:565
#define WM_HSCROLL
Definition: winuser.h:1730
#define SB_LINEUP
Definition: winuser.h:564
#define VK_CONTROL
Definition: winuser.h:2183
CScrollboxWindow scrollboxWindow
Definition: main.cpp:69
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:19
#define HIWORD(l)
Definition: typedefs.h:247
#define WM_VSCROLL
Definition: winuser.h:1731

◆ OnSetCursor()

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

Definition at line 379 of file winproc.cpp.

380 {
382  bHandled = FALSE;
383  return 0;
384 }
#define FALSE
Definition: types.h:117
#define LoadCursor
Definition: winuser.h:5792
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define NULL
Definition: types.h:112
#define IDC_ARROW
Definition: winuser.h:682

◆ OnSize() [1/2]

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

Definition at line 358 of file winproc.cpp.

359 {
360  int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 };
361  if (::IsWindow(hStatusBar))
362  {
365  }
367  Invalidate(TRUE);
368  return 0;
369 }
#define TRUE
Definition: types.h:120
BOOL IsWindow() const
Definition: atlwin.h:913
#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:1598
HWND hStatusBar
Definition: main.cpp:35
void alignChildrenToMainWindow()
Definition: winproc.cpp:48
#define SB_SETPARTS
Definition: commctrl.h:1954
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:862
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1082
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 
)
private

Definition at line 243 of file gui.cpp.

244 {
245  if (wParam == SIZE_MINIMIZED)
246  return;
247 
248  /* Size status bar */
249  m_StatusBar->SendMessage(WM_SIZE, 0, 0);
250 
251 
252  RECT r = { 0, 0, LOWORD(lParam), HIWORD(lParam) };
253  HDWP hdwp = NULL;
255 
256  hdwp = BeginDeferWindowPos(count);
257  if (hdwp)
258  {
259  hdwp = m_ClientPanel->OnParentSize(r, hdwp);
260  if (hdwp)
261  {
262  EndDeferWindowPos(hdwp);
263  }
264  }
265 }
HDWP WINAPI BeginDeferWindowPos(_In_ int)
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:421
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define WM_SIZE
Definition: winuser.h:1598
#define SIZE_MINIMIZED
Definition: winuser.h:2486
#define NULL
Definition: types.h:112
#define HIWORD(l)
Definition: typedefs.h:247
CUiPanel * m_ClientPanel
Definition: gui.h:49
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:407
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53

◆ OnSysColorChange()

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

Definition at line 423 of file winproc.cpp.

424 {
425  /* Redirect message to common controls */
427  SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0);
428  return 0;
429 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1613
CToolBox toolBoxContainer
Definition: main.cpp:66
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define FindWindowEx
Definition: winuser.h:5758
HWND m_hWnd
Definition: atlwin.h:267
#define NULL
Definition: types.h:112
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1082

◆ ProcessWindowMessage()

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

Implements ATL::CMessageMap.

Definition at line 311 of file gui.cpp.

312 {
313  theResult = 0;
314  switch (Msg)
315  {
316  case WM_CREATE:
317  if (!InitControls())
318  ::PostMessageW(hwnd, WM_CLOSE, 0, 0);
319  break;
320 
321  case WM_DESTROY:
322  {
325 
326  FreeLogs();
329 
330  delete m_ClientPanel;
331 
332  PostQuitMessage(0);
333  return 0;
334  }
335 
336  case WM_COMMAND:
338  break;
339 
340  case WM_NOTIFY:
341  {
343 
344  switch (data->code)
345  {
346  case TVN_SELCHANGED:
347  {
348  if (data->hwndFrom == m_TreeView->m_hWnd)
349  {
350  switch (((LPNMTREEVIEW)lParam)->itemNew.lParam)
351  {
352  case IDS_INSTALLED:
354  break;
355 
356  case IDS_APPLICATIONS:
358  break;
359 
360  case IDS_UPDATES:
362  break;
363 
366  break;
367 
368  case IDS_CAT_AUDIO:
370  break;
371 
372  case IDS_CAT_DEVEL:
374  break;
375 
376  case IDS_CAT_DRIVERS:
378  break;
379 
380  case IDS_CAT_EDU:
382  break;
383 
384  case IDS_CAT_ENGINEER:
386  break;
387 
388  case IDS_CAT_FINANCE:
390  break;
391 
392  case IDS_CAT_GAMES:
394  break;
395 
396  case IDS_CAT_GRAPHICS:
398  break;
399 
400  case IDS_CAT_INTERNET:
402  break;
403 
404  case IDS_CAT_LIBS:
406  break;
407 
408  case IDS_CAT_OFFICE:
410  break;
411 
412  case IDS_CAT_OTHER:
414  break;
415 
416  case IDS_CAT_SCIENCE:
418  break;
419 
420  case IDS_CAT_TOOLS:
422  break;
423 
424  case IDS_CAT_VIDEO:
426  break;
427 
428  case IDS_CAT_THEMES:
430  break;
431 
432  case IDS_SELECTEDFORINST:
434  break;
435  }
436  }
437 
438  HMENU mainMenu = ::GetMenu(hwnd);
439 
440  /* Disable/enable items based on treeview selection */
442  {
444  EnableMenuItem(mainMenu, ID_INSTALL, MF_GRAYED);
446  EnableMenuItem(mainMenu, ID_MODIFY, MF_ENABLED);
447  }
448  else
449  {
453  EnableMenuItem(mainMenu, ID_MODIFY, MF_GRAYED);
454  }
455  }
456  break;
457 
458  }
459  }
460  break;
461 
462  case WM_SIZE:
464  break;
465 
466  case WM_SIZING:
467  {
468  LPRECT pRect = (LPRECT)lParam;
469 
470  if (pRect->right - pRect->left < 565)
471  pRect->right = pRect->left + 565;
472 
473  if (pRect->bottom - pRect->top < 300)
474  pRect->bottom = pRect->top + 300;
475 
476  return TRUE;
477  }
478 
479  case WM_SYSCOLORCHANGE:
480  {
481  /* Forward WM_SYSCOLORCHANGE to common controls */
483  m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
484  }
485  break;
486 
487  case WM_TIMER:
488  if (wParam == SEARCH_TIMER_ID)
489  {
491 
493  }
494  break;
495  }
496 
497  return FALSE;
498 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1613
BOOL InitControls()
Definition: gui.cpp:229
#define ID_REGREMOVE
Definition: resource.h:83
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
#define IDS_CAT_DEVEL
Definition: resource.h:178
struct @1584 Msg[]
CInstalledApps m_InstalledApps
Definition: gui.h:58
LONG top
Definition: windef.h:307
#define LPNMTREEVIEW
Definition: commctrl.h:3643
#define IDS_CAT_OFFICE
Definition: resource.h:187
LONG left
Definition: windef.h:306
#define IDS_CAT_VIDEO
Definition: resource.h:191
VOID FreeLogs()
Definition: misc.cpp:218
LONG right
Definition: windef.h:308
#define IDS_CAT_FINANCE
Definition: resource.h:182
#define ID_UNINSTALL
Definition: resource.h:75
WPARAM wParam
Definition: combotst.c:138
#define IDS_AVAILABLEFORINST
Definition: resource.h:100
struct tagNMHDR * LPNMHDR
VOID FreeCachedEntries()
Definition: installed.cpp:288
#define IDS_INSTALLED
Definition: resource.h:99
BOOL IsSelectedNodeInstalled()
Definition: gui.cpp:500
void SaveSettings(void)
Definition: settings.c:115
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
BOOL KillTimer(UINT_PTR nIDEvent)
Definition: atlwin.h:942
VOID FreeCachedEntries()
Definition: available.cpp:345
#define WM_SIZING
Definition: winuser.h:1794
#define LPRECT
Definition: precomp.h:28
#define IDS_SELECTEDFORINST
Definition: resource.h:119
#define IDS_CAT_INTERNET
Definition: resource.h:185
#define WM_DESTROY
Definition: winuser.h:1596
#define IDS_CAT_DRIVERS
Definition: resource.h:179
HMENU GetMenu() const
Definition: atlwin.h:648
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
#define IDS_CAT_OTHER
Definition: resource.h:188
#define WM_SIZE
Definition: winuser.h:1598
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define WM_TIMER
Definition: winuser.h:1729
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1608
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define IDS_CAT_LIBS
Definition: resource.h:186
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:358
CApplicationView * m_ApplicationView
Definition: gui.h:55
#define IDS_CAT_THEMES
Definition: resource.h:192
#define IDS_CAT_SCIENCE
Definition: resource.h:189
#define IDS_CAT_GRAPHICS
Definition: resource.h:184
#define IDS_CAT_AUDIO
Definition: resource.h:177
#define WM_COMMAND
Definition: winuser.h:1727
#define IDS_CAT_EDU
Definition: resource.h:180
#define IDS_CAT_ENGINEER
Definition: resource.h:181
CAvailableApps m_AvailableApps
Definition: gui.h:57
#define IDS_APPLICATIONS
Definition: resource.h:102
#define SEARCH_TIMER_ID
Definition: gui.cpp:32
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:675
BOOL ShowWindow(int nCmdShow)
Definition: atlwin.h:1299
#define ID_INSTALL
Definition: resource.h:74
#define IDS_UPDATES
Definition: resource.h:101
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:431
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_CAT_TOOLS
Definition: resource.h:190
#define WM_CREATE
Definition: winuser.h:1595
LONG bottom
Definition: windef.h:309
#define MF_GRAYED
Definition: winuser.h:129
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
CUiPanel * m_ClientPanel
Definition: gui.h:49
#define IDS_CAT_GAMES
Definition: resource.h:183
LPARAM lParam
Definition: combotst.c:139
#define ID_MODIFY
Definition: resource.h:78
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_NOTIFY
Definition: richedit.h:61
CSideTreeView * m_TreeView
Definition: gui.h:52

◆ RemoveSelectedAppFromRegistry()

BOOL CMainWindow::RemoveSelectedAppFromRegistry ( )
private

Definition at line 267 of file gui.cpp.

268 {
270  return FALSE;
271 
272  ATL::CStringW szMsgText, szMsgTitle;
273 
274  if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) ||
275  !szMsgTitle.LoadStringW(IDS_INFORMATION))
276  return FALSE;
277 
278  if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
279  {
281  if (!InstalledApp)
282  return FALSE;
283 
284  LSTATUS Result = InstalledApp->RemoveFromRegistry();
285  if (Result != ERROR_SUCCESS)
286  {
287  // TODO: popup a messagebox telling user it fails somehow
288  return FALSE;
289  }
290 
291  // as it's already removed form registry, this will also remove it from the list
293  return TRUE;
294  }
295 
296  return FALSE;
297 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define IDYES
Definition: winuser.h:829
#define TRUE
Definition: types.h:120
INT SelectedEnumType
Definition: gui.h:63
#define FALSE
Definition: types.h:117
#define MB_YESNO
Definition: winuser.h:811
#define MB_ICONQUESTION
Definition: winuser.h:783
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
BOOL IsInstalledEnum(INT x)
Definition: defines.h:70
CApplicationView * m_ApplicationView
Definition: gui.h:55
#define IDS_APP_REG_REMOVE
Definition: resource.h:106
VOID UpdateApplicationsList(INT EnumType)
Definition: gui.cpp:675
#define IDS_INFORMATION
Definition: resource.h:107
PVOID GetFocusedItemData()
Definition: appview.cpp:2061

Referenced by OnCommand().

◆ s_EnumAvailableAppProc()

BOOL CALLBACK CMainWindow::s_EnumAvailableAppProc ( CAvailableApplicationInfo Info,
BOOL  bInitialCheckState,
PVOID  param 
)
staticprivate

Definition at line 651 of file gui.cpp.

652 {
653  CMainWindow *pThis = (CMainWindow *)param;
654  return pThis->EnumAvailableAppProc(Info, bInitialCheckState);
655 }
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
BOOL CALLBACK EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState)
Definition: gui.cpp:635
GLfloat param
Definition: glext.h:5796

Referenced by UpdateApplicationsList().

◆ s_EnumInstalledAppProc()

BOOL CALLBACK CMainWindow::s_EnumInstalledAppProc ( CInstalledApplicationInfo Info,
PVOID  param 
)
staticprivate

Definition at line 645 of file gui.cpp.

646 {
647  CMainWindow *pThis = (CMainWindow *)param;
648  return pThis->EnumInstalledAppProc(Info);
649 }
BOOL CALLBACK EnumInstalledAppProc(CInstalledApplicationInfo *Info)
Definition: gui.cpp:626
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
GLfloat param
Definition: glext.h:5796

Referenced by UpdateApplicationsList().

◆ s_EnumSelectedAppForDownloadProc()

BOOL CALLBACK CMainWindow::s_EnumSelectedAppForDownloadProc ( CAvailableApplicationInfo Info,
BOOL  bInitialCheckState,
PVOID  param 
)
staticprivate

Definition at line 657 of file gui.cpp.

658 {
660  pAppList->Add(*Info);
661  return TRUE;
662 }
BOOL Add(const T &t)
Definition: atlsimpcoll.h:58
#define TRUE
Definition: types.h:120
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
GLfloat param
Definition: glext.h:5796

Referenced by InstallApplication(), and OnCommand().

◆ saveImage()

void CMainWindow::saveImage ( BOOL  overwrite)

Definition at line 90 of file winproc.cpp.

91 {
92  if (isAFile && overwrite)
93  {
95  }
96  else if (GetSaveFileName(&sfn) != 0)
97  {
100  CString strTitle;
102  SetWindowText(strTitle);
103  isAFile = TRUE;
104  }
105 }
BOOL isAFile
Definition: main.cpp:53
void SaveImage(LPTSTR lpFileName)
Definition: history.cpp:167
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define TRUE
Definition: types.h:120
_TCHAR * _tcsncpy(_TCHAR *dst, const _TCHAR *src, size_t n)
Definition: tcsncpy.h:9
LPWSTR lpstrFile
Definition: commdlg.h:367
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
BOOL SetWindowText(LPCTSTR lpszString)
Definition: atlwin.h:1266
#define GetSaveFileName
Definition: commdlg.h:666
OPENFILENAMEW sfn
Definition: eventvwr.c:120
#define _countof(array)
Definition: sndvol32.h:68
#define IDS_WINDOWTITLE
Definition: resource.h:180
TCHAR filepathname[1000]
Definition: main.cpp:52
ImageModel imageModel
Definition: main.cpp:32
LPWSTR lpstrFileTitle
Definition: commdlg.h:369

Referenced by ConfirmSave(), and OnCommand().

◆ SearchTextChanged()

BOOL CMainWindow::SearchTextChanged ( ATL::CStringW SearchText)

Definition at line 824 of file gui.cpp.

825 {
826  if (szSearchPattern == SearchText)
827  {
828  return FALSE;
829  }
830 
831  szSearchPattern = SearchText;
832 
833  DWORD dwDelay;
834  SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
835  SetTimer(SEARCH_TIMER_ID, dwDelay);
836 
837  return TRUE;
838 }
ATL::CStringW szSearchPattern
Definition: gui.h:62
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1224
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SEARCH_TIMER_ID
Definition: gui.cpp:32

Referenced by CApplicationView::OnCommand().

◆ ShowAboutDlg()

VOID CMainWindow::ShowAboutDlg ( )
private

Definition at line 519 of file gui.cpp.

520 {
521  ATL::CStringW szApp;
522  ATL::CStringW szAuthors;
523  HICON hIcon;
524 
525  szApp.LoadStringW(IDS_APPTITLE);
526  szAuthors.LoadStringW(IDS_APP_AUTHORS);
528  ShellAboutW(m_hWnd, szApp, szAuthors, hIcon);
530 }
static HICON
Definition: imagelist.c:84
#define IDS_APPTITLE
Definition: resource.h:3
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDI_MAIN
Definition: resource.h:4
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
HWND m_hWnd
Definition: atlwin.h:267
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_APP_AUTHORS
Definition: resource.h:122

Referenced by OnCommand().

◆ UninstallSelectedApp()

BOOL CMainWindow::UninstallSelectedApp ( BOOL  bModify)
private

Definition at line 299 of file gui.cpp.

300 {
302  return FALSE;
303 
305  if (!InstalledApp)
306  return FALSE;
307 
308  return InstalledApp->UninstallApplication(bModify);
309 }
INT SelectedEnumType
Definition: gui.h:63
#define FALSE
Definition: types.h:117
BOOL UninstallApplication(BOOL bModify)
Definition: installed.cpp:138
BOOL IsInstalledEnum(INT x)
Definition: defines.h:70
CApplicationView * m_ApplicationView
Definition: gui.h:55
PVOID GetFocusedItemData()
Definition: appview.cpp:2061

Referenced by OnCommand().

◆ UpdateApplicationsList()

VOID CMainWindow::UpdateApplicationsList ( INT  EnumType)
private

Definition at line 675 of file gui.cpp.

676 {
677  bUpdating = TRUE;
678 
679  if (EnumType == -1)
680  {
681  // keep the old enum type
682  EnumType = SelectedEnumType;
683  }
684  else
685  {
686  SelectedEnumType = EnumType;
687  }
688 
690  if (IsInstalledEnum(EnumType))
691  {
692  // set the display type of application-view. this will remove all the item in application-view too.
694 
695  // enum installed softwares
697  }
698  else if (IsAvailableEnum(EnumType))
699  {
700  // set the display type of application-view. this will remove all the item in application-view too.
702 
703  // enum available softwares
705  }
707  m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
709 
710  CStringW text;
712  {
713  text.LoadString(IDS_NO_SEARCH_RESULTS);
714  }
716 
717  bUpdating = FALSE;
718 }
ATL::CStringW szSearchPattern
Definition: gui.h:62
#define TRUE
Definition: types.h:120
const WCHAR * text
Definition: package.c:1834
BOOL bUpdating
Definition: gui.h:60
CInstalledApps m_InstalledApps
Definition: gui.h:58
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:2048
INT SelectedEnumType
Definition: gui.h:63
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1976
#define FALSE
Definition: types.h:117
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1740
static BOOL CALLBACK s_EnumAvailableAppProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:651
BOOL IsAvailableEnum(INT x)
Definition: defines.h:65
BOOL Enum(INT EnumType, APPENUMPROC lpEnumProc, PVOID param)
Definition: installed.cpp:176
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:448
BOOL IsInstalledEnum(INT x)
Definition: defines.h:70
CApplicationView * m_ApplicationView
Definition: gui.h:55
VOID UpdateStatusBarText()
Definition: gui.cpp:664
CAvailableApps m_AvailableApps
Definition: gui.h:57
bool IsEmpty() const
Definition: atlsimpstr.h:379
#define RDW_ALLCHILDREN
Definition: winuser.h:1211
static BOOL CALLBACK s_EnumInstalledAppProc(CInstalledApplicationInfo *Info, PVOID param)
Definition: gui.cpp:645
#define IDS_NO_SEARCH_RESULTS
Definition: resource.h:126
#define RDW_INVALIDATE
Definition: winuser.h:1204

Referenced by InstallApplication(), OnCommand(), ProcessWindowMessage(), and RemoveSelectedAppFromRegistry().

◆ UpdateStatusBarText()

VOID CMainWindow::UpdateStatusBarText ( )
private

Definition at line 664 of file gui.cpp.

665 {
666  if (m_StatusBar)
667  {
668  ATL::CStringW szBuffer;
669 
671  m_StatusBar->SetText(szBuffer);
672  }
673 }
#define IDS_APPS_COUNT
Definition: resource.h:95
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
CApplicationView * m_ApplicationView
Definition: gui.h:55
int GetSelectedCount()
Definition: available.cpp:577
CAvailableApps m_AvailableApps
Definition: gui.h:57
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:457
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:53

Referenced by InitControls(), ItemCheckStateChanged(), and UpdateApplicationsList().

Member Data Documentation

◆ bUpdating

BOOL CMainWindow::bUpdating = FALSE
private

Definition at line 60 of file gui.h.

Referenced by CreateLayout(), ItemCheckStateChanged(), and UpdateApplicationsList().

◆ m_ApplicationView

◆ m_AvailableApps

CAvailableApps CMainWindow::m_AvailableApps
private

◆ m_ClientPanel

CUiPanel* CMainWindow::m_ClientPanel = NULL
private

Definition at line 49 of file gui.h.

Referenced by CreateLayout(), CreateStatusBar(), CreateVSplitter(), OnSize(), and ProcessWindowMessage().

◆ m_InstalledApps

CInstalledApps CMainWindow::m_InstalledApps
private

Definition at line 58 of file gui.h.

Referenced by ProcessWindowMessage(), and UpdateApplicationsList().

◆ m_StatusBar

CUiWindow<CStatusBar>* CMainWindow::m_StatusBar = NULL
private

Definition at line 53 of file gui.h.

Referenced by CreateLayout(), CreateStatusBar(), LayoutCleanup(), OnSize(), and UpdateStatusBarText().

◆ m_TreeView

CSideTreeView* CMainWindow::m_TreeView = NULL
private

◆ m_VSplitter

CUiSplitPanel* CMainWindow::m_VSplitter = NULL
private

◆ SelectedEnumType

INT CMainWindow::SelectedEnumType
private

◆ szSearchPattern

ATL::CStringW CMainWindow::szSearchPattern
private

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