-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathNSWFL_Windows.H
100 lines (82 loc) · 4.53 KB
/
NSWFL_Windows.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright © NetworkDLS 2023, All rights reserved
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef _NSWFL_WINDOWS_H_
#define _NSWFL_WINDOWS_H_
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <shtypes.h>
namespace NSWFL {
namespace Windows {
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
enum OpenOrSaveDialogType { //For OSFileDialog(...)
OFD = 1, //Open File Dialog
SFD = 2 //Save File Dialog
};
#define SHELL_FOLDERS_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CopyToClipboard(char* str);
bool EnableDialogSystemMenu(HWND hWnd, bool bState);
bool EnableDialogCloseButton(HWND hWnd, bool bState);
void TextBoxInsert(HWND hWnd, const char* sInBuf);
void TextBoxWrite(HWND hWnd, const char* sInBuf);
void CopyTextBoxToClipboard(HWND hWnd);
void MsgBox(const int iValue);
void MsgBox(const float fValue);
void MsgBox(const double dValue);
void MsgBox(const char* sValue);
void MsgBox(const __int64 i64Value);
int MsgBoxF(HWND hWnd, const char* sCaption, DWORD dwFlags, const char* sFormat, ...);
int MsgBoxF(HWND hWnd, const char* sCaption, const char* sFormat, ...);
int MsgBoxF(HWND hWnd, const char* sFormat, ...);
int MsgBoxF(const char* sFormat, ...);
int PropPageMsg(HWND hWnd, const char* sText, const char* sTitle);
int PropPageMsg(HWND hWnd, const char* sText, const char* sTitle, int iMsgBoxStyle);
void ErrorMessage(HWND hWnd, const char* sInBuf);
void AlertMessage(HWND hWnd, const char* sInBuf, const char* sTitle);
int Get_TextLength(HWND hWnd);
long Get_Long(HWND hWnd);
__int64 Get_Int64(HWND hWnd);
float Get_Float(HWND hWnd);
double Get_Double(HWND hWnd);
int Get_Int(HWND hWnd);
void Set_Long(HWND hWnd, long lInput);
void Set_LongFormatted(HWND hWnd, long lInput);
void Set_Double(HWND hWnd, double dInput, int iDecimals);
void Set_Float(HWND hWnd, float fInput, int iDecimals);
void Set_DoubleFormatted(HWND hWnd, double dInput, int iDecimals);
void Set_FloatFormatted(HWND hWnd, float fInput, int iDecimals);
void Set_Int(HWND hWnd, int iInput);
void Set_Text(HWND hWnd, const char* sInBuf);
int Set_TextF(HWND hWnd, const char* sFormat, ...);
int Get_Text(HWND hWnd, char* sOutBuf, int iMaxSize);
int Get_Text(HWND hWnd, char*& sOutBuf);
void CenterWindow(HWND hWnd);
void CenterOverWindow(HWND hWnd, HWND hOtherWindow);
void CenterOverOwner(HWND hWnd);
LRESULT CALLBACK Set_Color(int iFGColor, int iBKColor, WPARAM wParam);
bool IsMouseOverHwnd(HWND hWnd);
int OSFileDialog(HWND hOwner, char* sInOutFileName, int iMaxOutBufSz, char* sInDfltExt,
char* sInTitle, char* sInFilters, char* sInDfltDir,
NSWFL::Windows::OpenOrSaveDialogType iDlgType, DWORD dwFlags);
bool BrowseDirectory(HWND hOwner, char* sInTitle, unsigned long ulFlags, char* sOutBuf, int iMaxOutBufSz);
bool BrowseDirectory(HWND hOwner, char* sInTitle, unsigned long ulFlags, char* sOutBuf, int iMaxOutBufSz, char* sInitialDirectory);
bool BrowseDirectory(HWND hOwner, char* sInTitle, unsigned long ulFlags, char* sOutBuf, int iMaxOutBufSz, char* sInitialDirectory, const char* sRoot);
LPITEMIDLIST ConvertPathToLpItemIdList(const char* pszPath);
HFONT MakeFont(char* sFontName, int iPointSize);
void SetFont(HWND hWnd, HFONT hFont);
bool WaitOnWindow(HWND& hWnd);
bool WaitOnWindow(HWND& hWnd, int iMilliSeconds);
bool IsMouseOverWindow(HWND hWnd);
HWND GetWindowUnderPoint(void);
void ShowWindowInTaskbar(HWND hWnd, bool bShow);
bool SelectComboItem(HWND hCombo, const char* sText, int iMatchLength);
bool SelectComboItem(HWND hCombo, const char* sText);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} //namespace::Windows
} //namespace::NSWFL
#endif