ReactOS 0.4.15-dev-6068-g8061a6f
CMainWindow Class Reference

#include <winproc.h>

Inheritance diagram for CMainWindow:
Collaboration diagram for CMainWindow:

Public Member Functions

 CMainWindow ()
 
HWND DoCreate ()
 
BOOL GetOpenFileName (IN OUT LPTSTR pszFile, INT cchMaxFile)
 
BOOL GetSaveFileName (IN OUT LPTSTR pszFile, INT cchMaxFile)
 
BOOL ChooseColor (IN OUT COLORREF *prgbColor)
 
 CMainWindow (CAppDB *db, BOOL bAppwiz=FALSE)
 
 ~CMainWindow ()
 
HWND Create ()
 
VOID ItemCheckStateChanged (BOOL bChecked, LPVOID CallbackParam)
 
BOOL InstallApplication (CAppInfo *Info)
 
BOOL SearchTextChanged (CStringW &SearchText)
 
void HandleTabOrder (int direction)
 
- 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< TBase, TWinTraits >
 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< TBase >
 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)
 
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
- 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)
 

Static Public Member Functions

static ATL::CWndClassInfoGetWndClassInfo ()
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CMainWindow >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
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, CWindow, CFrameWinTraits >
static LPCTSTR GetWndCaption ()
 

Private 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 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 ()
 
void ProcessFileMenu (HMENU hPopupMenu)
 
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)
 
VOID ShowAboutDlg ()
 
VOID OnCommand (WPARAM wParam, LPARAM lParam)
 
VOID UpdateStatusBarText ()
 
VOID UpdateApplicationsList (AppsCategories EnumType, BOOL bReload=FALSE)
 
VOID AddApplicationsToView (CAtlList< CAppInfo * > &List)
 

Private Attributes

HMENU m_hMenu
 
CUiPanelm_ClientPanel = NULL
 
CUiSplitPanelm_VSplitter = NULL
 
CSideTreeViewm_TreeView = NULL
 
CUiWindow< CStatusBar > * m_StatusBar = NULL
 
CApplicationViewm_ApplicationView = NULL
 
CAppDBm_Db
 
CAtlList< CAppInfo * > m_Selected
 
BOOL bUpdating = FALSE
 
BOOL bAppwizMode
 
HTREEITEM hRootItemInstalled
 
CStringW szSearchPattern
 
AppsCategories SelectedEnumType
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 12 of file winproc.h.

Constructor & Destructor Documentation

◆ CMainWindow() [1/2]

CMainWindow::CMainWindow ( )
inline

Definition at line 31 of file winproc.h.

31: m_hMenu(NULL) { }
HMENU m_hMenu
Definition: winproc.h:39
#define NULL
Definition: types.h:112

◆ CMainWindow() [2/2]

CMainWindow::CMainWindow ( CAppDB db,
BOOL  bAppwiz = FALSE 
)
explicit

Definition at line 85 of file gui.cpp.

86{
87}
@ ENUM_ALL_INSTALLED
Definition: appinfo.h:44
AppsCategories SelectedEnumType
Definition: gui.h:64
BOOL bAppwizMode
Definition: gui.h:60
CAppDB * m_Db
Definition: gui.h:56
CUiPanel * m_ClientPanel
Definition: gui.h:48

◆ ~CMainWindow()

CMainWindow::~CMainWindow ( )

Definition at line 89 of file gui.cpp.

90{
92}
VOID LayoutCleanup()
Definition: gui.cpp:215

Member Function Documentation

◆ AddApplicationsToView()

VOID CMainWindow::AddApplicationsToView ( CAtlList< CAppInfo * > &  List)
private

Definition at line 582 of file gui.cpp.

583{
584 POSITION CurrentListPosition = List.GetHeadPosition();
585 while (CurrentListPosition)
586 {
587 CAppInfo *Info = List.GetNext(CurrentListPosition);
590 {
591 BOOL bSelected = m_Selected.Find(Info) != NULL;
593 }
594 }
595}
BOOL SearchPatternMatch(LPCWSTR szHaystack, LPCWSTR szNeedle)
Definition: misc.cpp:372
POSITION Find(INARGTYPE element, _In_opt_ POSITION posStartAfter=NULL) const
Definition: atlcoll.h:773
bool IsEmpty() const
Definition: atlsimpstr.h:379
BOOL AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState)
Definition: appview.cpp:1854
CStringW szSearchPattern
Definition: gui.h:63
CAtlList< CAppInfo * > m_Selected
Definition: gui.h:57
CApplicationView * m_ApplicationView
Definition: gui.h:54
unsigned int BOOL
Definition: ntddk_ex.h:94
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by UpdateApplicationsList().

◆ alignChildrenToMainWindow()

void CMainWindow::alignChildrenToMainWindow ( )
private

Definition at line 76 of file winproc.cpp.

77{
78 RECT clientRect, rc;
79 GetClientRect(&clientRect);
80 RECT rcSpace = clientRect;
81
83 {
85 rcSpace.bottom -= rc.bottom - rc.top;
86 }
87
88 HDWP hDWP = ::BeginDeferWindowPos(3);
89
91 {
93 {
95 rcSpace.right - CX_TOOLBAR, rcSpace.top,
96 CX_TOOLBAR, rcSpace.bottom - rcSpace.top,
98 rcSpace.right -= CX_TOOLBAR;
99 }
100 else
101 {
103 rcSpace.left, rcSpace.top,
104 CX_TOOLBAR, rcSpace.bottom - rcSpace.top,
106 rcSpace.left += CX_TOOLBAR;
107 }
108 }
109
111 {
113 {
114 hDWP = ::DeferWindowPos(hDWP, paletteWindow, NULL,
115 rcSpace.left, rcSpace.bottom - CY_PALETTE,
116 rcSpace.right - rcSpace.left, CY_PALETTE,
118 rcSpace.bottom -= CY_PALETTE;
119 }
120 else
121 {
122 hDWP = ::DeferWindowPos(hDWP, paletteWindow, NULL,
123 rcSpace.left, rcSpace.top,
124 rcSpace.right - rcSpace.left, CY_PALETTE,
126 rcSpace.top += CY_PALETTE;
127 }
128 }
129
130 if (canvasWindow.IsWindow())
131 {
132 hDWP = ::DeferWindowPos(hDWP, canvasWindow, NULL,
133 rcSpace.left, rcSpace.top,
134 rcSpace.right - rcSpace.left, rcSpace.bottom - rcSpace.top,
136 }
137
139}
#define CY_PALETTE
Definition: palette.h:13
#define BAR1ID_BOTTOM
Definition: registry.h:52
#define BAR2ID_RIGHT
Definition: registry.h:57
CCanvasWindow canvasWindow
Definition: canvas.cpp:11
BOOL IsWindowVisible() const
Definition: atlwin.h:952
RegistrySettings registrySettings
Definition: registry.cpp:15
CPaletteWindow paletteWindow
Definition: palette.cpp:20
CToolBox toolBoxContainer
Definition: toolbox.cpp:12
HWND hStatusBar
Definition: winproc.cpp:20
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define CX_TOOLBAR
Definition: toolbox.h:15
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define SWP_NOREPOSITION
Definition: winuser.h:1240
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1237
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by OnCommand(), and OnSize().

◆ ChooseColor()

BOOL CMainWindow::ChooseColor ( IN OUT COLORREF prgbColor)

Definition at line 144 of file main.cpp.

145{
146 static CHOOSECOLOR choosecolor = { 0 };
147 static COLORREF custColors[16] =
148 {
149 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
150 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
151 };
152
153 if (choosecolor.lStructSize == 0)
154 {
155 // Initializing the CHOOSECOLOR structure for ChooseColor
156 ZeroMemory(&choosecolor, sizeof(choosecolor));
157 choosecolor.lStructSize = sizeof(choosecolor);
158 choosecolor.hwndOwner = m_hWnd;
159 choosecolor.lpCustColors = custColors;
160 }
161
162 choosecolor.rgbResult = *prgbColor;
163 if (!::ChooseColor(&choosecolor))
164 return FALSE;
165
166 *prgbColor = choosecolor.rgbResult;
167 return TRUE;
168}
HWND m_hWnd
Definition: atlwin.h:267
#define ChooseColor
Definition: commdlg.h:661
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
COLORREF rgbResult
Definition: commdlg.h:242
HWND hwndOwner
Definition: commdlg.h:240
COLORREF * lpCustColors
Definition: commdlg.h:243
DWORD lStructSize
Definition: commdlg.h:239
#define ZeroMemory
Definition: winbase.h:1670
DWORD COLORREF
Definition: windef.h:300

Referenced by CPaletteWindow::OnLButtonDblClk(), and CPaletteWindow::OnRButtonDblClk().

◆ ConfirmSave()

BOOL CMainWindow::ConfirmSave ( )
private

Definition at line 339 of file winproc.cpp.

340{
342
344 return TRUE;
345
346 CString strProgramName;
347 strProgramName.LoadString(IDS_PROGRAMNAME);
348
349 CString strSavePromptText;
351
352 switch (MessageBox(strSavePromptText, strProgramName, MB_YESNOCANCEL | MB_ICONQUESTION))
353 {
354 case IDYES:
356 return imageModel.IsImageSaved();
357 case IDNO:
358 return TRUE;
359 case IDCANCEL:
360 return FALSE;
361 }
362
363 return TRUE;
364}
#define IDS_SAVEPROMPTTEXT
Definition: resource.h:185
#define IDS_PROGRAMNAME
Definition: resource.h:180
BOOL LoadString(_In_ UINT nID)
Definition: cstringt.h:591
void __cdecl Format(UINT nFormatID,...)
Definition: cstringt.h:770
VOID finishDrawing()
Definition: canvas.cpp:727
void saveImage(BOOL overwrite)
Definition: winproc.cpp:141
BOOL IsImageSaved() const
Definition: history.cpp:174
ImageModel imageModel
Definition: history.cpp:11
TCHAR filepathname[MAX_LONG_PATH]
Definition: main.cpp:16
#define PathFindFileName
Definition: shlwapi.h:911
#define IDCANCEL
Definition: winuser.h:825
#define IDNO
Definition: winuser.h:830
#define MB_ICONQUESTION
Definition: winuser.h:783
#define MessageBox
Definition: winuser.h:5812
#define IDYES
Definition: winuser.h:829
#define MB_YESNOCANCEL
Definition: winuser.h:812

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

◆ Create()

HWND CMainWindow::Create ( )

Definition at line 677 of file gui.cpp.

678{
679 CStringW szWindowName;
680 szWindowName.LoadStringW(IDS_APPTITLE);
681
682 RECT r = {
686 r.right += r.left;
687 r.bottom += r.top;
688
689 return CWindowImpl::Create(
691}
#define IDS_APPTITLE
Definition: resource.h:3
SETTINGS_INFO SettingsInfo
Definition: winmain.cpp:20
PCXSTR GetString() const
Definition: atlsimpstr.h:361
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1728
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
BOOL bSaveWndPos
Definition: settings.h:7
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by DoCreate(), and MainWindowLoop().

◆ CreateApplicationView()

BOOL CMainWindow::CreateApplicationView ( )
private

Definition at line 152 of file gui.cpp.

153{
154 m_ApplicationView = new CApplicationView(this); // pass this to ApplicationView for callback purpose
158
160}
HWND Create(HWND hwndParent)
Definition: appview.cpp:1806
CUiSplitPanel * m_VSplitter
Definition: gui.h:49
INT Append(T *ptr)
Definition: rosui.h:87
CUiAlignment m_HorizontalAlignment
Definition: rosui.h:257
CUiAlignment m_VerticalAlignment
Definition: rosui.h:258
CUiCollection & Second()
Definition: rosui.h:623
@ UiAlign_Stretch
Definition: rosui.h:249

Referenced by CreateLayout().

◆ CreateLayout()

BOOL CMainWindow::CreateLayout ( )
private

Definition at line 181 of file gui.cpp.

182{
183 BOOL b = TRUE;
184 bUpdating = TRUE;
185
186 m_ClientPanel = new CUiPanel();
189
190 // Top level
191 b = b && CreateStatusBar();
192 b = b && CreateVSplitter();
193
194 // Inside V Splitter
195 b = b && CreateTreeView();
197
198 if (b)
199 {
200 RECT rBottom;
201
202 /* Size status bar */
203 m_StatusBar->SendMessageW(WM_SIZE, 0, 0);
204
205 ::GetWindowRect(m_StatusBar->m_hWnd, &rBottom);
206
207 m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top;
208 }
209
211 return b;
212}
BOOL CreateTreeView()
Definition: gui.cpp:141
BOOL CreateVSplitter()
Definition: gui.cpp:163
BOOL bUpdating
Definition: gui.h:59
CUiWindow< CStatusBar > * m_StatusBar
Definition: gui.h:52
BOOL CreateStatusBar()
Definition: gui.cpp:130
BOOL CreateApplicationView()
Definition: gui.cpp:152
CUiMargin m_Margin
Definition: rosui.h:255
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
#define WM_SIZE
Definition: winuser.h:1601

Referenced by InitControls().

◆ CreateStatusBar()

BOOL CMainWindow::CreateStatusBar ( )
private

Definition at line 130 of file gui.cpp.

131{
136
138}
#define IDC_STATUSBAR
Definition: resource.h:12
HWND Create(HWND hwndParent, HMENU hMenu)
Definition: rosctrls.h:462
CUiCollection & Children()
Definition: rosui.h:384
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
@ UiAlign_RightBtm
Definition: rosui.h:248

Referenced by CreateLayout().

◆ CreateTreeView()

BOOL CMainWindow::CreateTreeView ( )
private

Definition at line 141 of file gui.cpp.

142{
147
148 return m_TreeView->Create(m_hWnd) != NULL;
149}
CSideTreeView * m_TreeView
Definition: gui.h:51
HWND Create(HWND hwndParent)
Definition: rosctrls.h:483
CUiCollection & First()
Definition: rosui.h:618

Referenced by CreateLayout().

◆ CreateVSplitter()

BOOL CMainWindow::CreateVSplitter ( )
private

Definition at line 163 of file gui.cpp.

164{
171
172 // TODO: m_MinSecond should be calculate dynamically instead of hard-coded
174 m_VSplitter->m_Pos = 240;
176
177 return m_VSplitter->Create(m_hWnd) != NULL;
178}
INT m_Pos
Definition: rosui.h:584
BOOL m_Horizontal
Definition: rosui.h:585
BOOL m_DynamicFirst
Definition: rosui.h:586
INT m_MinSecond
Definition: rosui.h:588
HWND Create(HWND hwndParent)
Definition: rosui.h:867
INT m_MinFirst
Definition: rosui.h:587

Referenced by CreateLayout().

◆ DoCreate()

HWND CMainWindow::DoCreate ( )

Definition at line 170 of file main.cpp.

171{
173
174 CString strTitle;
176
179}
#define IDS_DEFAULTFILENAME
Definition: resource.h:186
#define IDS_WINDOWTITLE
Definition: resource.h:181
HWND Create()
Definition: gui.cpp:677
WINDOWPLACEMENT WindowPlacement
Definition: registry.h:30
HINSTANCE hProgInstance
Definition: main.cpp:15
#define WS_EX_ACCEPTFILES
Definition: pedump.c:648
#define _countof(array)
Definition: sndvol32.h:68
RECT rcNormalPosition
Definition: winuser.h:3285
#define HWND_DESKTOP
Definition: winuser.h:1199
#define LoadString
Definition: winuser.h:5809

Referenced by _tWinMain().

◆ GetOpenFileName()

BOOL CMainWindow::GetOpenFileName ( IN OUT LPTSTR  pszFile,
INT  cchMaxFile 
)

Definition at line 75 of file main.cpp.

76{
77 static OPENFILENAME ofn = { 0 };
78 static CString strFilter;
79
80 if (ofn.lStructSize == 0)
81 {
82 // The "All Files" item text
83 CString strAllPictureFiles;
84 strAllPictureFiles.LoadString(hProgInstance, IDS_ALLPICTUREFILES);
85
86 // Get the import filter
87 CSimpleArray<GUID> aguidFileTypesI;
88 CImage::GetImporterFilterString(strFilter, aguidFileTypesI, strAllPictureFiles,
90
91 // Initializing the OPENFILENAME structure for GetOpenFileName
92 ZeroMemory(&ofn, sizeof(ofn));
93 ofn.lStructSize = sizeof(ofn);
96 ofn.lpstrFilter = strFilter;
98 ofn.lpstrDefExt = L"png";
99 }
100
101 ofn.lpstrFile = pszFile;
102 ofn.nMaxFile = cchMaxFile;
103 return ::GetOpenFileName(&ofn);
104}
#define IDS_ALLPICTUREFILES
Definition: resource.h:207
static HRESULT GetImporterFilterString(CSimpleString &strImporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultLoad, TCHAR chSeparator=TEXT('|'))
Definition: atlimage.h:788
@ excludeDefaultLoad
Definition: atlimage.h:713
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define L(x)
Definition: ntvdm.h:50
OPENFILENAME ofn
Definition: sndrec32.cpp:56
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND hwndOwner
Definition: commdlg.h:330
HINSTANCE hInstance
Definition: commdlg.h:331
LPSTR lpstrFile
Definition: commdlg.h:336
DWORD Flags
Definition: commdlg.h:342
DWORD lStructSize
Definition: commdlg.h:329
LPCSTR lpstrFilter
Definition: commdlg.h:332
DWORD nMaxFile
Definition: commdlg.h:337
#define _T(x)
Definition: vfdio.h:22

◆ GetSaveFileName()

BOOL CMainWindow::GetSaveFileName ( IN OUT LPTSTR  pszFile,
INT  cchMaxFile 
)

Definition at line 106 of file main.cpp.

107{
108 static OPENFILENAME sfn = { 0 };
109 static CString strFilter;
110
111 if (sfn.lStructSize == 0)
112 {
113 // Get the export filter
114 CSimpleArray<GUID> aguidFileTypesE;
115 CImage::GetExporterFilterString(strFilter, aguidFileTypesE, NULL,
117
118 // Initializing the OPENFILENAME structure for GetSaveFileName
119 ZeroMemory(&sfn, sizeof(sfn));
120 sfn.lStructSize = sizeof(sfn);
123 sfn.lpstrFilter = strFilter;
126 sfn.lpstrDefExt = L"png";
127
128 // Choose PNG
129 for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i)
130 {
131 if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG)
132 {
133 sfn.nFilterIndex = i + 1;
134 break;
135 }
136 }
137 }
138
139 sfn.lpstrFile = pszFile;
140 sfn.nMaxFile = cchMaxFile;
141 return ::GetSaveFileName(&sfn);
142}
static UINT_PTR APIENTRY OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: main.cpp:53
static HRESULT GetExporterFilterString(CSimpleString &strExporters, CSimpleArray< GUID > &aguidFileTypes, LPCTSTR pszAllFilesDescription=NULL, DWORD dwExclude=excludeDefaultSave, TCHAR chSeparator=TEXT('|'))
Definition: atlimage.h:802
@ excludeDefaultSave
Definition: atlimage.h:714
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define OFN_ENABLEHOOK
Definition: commdlg.h:99
OPENFILENAMEW sfn
Definition: eventvwr.c:101
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
HINSTANCE hInstance
Definition: commdlg.h:362
HWND hwndOwner
Definition: commdlg.h:361
DWORD Flags
Definition: commdlg.h:373
LPWSTR lpstrFile
Definition: commdlg.h:367
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:378
LPCWSTR lpstrDefExt
Definition: commdlg.h:376
DWORD lStructSize
Definition: commdlg.h:360
DWORD nMaxFile
Definition: commdlg.h:368
LPCWSTR lpstrFilter
Definition: commdlg.h:363
DWORD nFilterIndex
Definition: commdlg.h:366
int32_t INT
Definition: typedefs.h:58

◆ GetWndClassInfo()

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

Definition at line 660 of file gui.cpp.

661{
662 DWORD csStyle = CS_VREDRAW | CS_HREDRAW;
663 static ATL::CWndClassInfo wc = {
664 {sizeof(WNDCLASSEX), csStyle, StartWindowProc, 0, 0, NULL,
665 LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)), LoadCursorW(NULL, IDC_ARROW),
667 NULL,
668 NULL,
669 IDC_ARROW,
670 TRUE,
671 0,
672 _T("")};
673 return wc;
674}
#define IDI_MAIN
Definition: resource.h:4
#define IDR_MAINMENU
Definition: resource.h:40
static LRESULT CALLBACK StartWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1613
unsigned long DWORD
Definition: ntddk_ex.h:95
const TCHAR szWindowClass[]
Definition: magnifier.c:28
#define CS_VREDRAW
Definition: winuser.h:653
#define CS_HREDRAW
Definition: winuser.h:648
#define IDC_ARROW
Definition: winuser.h:682
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5709
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
#define COLOR_BTNFACE
Definition: winuser.h:922

◆ HandleTabOrder()

void CMainWindow::HandleTabOrder ( int  direction)

Definition at line 756 of file gui.cpp.

757{
758 ATL::CSimpleArray<HWND> TabOrderHwndList;
759
760 m_TreeView->AppendTabOrderWindow(direction, TabOrderHwndList);
761 m_ApplicationView->AppendTabOrderWindow(direction, TabOrderHwndList);
762
763 if (TabOrderHwndList.GetSize() == 0)
764 {
765 // in case the list is empty
766 return;
767 }
768
769 int FocusIndex;
770
771 if ((FocusIndex = TabOrderHwndList.Find(GetFocus())) == -1)
772 {
773 FocusIndex = 0; // focus the first window in the list
774 }
775 else
776 {
777 FocusIndex += direction;
778 FocusIndex +=
779 TabOrderHwndList.GetSize(); // FocusIndex might be negative. we don't want to mod a negative number
780 FocusIndex %= TabOrderHwndList.GetSize();
781 }
782
783 ::SetFocus(TabOrderHwndList[FocusIndex]);
784 return;
785}
int GetSize() const
Definition: atlsimpcoll.h:104
int Find(const T &t) const
Definition: atlsimpcoll.h:82
HWND SetFocus()
Definition: atlwin.h:1192
VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: appview.cpp:1884
virtual VOID AppendTabOrderWindow(int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
Definition: rosui.h:546
HWND WINAPI GetFocus(void)
Definition: window.c:1894

Referenced by MainWindowLoop().

◆ InitCategoriesList()

VOID CMainWindow::InitCategoriesList ( )
private

Definition at line 95 of file gui.cpp.

96{
97 HTREEITEM hRootItemAvailable;
98
102
104
106 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_AUDIO, IDI_CAT_AUDIO);
107 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_VIDEO, IDI_CAT_VIDEO);
109 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_GAMES, IDI_CAT_GAMES);
112 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_DEVEL, IDI_CAT_DEVEL);
113 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_EDU, IDI_CAT_EDU);
117 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_TOOLS, IDI_CAT_TOOLS);
119 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_LIBS, IDI_CAT_LIBS);
121 m_TreeView->AddCategory(hRootItemAvailable, IDS_CAT_OTHER, IDI_CAT_OTHER);
122
125 m_TreeView->Expand(hRootItemAvailable, TVE_EXPAND);
126 m_TreeView->SelectItem(bAppwizMode ? hRootItemInstalled : hRootItemAvailable);
127}
#define IDS_UPDATES
Definition: resource.h:103
#define IDS_CAT_TOOLS
Definition: resource.h:192
#define IDI_CAT_FINANCE
Definition: resource.h:25
#define IDS_CAT_VIDEO
Definition: resource.h:193
#define IDS_SELECTEDFORINST
Definition: resource.h:121
#define IDS_CAT_GRAPHICS
Definition: resource.h:186
#define IDI_SELECTEDFORINST
Definition: resource.h:16
#define IDI_CAT_EDU
Definition: resource.h:23
#define IDS_AVAILABLEFORINST
Definition: resource.h:102
#define IDI_CAT_INTERNET
Definition: resource.h:28
#define IDI_CAT_LIBS
Definition: resource.h:29
#define IDS_CAT_AUDIO
Definition: resource.h:179
#define IDS_CAT_SCIENCE
Definition: resource.h:191
#define IDS_CAT_ENGINEER
Definition: resource.h:183
#define IDI_CATEGORY
Definition: resource.h:13
#define IDI_CAT_OFFICE
Definition: resource.h:30
#define IDS_CAT_LIBS
Definition: resource.h:188
#define IDS_CAT_OTHER
Definition: resource.h:190
#define IDI_CAT_GRAPHICS
Definition: resource.h:27
#define IDS_CAT_DEVEL
Definition: resource.h:180
#define IDI_APPS
Definition: resource.h:11
#define IDS_CAT_THEMES
Definition: resource.h:194
#define IDI_CAT_SCIENCE
Definition: resource.h:32
#define IDI_CAT_OTHER
Definition: resource.h:31
#define IDS_CAT_GAMES
Definition: resource.h:185
#define IDS_CAT_EDU
Definition: resource.h:182
#define IDS_CAT_INTERNET
Definition: resource.h:187
#define IDI_APPUPD
Definition: resource.h:12
#define IDI_CAT_VIDEO
Definition: resource.h:34
#define IDS_CAT_DRIVERS
Definition: resource.h:181
#define IDI_CAT_DRIVERS
Definition: resource.h:22
#define IDI_CAT_DEVEL
Definition: resource.h:21
#define IDS_CAT_OFFICE
Definition: resource.h:189
#define IDS_CAT_FINANCE
Definition: resource.h:184
#define IDI_CAT_THEMES
Definition: resource.h:35
#define IDI_CAT_GAMES
Definition: resource.h:26
#define IDS_APPLICATIONS
Definition: resource.h:104
#define IDI_CAT_ENGINEER
Definition: resource.h:24
#define IDS_INSTALLED
Definition: resource.h:101
#define IDI_CAT_TOOLS
Definition: resource.h:33
#define IDI_CAT_AUDIO
Definition: resource.h:20
HTREEITEM hRootItemInstalled
Definition: gui.h:61
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex)
Definition: gui.cpp:46
HIMAGELIST SetImageList()
Definition: gui.cpp:65
BOOL Expand(HTREEITEM item, DWORD action)
Definition: rosctrls.h:599
BOOL SelectItem(HTREEITEM item, DWORD action=TVGN_CARET)
Definition: rosctrls.h:604
#define TVE_EXPAND
Definition: commctrl.h:3423
#define TVI_ROOT
Definition: commctrl.h:3368

Referenced by InitControls().

◆ InitControls()

BOOL CMainWindow::InitControls ( )
private

Definition at line 225 of file gui.cpp.

226{
227 if (CreateLayout())
228 {
231
232 return TRUE;
233 }
234
235 return FALSE;
236}
VOID UpdateStatusBarText()
Definition: gui.cpp:570
BOOL CreateLayout()
Definition: gui.cpp:181
VOID InitCategoriesList()
Definition: gui.cpp:95

Referenced by ProcessWindowMessage().

◆ InsertSelectionFromHBITMAP()

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

Definition at line 160 of file winproc.cpp.

161{
162 int width = GetDIBWidth(bitmap);
164 int curWidth = imageModel.GetWidth();
165 int curHeight = imageModel.GetHeight();
166
167 if (width > curWidth || height > curHeight)
168 {
169 BOOL shouldEnlarge = TRUE;
170
172 {
173 TCHAR programname[20];
174 TCHAR shouldEnlargePromptText[100];
175
176 LoadString(hProgInstance, IDS_PROGRAMNAME, programname, _countof(programname));
177 LoadString(hProgInstance, IDS_ENLARGEPROMPTTEXT, shouldEnlargePromptText, _countof(shouldEnlargePromptText));
178
179 switch (MessageBox(shouldEnlargePromptText, programname, MB_YESNOCANCEL | MB_ICONQUESTION))
180 {
181 case IDYES:
182 break;
183 case IDNO:
184 shouldEnlarge = FALSE;
185 break;
186 case IDCANCEL:
187 return;
188 }
189 }
190
191 if (shouldEnlarge)
192 {
193 if (width > curWidth)
194 curWidth = width;
195
196 if (height > curHeight)
197 curHeight = height;
198
199 imageModel.Crop(curWidth, curHeight, 0, 0);
200 }
201 }
202
206
210 canvasWindow.Invalidate(FALSE);
211}
#define ID_RECTSEL
Definition: resource.h:107
#define IDS_ENLARGEPROMPTTEXT
Definition: resource.h:215
int GetWidth() const
Definition: history.cpp:215
void CopyPrevious(void)
Definition: history.cpp:47
void Crop(int nWidth, int nHeight, int nOffsetX=0, int nOffsetY=0)
Definition: history.cpp:131
int GetHeight() const
Definition: history.cpp:220
void InsertFromHBITMAP(HBITMAP hBm, INT x=0, INT y=0)
int GetDIBHeight(HBITMAP hBitmap)
Definition: dib.cpp:72
int GetDIBWidth(HBITMAP hBitmap)
Definition: dib.cpp:64
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
SelectionModel selectionModel
BOOL askBeforeEnlarging
Definition: main.cpp:14
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
Definition: uimain.c:89
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define WM_COMMAND
Definition: winuser.h:1730
#define FindWindowEx
Definition: winuser.h:5768
#define SendMessage
Definition: winuser.h:5833
char TCHAR
Definition: xmlstorage.h:189

Referenced by OnCommand().

◆ InstallApplication()

BOOL CMainWindow::InstallApplication ( CAppInfo Info)

Definition at line 724 of file gui.cpp.

725{
726 if (Info)
727 {
729 {
731 return TRUE;
732 }
733 }
734
735 return FALSE;
736}
VOID UpdateApplicationsList(AppsCategories EnumType, BOOL bReload=FALSE)
Definition: gui.cpp:598
BOOL DownloadApplication(CAppInfo *pAppInfo)
Definition: loaddlg.cpp:1079

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

◆ ItemCheckStateChanged()

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

Definition at line 696 of file gui.cpp.

697{
698 if (bUpdating)
699 return;
700
701 CAppInfo *Info = (CAppInfo *)CallbackParam;
702
703 if (bChecked)
704 {
706 }
707 else
708 {
710 ATLASSERT(Pos != NULL);
711
712 if (Pos != NULL)
713 {
715 }
716 }
717
719}
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
POSITION AddTail(INARGTYPE element)
Definition: atlcoll.h:626
void RemoveAt(_In_ POSITION pos)
Definition: atlcoll.h:748
ush Pos
Definition: deflate.h:92

Referenced by CApplicationView::ItemCheckStateChanged().

◆ LayoutCleanup()

VOID CMainWindow::LayoutCleanup ( )
private

Definition at line 215 of file gui.cpp.

216{
217 delete m_TreeView;
218 delete m_ApplicationView;
219 delete m_VSplitter;
220 delete m_StatusBar;
221 return;
222}

Referenced by ~CMainWindow().

◆ OnClose()

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

Definition at line 366 of file winproc.cpp.

367{
368 if (ConfirmSave())
369 {
371 }
372 return 0;
373}
BOOL DestroyWindow()
Definition: atlwin.h:456
BOOL ConfirmSave()
Definition: winproc.cpp:339

◆ OnCommand() [1/2]

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

Definition at line 519 of file winproc.cpp.

520{
521 // Disable commands while dragging mouse
523 {
524 ATLTRACE("locking!\n");
525 return 0;
526 }
527
528 switch (LOWORD(wParam))
529 {
530 case IDM_HELPINFO:
531 {
533 TCHAR infotitle[100];
534 TCHAR infotext[200];
535 LoadString(hProgInstance, IDS_INFOTITLE, infotitle, _countof(infotitle));
536 LoadString(hProgInstance, IDS_INFOTEXT, infotext, _countof(infotext));
537 ShellAbout(m_hWnd, infotitle, infotext, paintIcon);
538 DeleteObject(paintIcon);
539 break;
540 }
542 DoHtmlHelpW(m_hWnd, L"%SystemRoot%\\Help\\mspaint.chm", HH_DISPLAY_TOPIC, 0);
543 break;
544 case IDM_FILEEXIT:
546 break;
547 case IDM_FILENEW:
548 if (ConfirmSave())
549 {
551 }
552 break;
553 case IDM_FILEOPEN:
554 {
555 TCHAR szFileName[MAX_LONG_PATH] = _T("");
556 if (ConfirmSave() && GetOpenFileName(szFileName, _countof(szFileName)))
557 {
558 DoLoadImageFile(m_hWnd, szFileName, TRUE);
559 }
560 break;
561 }
562 case IDM_FILESAVE:
564 break;
565 case IDM_FILESAVEAS:
567 break;
569 // DUMMY: Shows the dialog only, no functionality
570 PAGESETUPDLG psd;
571 ZeroMemory(&psd, sizeof(psd));
572 psd.lStructSize = sizeof(psd);
573 psd.hwndOwner = m_hWnd;
574 PageSetupDlg(&psd);
575 break;
576 case IDM_FILEPRINT:
577 // TODO: Test whether it actually works
578 PRINTDLG pd;
579 ZeroMemory(&pd, sizeof(pd));
580 pd.lStructSize = sizeof(pd);
581 pd.hwndOwner = m_hWnd;
582 pd.hDevMode = NULL; // freed by user
583 pd.hDevNames = NULL; // freed by user
585 pd.nCopies = 1;
586 pd.nFromPage = 0xffff;
587 pd.nToPage = 0xffff;
588 pd.nMinPage = 1;
589 pd.nMaxPage = 0xffff;
590 if (PrintDlg(&pd) == TRUE)
591 {
593 DeleteDC(pd.hDC);
594 }
595 if (pd.hDevMode)
597 if (pd.hDevNames)
599 break;
602 break;
605 break;
608 break;
609 case IDM_FILE1:
610 case IDM_FILE2:
611 case IDM_FILE3:
612 case IDM_FILE4:
613 {
615 if (ConfirmSave())
617 break;
618 }
619 case IDM_EDITUNDO:
621 break;
623 {
626 {
628 break;
629 }
630 }
631 if (ToolBase::pointSP != 0) // drawing something?
632 {
634 break;
635 }
637 canvasWindow.Invalidate(FALSE);
638 break;
639 case IDM_EDITREDO:
641 break;
642 if (ToolBase::pointSP != 0) // drawing something?
643 {
645 break;
646 }
648 canvasWindow.Invalidate(FALSE);
649 break;
650 case IDM_EDITCOPY:
651 if (OpenClipboard())
652 {
656 }
657 break;
658 case IDM_EDITCUT:
659 /* Copy */
661 /* Delete selection */
663 break;
664 case IDM_EDITPASTE:
667 {
669 }
671 break;
673 {
674 switch (toolsModel.GetActiveTool())
675 {
676 case TOOL_FREESEL:
677 case TOOL_RECTSEL:
679 break;
680
681 case TOOL_TEXT:
683 break;
684 default:
685 break;
686 }
687 break;
688 }
690 {
692 {
693 textEditWindow.SendMessage(EM_SETSEL, 0, -1);
694 break;
695 }
699 canvasWindow.Invalidate(TRUE);
700 break;
701 }
702 case IDM_EDITCOPYTO:
703 {
704 TCHAR szFileName[MAX_LONG_PATH] = _T("");
705 if (GetSaveFileName(szFileName, _countof(szFileName)))
707 break;
708 }
710 {
711 TCHAR szFileName[MAX_LONG_PATH] = _T("");
712 if (GetOpenFileName(szFileName, _countof(szFileName)))
713 {
714 HBITMAP hbmNew = DoLoadImageFile(m_hWnd, szFileName, FALSE);
715 if (hbmNew)
716 {
718 DeleteObject(hbmNew);
719 }
720 }
721 break;
722 }
724 {
725 COLORREF rgbColor = paletteModel.GetFgColor();
726 if (ChooseColor(&rgbColor))
727 paletteModel.SetFgColor(rgbColor);
728 break;
729 }
732 break;
735 break;
737 {
739 break;
740 }
744 canvasWindow.Invalidate(FALSE);
745 break;
747 switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
748 {
749 case 1: /* flip horizontally */
752 else
754 break;
755 case 2: /* flip vertically */
758 else
760 break;
761 case 3: /* rotate 90 degrees */
764 else
766 break;
767 case 4: /* rotate 180 degrees */
770 else
772 break;
773 case 5: /* rotate 270 degrees */
776 else
778 break;
779 }
780 break;
782 {
784 {
786 }
787 break;
788 }
790 {
792 {
794 {
797 }
798 else
799 {
802 }
803 }
804 break;
805 }
808 break;
809 case IDM_IMAGECROP:
811 break;
812
813 case IDM_VIEWTOOLBOX:
814 registrySettings.ShowToolBox = !toolBoxContainer.IsWindowVisible();
817 break;
819 registrySettings.ShowPalette = !paletteWindow.IsWindowVisible();
822 break;
827 break;
830 {
831 if (!fontsDialog.IsWindow())
832 {
833 fontsDialog.Create(mainWindow);
834 }
837 fontsDialog.SendMessage(DM_REPOSITION, 0, 0);
838 }
839 break;
840 case IDM_VIEWSHOWGRID:
842 canvasWindow.Invalidate(FALSE);
843 break;
848 break;
849
850 case IDM_VIEWZOOM125:
851 zoomTo(125, 0, 0);
852 break;
853 case IDM_VIEWZOOM25:
854 zoomTo(250, 0, 0);
855 break;
856 case IDM_VIEWZOOM50:
857 zoomTo(500, 0, 0);
858 break;
859 case IDM_VIEWZOOM100:
860 zoomTo(1000, 0, 0);
861 break;
862 case IDM_VIEWZOOM200:
863 zoomTo(2000, 0, 0);
864 break;
865 case IDM_VIEWZOOM400:
866 zoomTo(4000, 0, 0);
867 break;
868 case IDM_VIEWZOOM800:
869 zoomTo(8000, 0, 0);
870 break;
871
873 // Create and show the fullscreen window
877 break;
878 }
879 return 0;
880}
#define ATLTRACE(format,...)
Definition: atltrace.h:276
#define IDI_APPICON
Definition: resource.h:166
BOOL zoomTo(int newZoom, int mouseX, int mouseY)
Definition: winproc.cpp:46
#define MAX_LONG_PATH
Definition: common.h:17
CAttributesDialog attributesDialog
Definition: dialogs.cpp:20
CFontsDialog fontsDialog
Definition: dialogs.cpp:22
CStretchSkewDialog stretchSkewDialog
Definition: dialogs.cpp:21
CMirrorRotateDialog mirrorRotateDialog
Definition: dialogs.cpp:19
static HBITMAP CopyDIBImage(HBITMAP hbm, INT cx=0, INT cy=0)
Definition: dib.h:14
#define IDM_EDITSELECTALL
Definition: resource.h:66
#define IDM_VIEWSTATUSBAR
Definition: resource.h:72
#define IDS_INFOTEXT
Definition: resource.h:183
#define IDS_INFOTITLE
Definition: resource.h:182
#define IDM_EDITCOPYTO
Definition: resource.h:67
#define IDM_EDITDELETESELECTION
Definition: resource.h:64
#define IDM_FILEEXIT
Definition: resource.h:57
#define IDM_COLORSOLDPALETTE
Definition: resource.h:95
#define IDM_FILEPAGESETUP
Definition: resource.h:42
#define IDM_COLORSEDITPALETTE
Definition: resource.h:93
#define IDM_EDITCUT
Definition: resource.h:61
#define IDM_IMAGECROP
Definition: resource.h:87
#define IDM_VIEWZOOM800
Definition: resource.h:80
#define IDM_COLORSMODERNPALETTE
Definition: resource.h:94
#define IDM_FILE1
Definition: resource.h:52
#define IDM_FILESAVE
Definition: resource.h:36
#define IDM_EDITPASTEFROM
Definition: resource.h:68
#define IDM_EDITUNDO
Definition: resource.h:59
#define IDM_FILESAVEAS
Definition: resource.h:37
#define IDM_VIEWSHOWMINIATURE
Definition: resource.h:83
#define IDM_FILEASWALLPAPERPLANE
Definition: resource.h:47
#define IDM_EDITCOPY
Definition: resource.h:62
#define IDM_FORMATICONBAR
Definition: resource.h:73
#define IDM_FILE2
Definition: resource.h:53
#define IDM_FILE4
Definition: resource.h:55
#define IDM_EDITREDO
Definition: resource.h:60
#define IDM_VIEWZOOM25
Definition: resource.h:75
#define IDM_IMAGEINVERTCOLORS
Definition: resource.h:88
#define IDM_VIEWTOOLBOX
Definition: resource.h:70
#define IDM_IMAGEATTRIBUTES
Definition: resource.h:89
#define IDM_HELPINFO
Definition: resource.h:98
#define IDM_VIEWFULLSCREEN
Definition: resource.h:81
#define IDM_IMAGESTRETCHSKEW
Definition: resource.h:86
#define IDM_EDITPASTE
Definition: resource.h:63
#define IDM_FILEASWALLPAPERCENTERED
Definition: resource.h:48
#define IDM_HELPHELPTOPICS
Definition: resource.h:97
#define IDM_VIEWSHOWGRID
Definition: resource.h:82
#define IDM_IMAGEDRAWOPAQUE
Definition: resource.h:91
#define IDM_VIEWZOOM200
Definition: resource.h:78
#define IDM_FILE3
Definition: resource.h:54
#define IDM_FILENEW
Definition: resource.h:34
#define IDM_VIEWCOLORPALETTE
Definition: resource.h:71
#define IDM_VIEWZOOM400
Definition: resource.h:79
#define IDM_VIEWZOOM50
Definition: resource.h:76
#define IDM_FILEPRINT
Definition: resource.h:43
#define IDM_IMAGEDELETEIMAGE
Definition: resource.h:90
#define IDM_VIEWZOOM125
Definition: resource.h:74
#define IDM_VIEWZOOM100
Definition: resource.h:77
#define IDM_IMAGEROTATEMIRROR
Definition: resource.h:85
#define IDM_FILEOPEN
Definition: resource.h:35
#define IDM_FILEASWALLPAPERSTRETCHED
Definition: resource.h:49
#define CF_BITMAP
Definition: constants.h:397
BOOL OpenClipboard()
Definition: atlwin.h:1032
BOOL m_drawing
Definition: canvas.h:39
VOID cancelDrawing()
Definition: canvas.cpp:717
void InsertSelectionFromHBITMAP(HBITMAP bitmap, HWND window)
Definition: winproc.cpp:160
void alignChildrenToMainWindow()
Definition: winproc.cpp:76
HWND DoCreate(HWND hwndParent)
Definition: miniature.cpp:16
POINT percentage
Definition: dialogs.h:86
void FlipVertically()
Definition: history.cpp:252
void FlipHorizontally()
Definition: history.cpp:244
void DeleteSelection()
Definition: history.cpp:285
void Insert(HBITMAP hbm)
Definition: history.cpp:115
void InvertColors()
Definition: history.cpp:225
void Redo(void)
Definition: history.cpp:81
void Undo(BOOL bClearRedo=FALSE)
Definition: history.cpp:60
void RotateNTimes90Degrees(int iN)
Definition: history.cpp:260
HDC GetDC()
Definition: history.cpp:239
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX=0, int nSkewDegY=0)
Definition: history.cpp:189
COLORREF GetBgColor() const
void SetFgColor(COLORREF newColor)
void SelectPalette(PAL_TYPE nPalette)
COLORREF GetFgColor() const
DWORD ShowTextTool
Definition: registry.h:42
DWORD ShowToolBox
Definition: registry.h:45
DWORD ShowPalette
Definition: registry.h:44
static void SetWallpaper(LPCTSTR szFileName, WallpaperStyle style)
Definition: registry.cpp:40
DWORD ShowThumbnail
Definition: registry.h:23
DWORD ShowStatusBar
Definition: registry.h:43
CString strFiles[MAX_RECENT_FILES]
Definition: registry.h:32
void RotateNTimes90Degrees(int iN)
void StretchSkew(int nStretchPercentX, int nStretchPercentY, int nSkewDegX, int nSkewDegY)
BOOL IsBackgroundTransparent() const
Definition: toolsmodel.cpp:135
void SetBackgroundTransparent(BOOL bTransparent)
Definition: toolsmodel.cpp:140
TOOLTYPE GetActiveTool() const
Definition: toolsmodel.cpp:76
void selectAll()
Definition: toolsmodel.cpp:234
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define GetSaveFileName
Definition: commdlg.h:666
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define PrintDlg
Definition: commdlg.h:668
#define PD_RETURNDC
Definition: commdlg.h:155
#define PageSetupDlg
Definition: commdlg.h:667
#define GetOpenFileName
Definition: commdlg.h:665
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCTSTR name, DWORD dwFileSize, BOOL isFile)
Definition: dib.cpp:119
BOOL SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
Definition: dib.cpp:79
HBITMAP DoLoadImageFile(HWND hwnd, LPCTSTR name, BOOL fIsMainFile)
Definition: dib.cpp:165
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
CFullscreenWindow fullscreenWindow
Definition: fullscreen.cpp:11
pKey DeleteObject()
ToolsModel toolsModel
Definition: toolsmodel.cpp:11
CMiniatureWindow miniature
Definition: miniature.cpp:12
BOOL showGrid
Definition: main.cpp:19
CMainWindow mainWindow
Definition: main.cpp:21
CTextEditWindow textEditWindow
Definition: textedit.cpp:13
PaletteModel paletteModel
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define HH_DISPLAY_TOPIC
Definition: htmlhelp.h:22
static HBITMAP
Definition: button.c:44
static HICON
Definition: imagelist.c:84
@ PAL_MODERN
Definition: palettemodel.h:15
@ PAL_OLDTYPE
Definition: palettemodel.h:16
#define LOWORD(l)
Definition: pedump.c:82
#define ShellAbout
Definition: shellapi.h:689
static INT pointSP
Definition: toolsmodel.h:39
WORD nMaxPage
Definition: commdlg.h:474
HDC hDC
Definition: commdlg.h:469
DWORD Flags
Definition: commdlg.h:470
WORD nCopies
Definition: commdlg.h:475
WORD nFromPage
Definition: commdlg.h:471
HGLOBAL hDevMode
Definition: commdlg.h:467
WORD nToPage
Definition: commdlg.h:472
WORD nMinPage
Definition: commdlg.h:473
HGLOBAL hDevNames
Definition: commdlg.h:468
HWND hwndOwner
Definition: commdlg.h:466
DWORD lStructSize
Definition: commdlg.h:465
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
DWORD lStructSize
Definition: commdlg.h:433
HWND hwndOwner
Definition: commdlg.h:434
@ TOOL_TEXT
Definition: toolsmodel.h:22
@ TOOL_FREESEL
Definition: toolsmodel.h:13
@ TOOL_RECTSEL
Definition: toolsmodel.h:14
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI DeleteDC(_In_ HDC)
static HWND DoHtmlHelpW(HWND hwndCaller, LPCWSTR pszFile, UINT uCommand, DWORD_PTR dwData)
Definition: winproc.cpp:25
#define SW_SHOWMAXIMIZED
Definition: winuser.h:767
#define SW_HIDE
Definition: winuser.h:762
#define WM_CLOSE
Definition: winuser.h:1611
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
HWND WINAPI GetCapture(void)
Definition: message.c:2881
HANDLE WINAPI GetClipboardData(_In_ UINT)
#define LoadIcon
Definition: winuser.h:5803
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
#define EM_SETSEL
Definition: winuser.h:2008
#define SW_SHOW
Definition: winuser.h:769
#define DM_REPOSITION
Definition: winuser.h:2090
#define MAKEINTRESOURCE
Definition: winuser.h:591
BOOL WINAPI IsClipboardFormatAvailable(_In_ UINT)

Referenced by ProcessWindowMessage().

◆ OnCommand() [2/2]

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

Definition at line 482 of file gui.cpp.

483{
484 const BOOL bReload = TRUE;
485 WORD wCommand = LOWORD(wParam);
486
487 if (!lParam)
488 {
489 switch (wCommand)
490 {
491 case ID_SETTINGS:
493 break;
494
495 case ID_EXIT:
496 PostMessageW(WM_CLOSE, 0, 0);
497 break;
498
499 case ID_SEARCH:
501 break;
502
503 case ID_INSTALL:
505 {
506 if (!m_Selected.IsEmpty())
507 {
509 {
512 }
513 }
514 else
515 {
517 if (App)
518 {
520 }
521 }
522 }
523 break;
524
525 case ID_UNINSTALL:
528 break;
529
530 case ID_MODIFY:
533 break;
534
535 case ID_REGREMOVE:
538 break;
539
540 case ID_REFRESH:
542 break;
543
544 case ID_RESETDB:
547 break;
548
549 case ID_HELP:
550 MessageBoxW(L"Help not implemented yet", NULL, MB_OK);
551 break;
552
553 case ID_ABOUT:
554 ShowAboutDlg();
555 break;
556
557 case ID_CHECK_ALL:
559 break;
560
564 break;
565 }
566 }
567}
BOOL IsAvailableEnum(INT x)
Definition: appinfo.h:55
#define ID_EXIT
Definition: resource.h:10
#define ID_HELP
Definition: resource.h:26
#define ID_REFRESH
Definition: resource.h:16
#define ID_REGREMOVE
Definition: resource.h:83
#define ID_UNINSTALL
Definition: resource.h:75
#define ID_SEARCH
Definition: resource.h:86
#define ID_CHECK_ALL
Definition: resource.h:85
#define ID_ACTIVATE_APPWIZ
Definition: resource.h:89
#define ID_MODIFY
Definition: resource.h:78
#define ID_RESETDB
Definition: resource.h:84
#define ID_INSTALL
Definition: resource.h:74
#define ID_SETTINGS
Definition: resource.h:81
#define ID_ABOUT
Definition: charmap.c:17
bool IsEmpty() const
Definition: atlcoll.h:545
void RemoveAll()
Definition: atlcoll.h:727
VOID RemoveCached()
Definition: appdb.cpp:242
PVOID GetFocusedItemData()
Definition: appview.cpp:1872
void SetFocusOnSearchBar()
Definition: appview.cpp:1610
BOOL RemoveSelectedAppFromRegistry()
Definition: gui.cpp:263
BOOL InstallApplication(CAppInfo *Info)
Definition: gui.cpp:724
VOID ShowAboutDlg()
Definition: gui.cpp:468
BOOL UninstallSelectedApp(BOOL bModify)
Definition: gui.cpp:286
unsigned short WORD
Definition: ntddk_ex.h:93
VOID CreateSettingsDlg(HWND hwnd)
BOOL DownloadListOfApplications(const CAtlList< CAppInfo * > &AppsList, BOOL bIsModal)
Definition: loaddlg.cpp:1060
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:784

◆ OnCreate()

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

Definition at line 276 of file winproc.cpp.

277{
278 // Loading and setting the window menu from resource
281
282 // Create the status bar
287
288 // Create the tool box
290
291 // Create the palette window
292 RECT rcEmpty = { 0, 0, 0, 0 }; // Rely on WM_SIZE
294 paletteWindow.Create(m_hWnd, rcEmpty, NULL, style, WS_EX_STATICEDGE);
295
296 // Create the canvas
298 canvasWindow.Create(m_hWnd, rcEmpty, NULL, style, WS_EX_CLIENTEDGE);
299
300 // Create and show the miniature if necessary
302 {
304 miniature.ShowWindow(SW_SHOWNOACTIVATE);
305 }
306
307 // Set icon
310
311 return 0;
312}
Arabic default style
Definition: afstyles.h:94
#define ID_MENU
Definition: resource.h:32
BOOL DoCreate(HWND hwndParent)
Definition: toolbox.cpp:55
#define WS_CHILD
Definition: pedump.c:617
#define WS_GROUP
Definition: pedump.c:633
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_HSCROLL
Definition: pedump.c:628
#define SB_SETMINHEIGHT
Definition: commctrl.h:1957
#define SBARS_SIZEGRIP
Definition: commctrl.h:1923
#define STATUSCLASSNAME
Definition: commctrl.h:1939
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
LONG_PTR LPARAM
Definition: windef.h:208
#define CreateWindowEx
Definition: winuser.h:5745
#define WS_EX_STATICEDGE
Definition: winuser.h:403
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define LoadMenu
Definition: winuser.h:5807
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384

◆ OnDestroy()

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

Definition at line 314 of file winproc.cpp.

315{
318
320
321 if (s_hHHCTRL_OCX)
322 {
326 }
327
328 SetMenu(NULL);
329 if (m_hMenu)
330 {
332 m_hMenu = NULL;
333 }
334
335 PostQuitMessage(0); /* send a WM_QUIT to the message queue */
336 return 0;
337}
#define FreeLibrary(x)
Definition: compat.h:748
#define HH_CLOSE_ALL
Definition: htmlhelp.h:41
static HINSTANCE s_hHHCTRL_OCX
Definition: winproc.cpp:17
static FN_HtmlHelpW s_pHtmlHelpW
Definition: winproc.cpp:18
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
struct _WINDOWPLACEMENT WINDOWPLACEMENT

◆ OnDropFiles()

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

Definition at line 263 of file winproc.cpp.

264{
265 TCHAR droppedfile[MAX_PATH];
266
267 HDROP hDrop = (HDROP)wParam;
268 DragQueryFile(hDrop, 0, droppedfile, _countof(droppedfile));
269 DragFinish(hDrop);
270
271 ConfirmSave() && DoLoadImageFile(m_hWnd, droppedfile, TRUE);
272
273 return 0;
274}
#define MAX_PATH
Definition: compat.h:34
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
#define DragQueryFile
Definition: shellapi.h:683

◆ OnGetMinMaxInfo()

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

Definition at line 486 of file winproc.cpp.

487{
489 mm->ptMinTrackSize.x = 330;
490 mm->ptMinTrackSize.y = 360;
491 return 0;
492}
POINT ptMinTrackSize
Definition: winuser.h:3620
struct tagMINMAXINFO * LPMINMAXINFO

◆ OnInitMenuPopup()

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

Definition at line 421 of file winproc.cpp.

422{
423 HMENU menu = (HMENU)wParam;
424 BOOL trueSelection =
427
428 switch (lParam)
429 {
430 case 0: /* File menu */
432 break;
433 case 1: /* Edit menu */
436 EnableMenuItem(menu, IDM_EDITCUT, ENABLED_IF(trueSelection));
437 EnableMenuItem(menu, IDM_EDITCOPY, ENABLED_IF(trueSelection));
440 EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
444 break;
445 case 2: /* View menu */
451
454 break;
455 case 3: /* Image menu */
458 break;
459 }
460
468
471 return 0;
472}
#define CHECKED_IF(a)
Definition: common.h:35
#define ENABLED_IF(a)
Definition: common.h:38
#define IDM_EDITINVERTSELECTION
Definition: resource.h:65
void ProcessFileMenu(HMENU hPopupMenu)
Definition: winproc.cpp:375
BOOL HasRedoSteps() const
Definition: history.cpp:184
BOOL HasUndoSteps() const
Definition: history.cpp:179
PAL_TYPE SelectedPalette()
int GetZoom() const
Definition: toolsmodel.cpp:148
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)

◆ OnKeyDown()

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

Definition at line 494 of file winproc.cpp.

495{
496 if (wParam == VK_ESCAPE)
497 {
498 HWND hwndCapture = GetCapture();
499 if (hwndCapture)
500 {
501 if (canvasWindow.m_hWnd == hwndCapture ||
502 fullscreenWindow.m_hWnd == hwndCapture)
503 {
504 SendMessage(hwndCapture, nMsg, wParam, lParam);
505 }
506 }
507 }
508 return 0;
509}
#define VK_ESCAPE
Definition: winuser.h:2204

◆ OnMouseWheel()

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

Definition at line 213 of file winproc.cpp.

214{
215 INT zDelta = (SHORT)HIWORD(wParam);
216
218 {
219 if (zDelta < 0)
220 {
222 zoomTo(toolsModel.GetZoom() / 2, 0, 0);
223 }
224 else if (zDelta > 0)
225 {
227 zoomTo(toolsModel.GetZoom() * 2, 0, 0);
228 }
229 }
230 else
231 {
232 UINT nCount = 3;
234 {
235#ifndef SPI_GETWHEELSCROLLCHARS
236 #define SPI_GETWHEELSCROLLCHARS 0x006C // Needed for pre-NT6 PSDK
237#endif
239 for (UINT i = 0; i < nCount; ++i)
240 {
241 if (zDelta < 0)
243 else if (zDelta > 0)
245 }
246 }
247 else
248 {
249 SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &nCount, 0);
250 for (UINT i = 0; i < nCount; ++i)
251 {
252 if (zDelta < 0)
254 else if (zDelta > 0)
256 }
257 }
258 }
259
260 return 0;
261}
#define MAX_ZOOM
Definition: common.h:15
#define MIN_ZOOM
Definition: common.h:14
unsigned int UINT
Definition: ndis.h:50
short SHORT
Definition: pedump.c:59
#define HIWORD(l)
Definition: typedefs.h:247
#define SPI_GETWHEELSCROLLCHARS
#define MAKEWPARAM(l, h)
Definition: winuser.h:3999
#define SB_LINEUP
Definition: winuser.h:564
#define WM_HSCROLL
Definition: winuser.h:1733
#define WM_VSCROLL
Definition: winuser.h:1734
#define VK_CONTROL
Definition: winuser.h:2193
#define SB_LINEDOWN
Definition: winuser.h:565
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define VK_SHIFT
Definition: winuser.h:2192
SHORT WINAPI GetAsyncKeyState(_In_ int)

◆ OnSize() [1/2]

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

Definition at line 239 of file gui.cpp.

240{
241 if (wParam == SIZE_MINIMIZED)
242 return;
243
244 /* Size status bar */
245 m_StatusBar->SendMessage(WM_SIZE, 0, 0);
246
247 RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};
248 HDWP hdwp = NULL;
250
252 if (hdwp)
253 {
254 hdwp = m_ClientPanel->OnParentSize(r, hdwp);
255 if (hdwp)
256 {
257 EndDeferWindowPos(hdwp);
258 }
259 }
260}
virtual DWORD_PTR CountSizableChildren()
Definition: rosui.h:439
virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp)
Definition: rosui.h:454
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define SIZE_MINIMIZED
Definition: winuser.h:2496

◆ OnSize() [2/2]

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

Definition at line 474 of file winproc.cpp.

475{
476 int test[] = { LOWORD(lParam) - 260, LOWORD(lParam) - 140, LOWORD(lParam) - 20 };
478 {
481 }
483 return 0;
484}
BOOL IsWindow() const
Definition: atlwin.h:941
#define SB_SETPARTS
Definition: commctrl.h:1954
#define test
Definition: rosglue.h:37

Referenced by ProcessWindowMessage().

◆ OnSysColorChange()

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

Definition at line 511 of file winproc.cpp.

512{
513 /* Redirect message to common controls */
515 SendMessage(hToolbar, WM_SYSCOLORCHANGE, 0, 0);
516 return 0;
517}
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1616

◆ ProcessFileMenu()

void CMainWindow::ProcessFileMenu ( HMENU  hPopupMenu)
private

Definition at line 375 of file winproc.cpp.

376{
378 BOOL isBMP = FALSE;
379 if (_tcsicmp(dotext, _T(".bmp")) == 0 ||
380 _tcsicmp(dotext, _T(".dib")) == 0 ||
381 _tcsicmp(dotext, _T(".rle")) == 0)
382 {
383 isBMP = TRUE;
384 }
385
389
390 for (INT iItem = 0; iItem < MAX_RECENT_FILES; ++iItem)
391 RemoveMenu(hPopupMenu, IDM_FILE1 + iItem, MF_BYCOMMAND);
392
394 return;
395
397
398 INT cMenuItems = GetMenuItemCount(hPopupMenu);
399
400 for (INT iItem = 0; iItem < MAX_RECENT_FILES; ++iItem)
401 {
402 CString& strFile = registrySettings.strFiles[iItem];
403 if (strFile.IsEmpty())
404 break;
405
406 // Condense the lengthy pathname by using '...'
407#define MAX_RECENT_PATHNAME_DISPLAY 30
408 CPath pathFile(strFile);
409 pathFile.CompactPathEx(MAX_RECENT_PATHNAME_DISPLAY);
411
412 // Add an accelerator (by '&') to the item number for quick access
413 TCHAR szText[4 + MAX_RECENT_PATHNAME_DISPLAY + 1];
414 wsprintf(szText, _T("&%u %s"), iItem + 1, (LPCTSTR)pathFile);
415
416 INT iMenuItem = (cMenuItems - 2) + iItem;
417 InsertMenu(hPopupMenu, iMenuItem, MF_BYPOSITION | MF_STRING, IDM_FILE1 + iItem, szText);
418 }
419}
#define MAX_RECENT_FILES
Definition: registry.h:11
#define IDM_FILEMOSTRECENTLYUSEDFILE
Definition: resource.h:51
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:447
#define assert(x)
Definition: debug.h:53
BOOL isAFile
Definition: main.cpp:17
#define MAX_RECENT_PATHNAME_DISPLAY
#define MF_BYCOMMAND
Definition: winuser.h:202
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define MF_STRING
Definition: winuser.h:138
#define MF_BYPOSITION
Definition: winuser.h:203
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define wsprintf
Definition: winuser.h:5855
#define InsertMenu
Definition: winuser.h:5793
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define _tcslen
Definition: xmlstorage.h:198
#define _tcsicmp
Definition: xmlstorage.h:205

Referenced by OnInitMenuPopup().

◆ ProcessWindowMessage()

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

Implements ATL::CMessageMap.

Definition at line 299 of file gui.cpp.

300{
301 theResult = 0;
302 switch (Msg)
303 {
304 case WM_CREATE:
305 if (!InitControls())
307 break;
308
309 case WM_DESTROY:
310 {
313
314 FreeLogs();
315
316 delete m_ClientPanel;
317
319 return 0;
320 }
321
322 case WM_COMMAND:
324 break;
325
326 case WM_NOTIFY:
327 {
329
330 switch (data->code)
331 {
332 case TVN_SELCHANGED:
333 {
334 if (data->hwndFrom == m_TreeView->m_hWnd)
335 {
336 switch (((LPNMTREEVIEW)lParam)->itemNew.lParam)
337 {
338 case IDS_INSTALLED:
340 break;
341
342 case IDS_APPLICATIONS:
344 break;
345
346 case IDS_UPDATES:
348 break;
349
352 break;
353
354 case IDS_CAT_AUDIO:
356 break;
357
358 case IDS_CAT_DEVEL:
360 break;
361
362 case IDS_CAT_DRIVERS:
364 break;
365
366 case IDS_CAT_EDU:
368 break;
369
370 case IDS_CAT_ENGINEER:
372 break;
373
374 case IDS_CAT_FINANCE:
376 break;
377
378 case IDS_CAT_GAMES:
380 break;
381
382 case IDS_CAT_GRAPHICS:
384 break;
385
386 case IDS_CAT_INTERNET:
388 break;
389
390 case IDS_CAT_LIBS:
392 break;
393
394 case IDS_CAT_OFFICE:
396 break;
397
398 case IDS_CAT_OTHER:
400 break;
401
402 case IDS_CAT_SCIENCE:
404 break;
405
406 case IDS_CAT_TOOLS:
408 break;
409
410 case IDS_CAT_VIDEO:
412 break;
413
414 case IDS_CAT_THEMES:
416 break;
417
420 break;
421 }
422 }
423 }
424 break;
425 }
426 }
427 break;
428
429 case WM_SIZE:
431 break;
432
433 case WM_SIZING:
434 {
435 LPRECT pRect = (LPRECT)lParam;
436
437 if (pRect->right - pRect->left < 565)
438 pRect->right = pRect->left + 565;
439
440 if (pRect->bottom - pRect->top < 300)
441 pRect->bottom = pRect->top + 300;
442
443 return TRUE;
444 }
445
447 {
448 /* Forward WM_SYSCOLORCHANGE to common controls */
450 m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, wParam, lParam);
451 }
452 break;
453
454 case WM_TIMER:
455 if (wParam == SEARCH_TIMER_ID)
456 {
458
460 }
461 break;
462 }
463
464 return FALSE;
465}
@ ENUM_CAT_LIBS
Definition: appinfo.h:40
@ ENUM_CAT_ENGINEER
Definition: appinfo.h:35
@ ENUM_CAT_VIDEO
Definition: appinfo.h:28
@ ENUM_CAT_FINANCE
Definition: appinfo.h:36
@ ENUM_CAT_OFFICE
Definition: appinfo.h:32
@ ENUM_CAT_EDU
Definition: appinfo.h:34
@ ENUM_CAT_AUDIO
Definition: appinfo.h:27
@ ENUM_CAT_TOOLS
Definition: appinfo.h:38
@ ENUM_UPDATES
Definition: appinfo.h:46
@ ENUM_CAT_SELECTED
Definition: appinfo.h:43
@ ENUM_ALL_AVAILABLE
Definition: appinfo.h:26
@ ENUM_CAT_INTERNET
Definition: appinfo.h:31
@ ENUM_CAT_GAMES
Definition: appinfo.h:30
@ ENUM_CAT_THEMES
Definition: appinfo.h:41
@ ENUM_INSTALLED_APPLICATIONS
Definition: appinfo.h:45
@ ENUM_CAT_GRAPHICS
Definition: appinfo.h:29
@ ENUM_CAT_DEVEL
Definition: appinfo.h:33
@ ENUM_CAT_DRIVERS
Definition: appinfo.h:39
@ ENUM_CAT_SCIENCE
Definition: appinfo.h:37
@ ENUM_CAT_OTHER
Definition: appinfo.h:42
void SaveSettings(void)
Definition: settings.c:115
#define SEARCH_TIMER_ID
Definition: gui.h:21
VOID FreeLogs()
Definition: misc.cpp:218
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:474
LRESULT OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: winproc.cpp:519
BOOL InitControls()
Definition: gui.cpp:225
struct @1609 Msg[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define LPNMTREEVIEW
Definition: commctrl.h:3643
#define WM_NOTIFY
Definition: richedit.h:61
#define LPRECT
Definition: precomp.h:28
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WM_CREATE
Definition: winuser.h:1598
#define WM_TIMER
Definition: winuser.h:1732
struct tagNMHDR * LPNMHDR
#define WM_SIZING
Definition: winuser.h:1797
#define WM_DESTROY
Definition: winuser.h:1599
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

◆ RemoveSelectedAppFromRegistry()

BOOL CMainWindow::RemoveSelectedAppFromRegistry ( )
private

Definition at line 263 of file gui.cpp.

264{
266 return FALSE;
267
268 CStringW szMsgText, szMsgTitle;
269
270 if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) || !szMsgTitle.LoadStringW(IDS_INFORMATION))
271 return FALSE;
272
273 if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
274 {
276 if (!InstalledApp)
277 return FALSE;
278
279 return m_Db->RemoveInstalledAppFromRegistry(InstalledApp);
280 }
281
282 return FALSE;
283}
BOOL IsInstalledEnum(INT x)
Definition: appinfo.h:61
#define IDS_INFORMATION
Definition: resource.h:109
#define IDS_APP_REG_REMOVE
Definition: resource.h:108
BOOL RemoveInstalledAppFromRegistry(const CAppInfo *Info)
Definition: appdb.cpp:266
#define MB_YESNO
Definition: winuser.h:811

Referenced by OnCommand().

◆ saveImage()

void CMainWindow::saveImage ( BOOL  overwrite)
private

Definition at line 141 of file winproc.cpp.

142{
144
145 if (isAFile && overwrite)
146 {
148 }
150 {
152
153 CString strTitle;
155 SetWindowText(strTitle);
156 isAFile = TRUE;
157 }
158}
void SaveImage(LPTSTR lpFileName)
Definition: history.cpp:169
#define SetWindowText
Definition: winuser.h:5847

Referenced by ConfirmSave(), and OnCommand().

◆ SearchTextChanged()

BOOL CMainWindow::SearchTextChanged ( CStringW SearchText)

Definition at line 739 of file gui.cpp.

740{
741 if (szSearchPattern == SearchText)
742 {
743 return FALSE;
744 }
745
746 szSearchPattern = SearchText;
747
748 DWORD dwDelay = 0;
749 SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0);
750 SetTimer(SEARCH_TIMER_ID, dwDelay);
751
752 return TRUE;
753}
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

Referenced by CApplicationView::OnCommand().

◆ ShowAboutDlg()

VOID CMainWindow::ShowAboutDlg ( )
private

Definition at line 468 of file gui.cpp.

469{
470 CStringW szApp;
471 CStringW szAuthors;
472 HICON hIcon;
473
474 szApp.LoadStringW(IDS_APPTITLE);
475 szAuthors.LoadStringW(IDS_APP_AUTHORS);
477 ShellAboutW(m_hWnd, szApp, szAuthors, hIcon);
479}
#define IDS_APP_AUTHORS
Definition: resource.h:124
HINSTANCE hInst
Definition: dxdiag.c:13
HICON hIcon
Definition: msconfig.c:44
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022

Referenced by OnCommand().

◆ UninstallSelectedApp()

BOOL CMainWindow::UninstallSelectedApp ( BOOL  bModify)
private

Definition at line 286 of file gui.cpp.

287{
289 return FALSE;
290
292 if (!InstalledApp)
293 return FALSE;
294
295 return InstalledApp->UninstallApplication(bModify);
296}
virtual BOOL UninstallApplication(BOOL bModify)=0

Referenced by OnCommand().

◆ UpdateApplicationsList()

VOID CMainWindow::UpdateApplicationsList ( AppsCategories  EnumType,
BOOL  bReload = FALSE 
)
private

Definition at line 598 of file gui.cpp.

599{
600 bUpdating = TRUE;
601
602 if (SelectedEnumType != EnumType)
603 SelectedEnumType = EnumType;
604
605 if (bReload)
607
609 if (IsInstalledEnum(EnumType))
610 {
611 if (bReload)
613
614 // set the display type of application-view. this will remove all the item in application-view too.
616
618 m_Db->GetApps(List, EnumType);
620 }
621 else if (IsAvailableEnum(EnumType))
622 {
623 if (bReload)
625
626 // set the display type of application-view. this will remove all the item in application-view too.
628
629 // enum available softwares
630 if (EnumType == ENUM_CAT_SELECTED)
631 {
633 }
634 else
635 {
637 m_Db->GetApps(List, EnumType);
639 }
640 }
641 else
642 {
643 ATLASSERT(0 && "This should be unreachable!");
644 }
646 m_ApplicationView->RedrawWindow(0, 0, RDW_INVALIDATE | RDW_ALLCHILDREN); // force the child window to repaint
648
651 {
652 text.LoadString(IDS_NO_SEARCH_RESULTS);
653 }
655
657}
@ AppViewTypeInstalledApps
Definition: appview.h:72
@ AppViewTypeAvailableApps
Definition: appview.h:71
#define IDS_NO_SEARCH_RESULTS
Definition: resource.h:128
VOID UpdateAvailable()
Definition: appdb.cpp:121
VOID UpdateInstalled()
Definition: appdb.cpp:145
VOID GetApps(CAtlList< CAppInfo * > &List, AppsCategories Type) const
Definition: appdb.cpp:53
BOOL SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
Definition: appview.cpp:1816
void SetRedraw(BOOL bRedraw)
Definition: appview.cpp:1603
VOID SetWatermark(const CStringW &Text)
Definition: appview.cpp:1860
VOID AddApplicationsToView(CAtlList< CAppInfo * > &List)
Definition: gui.cpp:582
const WCHAR * text
Definition: package.c:1799
#define RDW_ALLCHILDREN
Definition: winuser.h:1211
#define RDW_INVALIDATE
Definition: winuser.h:1204

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

◆ UpdateStatusBarText()

VOID CMainWindow::UpdateStatusBarText ( )
private

Definition at line 570 of file gui.cpp.

571{
572 if (m_StatusBar)
573 {
574 CStringW szBuffer;
575
577 m_StatusBar->SetText(szBuffer);
578 }
579}
#define IDS_APPS_COUNT
Definition: resource.h:97
size_t GetCount() const
Definition: atlcoll.h:539
VOID SetText(LPCWSTR lpszText)
Definition: rosctrls.h:457

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

Member Data Documentation

◆ bAppwizMode

BOOL CMainWindow::bAppwizMode
private

Definition at line 60 of file gui.h.

Referenced by InitCategoriesList().

◆ bUpdating

BOOL CMainWindow::bUpdating = FALSE
private

Definition at line 59 of file gui.h.

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

◆ hRootItemInstalled

HTREEITEM CMainWindow::hRootItemInstalled
private

Definition at line 61 of file gui.h.

Referenced by InitCategoriesList(), and OnCommand().

◆ m_ApplicationView

◆ m_ClientPanel

CUiPanel* CMainWindow::m_ClientPanel = NULL
private

Definition at line 48 of file gui.h.

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

◆ m_Db

CAppDB* CMainWindow::m_Db
private

Definition at line 56 of file gui.h.

Referenced by OnCommand(), RemoveSelectedAppFromRegistry(), and UpdateApplicationsList().

◆ m_hMenu

HMENU CMainWindow::m_hMenu
private

Definition at line 39 of file winproc.h.

Referenced by OnCreate(), and OnDestroy().

◆ m_Selected

CAtlList<CAppInfo *> CMainWindow::m_Selected
private

◆ m_StatusBar

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

Definition at line 52 of file gui.h.

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

◆ m_TreeView

CSideTreeView* CMainWindow::m_TreeView = NULL
private

◆ m_VSplitter

CUiSplitPanel* CMainWindow::m_VSplitter = NULL
private

◆ SelectedEnumType

◆ szSearchPattern

CStringW CMainWindow::szSearchPattern
private

Definition at line 63 of file gui.h.

Referenced by AddApplicationsToView(), SearchTextChanged(), and UpdateApplicationsList().


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