ReactOS  0.4.15-dev-5487-ge7bbbf0
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:941
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:535
#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:1110
LONG bottom
Definition: windef.h:309
BOOL IsWindowVisible() const
Definition: atlwin.h:952

Referenced by OnCommand(), and OnSize().

◆ ConfirmSave()

BOOL CMainWindow::ConfirmSave ( )

Definition at line 241 of file winproc.cpp.

242 {
244 
245  if (imageModel.IsImageSaved())
246  return TRUE;
247 
248  CString strProgramName;
249  strProgramName.LoadString(IDS_PROGRAMNAME);
250 
251  CString strSavePromptText;
253 
254  switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
255  {
256  case IDYES:
257  saveImage(TRUE);
258  return imageModel.IsImageSaved();
259  case IDNO:
260  return TRUE;
261  case IDCANCEL:
262  return FALSE;
263  }
264 
265  return TRUE;
266 }
#define IDYES
Definition: winuser.h:829
#define TRUE
Definition: types.h:120
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:753
CImgAreaWindow imageArea
Definition: main.cpp:72
#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
void finishDrawing()
Definition: imgarea.cpp:415
#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:996
BOOL IsImageSaved() const
Definition: history.cpp:174

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:810
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define WM_SIZE
Definition: winuser.h:1601
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:1613
#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:5709

◆ 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:1192
int GetSize() const
Definition: atlsimpcoll.h:104
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:2069
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 109 of file winproc.cpp.

110 {
111  int width = GetDIBWidth(bitmap);
112  int height = GetDIBHeight(bitmap);
113  int curWidth = imageModel.GetWidth();
114  int curHeight = imageModel.GetHeight();
115 
116  if (width > curWidth || height > curHeight)
117  {
118  BOOL shouldEnlarge = TRUE;
119 
120  if (askBeforeEnlarging)
121  {
122  TCHAR programname[20];
123  TCHAR shouldEnlargePromptText[100];
124 
125  LoadString(hProgInstance, IDS_PROGRAMNAME, programname, _countof(programname));
126  LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, _countof(shouldEnlargePromptText));
127 
128  switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
129  {
130  case IDYES:
131  break;
132  case IDNO:
133  shouldEnlarge = FALSE;
134  break;
135  case IDCANCEL:
136  return;
137  }
138  }
139 
140  if (shouldEnlarge)
141  {
142  if (width > curWidth)
143  curWidth = width;
144 
145  if (height > curHeight)
146  curHeight = height;
147 
148  imageModel.Crop(curWidth, curHeight, 0, 0);
149  }
150  }
151 
155 
158 
159  placeSelWin();
160  selectionWindow.ShowWindow(SW_SHOW);
162 }
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
void InsertFromHBITMAP(HBITMAP hBm, INT x=0, INT y=0)
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
int GetDIBHeight(HBITMAP hBitmap)
Definition: dib.cpp:62
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:131
int GetDIBWidth(HBITMAP hBitmap)
Definition: dib.cpp:54
#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:215
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:5768
#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:1730
HINSTANCE hProgInstance
Definition: main.cpp:50
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
void ForceRefreshSelectionContents()
Definition: selection.cpp:24
int GetHeight() const
Definition: history.cpp:220
#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:1110
#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:996
#define LoadString
Definition: winuser.h:5809
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:567
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:1061
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:444
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:1044

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:551
CAvailableApps m_AvailableApps
Definition: gui.h:57
BOOL RemoveSelected(CAvailableApplicationInfo *AvlbInfo)
Definition: available.cpp:556

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 268 of file winproc.cpp.

269 {
270  if (ConfirmSave())
271  {
272  DestroyWindow();
273  }
274  return 0;
275 }
BOOL DestroyWindow()
Definition: atlwin.h:456
BOOL ConfirmSave()
Definition: winproc.cpp:241

◆ OnCommand() [1/2]

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

Definition at line 428 of file winproc.cpp.

429 {
430  // Disable commands while dragging mouse
431  if (imageArea.drawing && ::GetCapture())
432  {
433  ATLTRACE("locking!\n");
434  return 0;
435  }
436 
437  switch (LOWORD(wParam))
438  {
439  case IDM_HELPINFO:
440  {
442  TCHAR infotitle[100];
443  TCHAR infotext[200];
444  LoadString(hProgInstance, IDS_INFOTITLE, infotitle, _countof(infotitle));
445  LoadString(hProgInstance, IDS_INFOTEXT, infotext, _countof(infotext));
446  ShellAbout(m_hWnd, infotitle, infotext, paintIcon);
447  DeleteObject(paintIcon);
448  break;
449  }
450  case IDM_HELPHELPTOPICS:
451  HtmlHelp(m_hWnd, _T("help\\Paint.chm"), 0, 0);
452  break;
453  case IDM_FILEEXIT:
455  break;
456  case IDM_FILENEW:
457  if (ConfirmSave())
458  {
460  }
461  break;
462  case IDM_FILEOPEN:
463  if (ConfirmSave() && GetOpenFileName(&ofn))
464  {
466  }
467  break;
468  case IDM_FILESAVE:
469  saveImage(TRUE);
470  break;
471  case IDM_FILESAVEAS:
472  saveImage(FALSE);
473  break;
474  case IDM_FILEPAGESETUP:
475  // DUMMY: Shows the dialog only, no functionality
476  PAGESETUPDLG psd;
477  ZeroMemory(&psd, sizeof(psd));
478  psd.lStructSize = sizeof(psd);
479  psd.hwndOwner = m_hWnd;
480  PageSetupDlg(&psd);
481  break;
482  case IDM_FILEPRINT:
483  // TODO: Test whether it actually works
484  PRINTDLG pd;
485  ZeroMemory(&pd, sizeof(pd));
486  pd.lStructSize = sizeof(pd);
487  pd.hwndOwner = m_hWnd;
488  pd.hDevMode = NULL; // freed by user
489  pd.hDevNames = NULL; // freed by user
491  pd.nCopies = 1;
492  pd.nFromPage = 0xffff;
493  pd.nToPage = 0xffff;
494  pd.nMinPage = 1;
495  pd.nMaxPage = 0xffff;
496  if (PrintDlg(&pd) == TRUE)
497  {
499  DeleteDC(pd.hDC);
500  }
501  if (pd.hDevMode)
502  GlobalFree(pd.hDevMode);
503  if (pd.hDevNames)
504  GlobalFree(pd.hDevNames);
505  break;
508  break;
511  break;
514  break;
515  case IDM_FILE1:
516  {
518  break;
519  }
520  case IDM_FILE2:
521  {
523  break;
524  }
525  case IDM_FILE3:
526  {
528  break;
529  }
530  case IDM_FILE4:
531  {
533  break;
534  }
535  case IDM_EDITUNDO:
537  break;
538  if (selectionWindow.IsWindowVisible())
539  {
542  {
544  break;
545  }
546  }
547  if (ToolBase::pointSP != 0) // drawing something?
548  {
550  break;
551  }
552  imageModel.Undo();
554  break;
555  case IDM_EDITREDO:
557  break;
558  if (ToolBase::pointSP != 0) // drawing something?
559  {
561  break;
562  }
563  imageModel.Redo();
565  break;
566  case IDM_EDITCOPY:
567  OpenClipboard();
568  EmptyClipboard();
570  CloseClipboard();
571  break;
572  case IDM_EDITCUT:
573  /* Copy */
575  /* Delete selection */
577  break;
578  case IDM_EDITPASTE:
579  OpenClipboard();
581  {
583  }
584  CloseClipboard();
585  break;
587  {
588  switch (toolsModel.GetActiveTool())
589  {
590  case TOOL_FREESEL:
591  case TOOL_RECTSEL:
593  break;
594 
595  case TOOL_TEXT:
597  break;
598  default:
599  break;
600  }
601  break;
602  }
603  case IDM_EDITSELECTALL:
604  {
606  {
607  textEditWindow.SendMessage(EM_SETSEL, 0, -1);
608  break;
609  }
614  break;
615  }
616  case IDM_EDITCOPYTO:
617  if (GetSaveFileName(&ofn))
619  break;
620  case IDM_EDITPASTEFROM:
621  if (GetOpenFileName(&ofn))
622  {
624  if (hbmNew)
625  {
627  DeleteObject(hbmNew);
628  }
629  }
630  break;
632  if (ChooseColor(&choosecolor))
634  break;
637  break;
640  break;
642  {
644  break;
645  }
650  break;
652  switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
653  {
654  case 1: /* flip horizontally */
657  else
659  break;
660  case 2: /* flip vertically */
663  else
665  break;
666  case 3: /* rotate 90 degrees */
669  else
671  break;
672  case 4: /* rotate 180 degrees */
675  else
677  break;
678  case 5: /* rotate 270 degrees */
681  else
683  break;
684  }
685  break;
686  case IDM_IMAGEATTRIBUTES:
687  {
688  if (attributesDialog.DoModal(mainWindow.m_hWnd))
689  {
691  }
692  break;
693  }
695  {
696  if (stretchSkewDialog.DoModal(mainWindow.m_hWnd))
697  {
699  {
702  }
703  else
704  {
707  }
708  }
709  break;
710  }
711  case IDM_IMAGEDRAWOPAQUE:
713  break;
714  case IDM_IMAGECROP:
716  break;
717 
718  case IDM_VIEWTOOLBOX:
721  break;
725  break;
726  case IDM_VIEWSTATUSBAR:
729  break;
730  case IDM_FORMATICONBAR:
732  {
733  if (!fontsDialog.IsWindow())
734  {
735  fontsDialog.Create(mainWindow);
736  }
739  fontsDialog.SendMessage(DM_REPOSITION, 0, 0);
740  }
741  break;
742  case IDM_VIEWSHOWGRID:
743  showGrid = !showGrid;
745  break;
748  miniature.ShowWindow(showMiniature ? SW_SHOW : SW_HIDE);
749  break;
750 
751  case IDM_VIEWZOOM125:
752  zoomTo(125, 0, 0);
753  break;
754  case IDM_VIEWZOOM25:
755  zoomTo(250, 0, 0);
756  break;
757  case IDM_VIEWZOOM50:
758  zoomTo(500, 0, 0);
759  break;
760  case IDM_VIEWZOOM100:
761  zoomTo(1000, 0, 0);
762  break;
763  case IDM_VIEWZOOM200:
764  zoomTo(2000, 0, 0);
765  break;
766  case IDM_VIEWZOOM400:
767  zoomTo(4000, 0, 0);
768  break;
769  case IDM_VIEWZOOM800:
770  zoomTo(8000, 0, 0);
771  break;
772 
773  case IDM_VIEWFULLSCREEN:
774  fullscreenWindow.ShowWindow(SW_SHOW);
776  break;
777  }
778  return 0;
779 }
#define IDM_IMAGESTRETCHSKEW
Definition: resource.h:86
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCTSTR name, DWORD dwFileSize, BOOL isFile)
Definition: dib.cpp:109
#define IDM_EDITPASTE
Definition: resource.h:63
#define IDM_EDITCUT
Definition: resource.h:61
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
void FlipHorizontally()
Definition: history.cpp:244
#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:3998
#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:225
#define ZeroMemory
Definition: winbase.h:1670
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
#define ATLTRACE(format,...)
Definition: atltrace.h:276
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:81
#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:131
#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:239
HWND WINAPI GetCapture(void)
Definition: message.c:2881
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:140
#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:115
DWORD ShowTextTool
Definition: registry.h:43
int GetWidth() const
Definition: history.cpp:215
static INT pointSP
Definition: toolsmodel.h:39
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
void finishDrawing()
Definition: imgarea.cpp:415
#define IDM_FILESAVE
Definition: resource.h:36
void InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
Definition: winproc.cpp:109
#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:189
#define FindWindowEx
Definition: winuser.h:5768
BOOL OpenClipboard()
Definition: atlwin.h:1032
#define WM_CLOSE
Definition: winuser.h:1611
#define IDM_VIEWZOOM25
Definition: resource.h:75
#define IDM_VIEWZOOM200
Definition: resource.h:78
#define EM_SETSEL
Definition: winuser.h:2008
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:260
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:2090
void selectAll()
Definition: toolsmodel.cpp:236
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:1730
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:69
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:1327
int GetHeight() const
Definition: history.cpp:220
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:160
#define NULL
Definition: types.h:112
#define IDM_COLORSOLDPALETTE
Definition: resource.h:95
HANDLE WINAPI GetClipboardData(_In_ UINT)
BOOL drawing
Definition: imgarea.h:20
void cancelDrawing()
Definition: imgarea.cpp:238
DWORD lStructSize
Definition: commdlg.h:465
BOOL Invalidate(BOOL bErase=TRUE)
Definition: atlwin.h:890
void FlipVertically()
Definition: history.cpp:252
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:1110
#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:5803
CTextEditWindow textEditWindow
Definition: main.cpp:81
void DeleteSelection()
Definition: history.cpp:293
CHOOSECOLOR choosecolor
Definition: main.cpp:36
RegistrySettings registrySettings
Definition: main.cpp:30
void Undo(BOOL bClearRedo=FALSE)
Definition: history.cpp:60
#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:241
#define SRCCOPY
Definition: wingdi.h:333
#define LoadString
Definition: winuser.h:5809
#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:952
CSelectionWindow selectionWindow
Definition: main.cpp:71
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:135
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:567
static BOOL CALLBACK s_EnumSelectedAppForDownloadProc(CAvailableApplicationInfo *Info, BOOL bInitialCheckState, PVOID param)
Definition: gui.cpp:657
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#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:17
BOOL DownloadApplication(CAvailableApplicationInfo *pAppInfo)
Definition: loaddlg.cpp:1061
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:444
#define WM_CLOSE
Definition: winuser.h:1611
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:438
#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:1044
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:2059

◆ OnCreate()

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

Definition at line 227 of file winproc.cpp.

228 {
231  return 0;
232 }
#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:1110
#define LoadIcon
Definition: winuser.h:5803
#define ICON_BIG
Definition: tnclass.cpp:51

◆ OnDestroy()

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

Definition at line 234 of file winproc.cpp.

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

215 {
216  TCHAR droppedfile[MAX_PATH];
217 
218  HDROP hDrop = (HDROP)wParam;
219  DragQueryFile(hDrop, 0, droppedfile, _countof(droppedfile));
220  DragFinish(hDrop);
221 
222  ConfirmSave() && DoLoadImageFile(m_hWnd, droppedfile, TRUE);
223 
224  return 0;
225 }
#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:160
#define DragQueryFile
Definition: shellapi.h:684
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
BOOL ConfirmSave()
Definition: winproc.cpp:241

◆ OnGetMinMaxInfo()

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

Definition at line 375 of file winproc.cpp.

376 {
378  mm->ptMinTrackSize.x = 330;
379  mm->ptMinTrackSize.y = 430;
380  return 0;
381 }
POINT ptMinTrackSize
Definition: winuser.h:3620
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 277 of file winproc.cpp.

278 {
279  HMENU menu = GetMenu();
280  BOOL trueSelection =
283  switch (lParam)
284  {
285  case 0: /* File menu */
286  if ((HMENU)wParam != GetSubMenu(menu, 0))
287  break;
296  {
298  CPath pathFile1(registrySettings.strFile1);
299  pathFile1.CompactPathEx(30);
301  {
302  CPath pathFile2(registrySettings.strFile2);
303  pathFile2.CompactPathEx(30);
305  {
306  CPath pathFile3(registrySettings.strFile3);
307  pathFile3.CompactPathEx(30);
309  {
310  CPath pathFile4(registrySettings.strFile4);
311  pathFile4.CompactPathEx(30);
312  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE4, _T("4 ") + pathFile4);
313  }
314  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE3, _T("3 ") + pathFile3);
315  }
316  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE2, _T("2 ") + pathFile2);
317  }
318  InsertMenu((HMENU)wParam, 17, MF_BYPOSITION | MF_STRING, IDM_FILE1, _T("1 ") + pathFile1);
319  }
320  break;
321  case 1: /* Edit menu */
324  EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(trueSelection));
325  EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(trueSelection));
326  EnableMenuItem(menu, IDM_EDITDELETESELECTION, ENABLED_IF(trueSelection));
327  EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
328  EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
329  OpenClipboard();
331  CloseClipboard();
332  break;
333  case 2: /* View menu */
339 
342  break;
343  case 3: /* Image menu */
346  break;
347  }
348 
356 
359  return 0;
360 }
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:179
#define InsertMenu
Definition: winuser.h:5793
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:184
#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:676
#define IDM_FILE4
Definition: resource.h:55
#define _T(x)
Definition: vfdio.h:22
BOOL OpenClipboard()
Definition: atlwin.h:1032
#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:148
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:952
CSelectionWindow selectionWindow
Definition: main.cpp:71
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:135
CString strFile3
Definition: registry.h:32

◆ OnKeyDown()

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

Definition at line 390 of file winproc.cpp.

391 {
392  if (wParam == VK_ESCAPE)
393  {
394  HWND hwndCapture = GetCapture();
395  if (hwndCapture)
396  {
397  if (selectionWindow.m_hWnd == hwndCapture ||
398  imageArea.m_hWnd == hwndCapture ||
399  fullscreenWindow.m_hWnd == hwndCapture ||
400  sizeboxLeftTop.m_hWnd == hwndCapture ||
401  sizeboxCenterTop.m_hWnd == hwndCapture ||
402  sizeboxRightTop.m_hWnd == hwndCapture ||
403  sizeboxLeftCenter.m_hWnd == hwndCapture ||
404  sizeboxRightCenter.m_hWnd == hwndCapture ||
405  sizeboxLeftBottom.m_hWnd == hwndCapture ||
406  sizeboxCenterBottom.m_hWnd == hwndCapture ||
407  sizeboxRightBottom.m_hWnd == hwndCapture)
408  {
409  SendMessage(hwndCapture, nMsg, wParam, lParam);
410  }
411  }
412  else
413  {
415  }
416  }
417  return 0;
418 }
CSizeboxWindow sizeboxRightCenter
Definition: main.cpp:77
#define VK_ESCAPE
Definition: winuser.h:2204
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:2881
CSizeboxWindow sizeboxRightBottom
Definition: main.cpp:80
CFullscreenWindow fullscreenWindow
Definition: main.cpp:64
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:1110
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 164 of file winproc.cpp.

165 {
166  INT zDelta = (SHORT)HIWORD(wParam);
167 
168  if (::GetAsyncKeyState(VK_CONTROL) < 0)
169  {
170  if (zDelta < 0)
171  {
172  if (toolsModel.GetZoom() > MIN_ZOOM)
173  zoomTo(toolsModel.GetZoom() / 2, 0, 0);
174  }
175  else if (zDelta > 0)
176  {
177  if (toolsModel.GetZoom() < MAX_ZOOM)
178  zoomTo(toolsModel.GetZoom() * 2, 0, 0);
179  }
180  }
181  else
182  {
183  UINT nCount = 3;
184  if (::GetAsyncKeyState(VK_SHIFT) < 0)
185  {
186 #ifndef SPI_GETWHEELSCROLLCHARS
187  #define SPI_GETWHEELSCROLLCHARS 0x006C // Needed for pre-NT6 PSDK
188 #endif
190  for (UINT i = 0; i < nCount; ++i)
191  {
192  if (zDelta < 0)
194  else if (zDelta > 0)
196  }
197  }
198  else
199  {
200  SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &nCount, 0);
201  for (UINT i = 0; i < nCount; ++i)
202  {
203  if (zDelta < 0)
205  else if (zDelta > 0)
207  }
208  }
209  }
210 
211  return 0;
212 }
ToolsModel toolsModel
Definition: main.cpp:18
#define MAKEWPARAM(l, h)
Definition: winuser.h:3999
#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:2192
#define MIN_ZOOM
Definition: common.h:14
int GetZoom() const
Definition: toolsmodel.cpp:148
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
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
unsigned int UINT
Definition: ndis.h:50
#define SB_LINEDOWN
Definition: winuser.h:565
#define WM_HSCROLL
Definition: winuser.h:1733
#define SB_LINEUP
Definition: winuser.h:564
#define VK_CONTROL
Definition: winuser.h:2193
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:1734

◆ OnSetCursor()

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

Definition at line 383 of file winproc.cpp.

384 {
386  bHandled = FALSE;
387  return 0;
388 }
#define FALSE
Definition: types.h:117
#define LoadCursor
Definition: winuser.h:5802
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 362 of file winproc.cpp.

363 {
364  int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 };
365  if (::IsWindow(hStatusBar))
366  {
369  }
371  Invalidate(TRUE);
372  return 0;
373 }
#define TRUE
Definition: types.h:120
BOOL IsWindow() const
Definition: atlwin.h:941
#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:1601
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:890
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1110
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:1601
#define SIZE_MINIMIZED
Definition: winuser.h:2496
#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 420 of file winproc.cpp.

421 {
422  /* Redirect message to common controls */
424  SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0);
425  return 0;
426 }
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616
CToolBox toolBoxContainer
Definition: main.cpp:66
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define FindWindowEx
Definition: winuser.h:5768
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:1110

◆ 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:1616
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
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:359
#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:970
VOID FreeCachedEntries()
Definition: available.cpp:341
#define WM_SIZING
Definition: winuser.h:1797
#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:1599
#define IDS_CAT_DRIVERS
Definition: resource.h:179
HMENU GetMenu() const
Definition: atlwin.h:676
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
#define IDS_CAT_OTHER
Definition: resource.h:188
#define WM_SIZE
Definition: winuser.h:1601
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define WM_TIMER
Definition: winuser.h:1732
#define MF_ENABLED
Definition: winuser.h:128
#define WM_CLOSE
Definition: winuser.h:1611
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:362
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:1730
#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:1327
#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:428
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:1598
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
struct @1595 Msg[]
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 WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
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
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:2059

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 {
93 
94  if (isAFile && overwrite)
95  {
97  }
98  else if (GetSaveFileName(&sfn) != 0)
99  {
102  CString strTitle;
104  SetWindowText(strTitle);
105  isAFile = TRUE;
106  }
107 }
BOOL isAFile
Definition: main.cpp:53
void SaveImage(LPTSTR lpFileName)
Definition: history.cpp:169
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:1294
CImgAreaWindow imageArea
Definition: main.cpp:72
#define GetSaveFileName
Definition: commdlg.h:666
void finishDrawing()
Definition: imgarea.cpp:415
OPENFILENAMEW sfn
Definition: eventvwr.c:101
#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:1252
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SEARCH_TIMER_ID
Definition: gui.cpp:32
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

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:209
BOOL IsInstalledEnum(INT x)
Definition: defines.h:70
CApplicationView * m_ApplicationView
Definition: gui.h:55
PVOID GetFocusedItemData()
Definition: appview.cpp:2059

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:1799
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:247
BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc, PVOID param)
Definition: available.cpp:444
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:573
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().

◆