Polygon Crucher SDK - Documentation
Documentation
Loading...
Searching...
No Matches
WindowTools.h
1#ifndef WINDOW_TOOLS_H
2#define WINDOW_TOOLS_H
3
4BEGIN_MOOTOOLS_NAMESPACE
5
6DLL_TOOLSFUNCTION void ActivateWindow(CXWinWnd *pWnd, BOOL switchWindow, BOOL show = TRUE);
7DLL_TOOLSFUNCTION CXWinWnd *FindWindowByClassName(const CXString& classname);
8
9#ifndef MOOTOOLS_NO_UI
10
11// Messages box
12DLL_TOOLSFUNCTION int CMessageBox(LPCTSTR lpszText, UINT nType = MB_OK, UINT nIDHelp = 0);
13DLL_TOOLSFUNCTION int CMessageBox(UINT nIDPrompt, UINT nType = MB_OK, UINT nIDHelp = (UINT)-1);
14
15DLL_TOOLSFUNCTION void WarningBox(int, int);
16DLL_TOOLSFUNCTION void WarningBox(const CXString&, const CXString&);
17DLL_TOOLSFUNCTION void ShowLastError(DWORD lastError);
18
19typedef enum _SetWindowInDisplayEnum
20{
21 SETWINDOW_DEFAULT = 0x00,
22 SETWINDOW_MOVEWINDOW = 0x01, // Perform the window's move
23 SETWINDOW_SHOW_ALLWINDOW = 0x02, // Window fit in the screen
24 SETWINDOW_PREVENT_CENTER = 0x04, // Do not center no moveable windows
25 SETWINDOW_XY_IS_BOTTOMRIGTH = 0x08, // Align the window from the bottom right pos
27
28// Window useful functions
30DLL_TOOLSFUNCTION void SetWindowInDisplay(CXWnd *pWnd, int& x, int& y, unsigned int flags = SETWINDOW_DEFAULT);
31DLL_TOOLSFUNCTION CXWnd *FindMainThreadWindow(DWORD threadID);
32DLL_TOOLSFUNCTION CRect GetViewportRect(CXWnd *);
33DLL_TOOLSFUNCTION CPoint GetViewportOffset(CXWnd *);
34DLL_TOOLSFUNCTION bool IsDescendant(HWND hWndParent, HWND hWndChild);
35DLL_TOOLSFUNCTION CXWnd *FindMainThreadWindow(DWORD threadID);
36DLL_TOOLSFUNCTION CXWnd *GetCursorWnd(bool checkLButtonDown);
37
38// Picker color
39typedef BOOL (*PickColorCallback)(COLORREF& color, void *data);
40bool DLL_TOOLSFUNCTION PickColor(CXWnd *pWnd, COLORREF& color, PickColorCallback callback, void *data);
41bool DLL_TOOLSFUNCTION DisplayStringMatchMenu(CEdit *pEdit);
42
43class DLL_TOOLSFUNCTION CLockWndRedraw
44{
45 CXWnd *pWnd;
46 int count;
47
48public:
49 typedef enum XEnumType(unsigned int)
50 {
51 LOCKWND_DEFAULT = 0x00, // This call SetRedraw when lock and unlock is reached
52 LOCKWND_FORCEREDRAW = 0x01, // This also call RedrawWindow when unlocking is reached
53 LOCKWND_LOCKONLY = 0x02, // This only increment / decrement the lock without any action on the window
54 } LockFlags;
55
58 virtual ~CLockWndRedraw();
59
60 void SetWnd(CXWnd* pWnd, bool lock);
61 void Lock(bool lock, unsigned int forceRedraw = LOCKWND_DEFAULT);
62 bool IsLock() const { return (count > 0); };
63};
64
65// Dark Mode / Rounded Windows
66DLL_TOOLSFUNCTION void ApplyW11FeaturesToWnd(HWND hWnd);
67DLL_TOOLSFUNCTION void SetDarkMode(HWND hWnd, bool useSystemSetting = true);
68DLL_TOOLSFUNCTION void SetRoundedWindows(HWND hWnd);
69
70#endif
71
72END_MOOTOOLS_NAMESPACE
73
74#endif // WINDOW_TOOLS_H
The class defines an x, y, z 3D point which can use int, float or double.
Definition 3DPoint.h:27