26#define MAX_KEY_NAME 255
38 static WCHAR szFilter[] =
L"Remote Desktop Files (*.RDP)\0*.rdp\0";
64 static WCHAR szFilter[] =
L"Remote Desktop Files (*.RDP)\0*.rdp\0";
108 WCHAR szKeyName[] =
L"Software\\Microsoft\\Terminal Server Client\\Servers";
119 lpAddress =
wcstok(szValue,
L":");
121 if (lpAddress ==
NULL)
162 WCHAR KeyName[] =
L"Software\\Microsoft\\Terminal Server Client\\Default";
416 DWORD NbSettings = 0;
425 *CurrentSettings =
NULL;
468 while (Next !=
NULL &&
478 Current->
Blink = Previous;
479 Current->
Flink = Next;
480 if (Previous ==
NULL)
483 Previous->
Flink = Current;
485 Next->
Blink = Current;
488 *CurrentSettings = Current;
495 *pSettingsCount = NbSettings;
508 SIZE_T descriptionSize, nameSize, keySize, devidSize;
510 DWORD ResolutionsCount = 1;
516 if (!newEntry)
goto ByeBye;
522 if (!newEntry->
Settings)
goto ByeBye;
570 if (!
name)
goto ByeBye;
574 if (!
key)
goto ByeBye;
578 if (!devid)
goto ByeBye;
594 if (newEntry !=
NULL)
599 while (Current !=
NULL)
634 if (position == MaxSlider)
648 sizeof(Pixel) /
sizeof(
WCHAR)))
689 case 32:
num = 4;
break;
690 case 24:
num = 3;
break;
691 case 16:
num = 2;
break;
692 case 15:
num = 1;
break;
693 case 8:
num = 0;
break;
694 default:
num = 0;
break;
712 i++, Current = Current->
Flink)
1035 pInfo->hSelf =
hwnd;
1038 pInfo->pRdpSettings = pRdpSettings;
1047 if (pInfo->hMstscSm)
1052 (
WPARAM)pInfo->hMstscSm);
1060 if (pInfo->hMstscLg)
1065 (
WPARAM)pInfo->hMstscLg);
1078 &pInfo->headerbitmap);
1096 item.cchTextMax = 256;
1111 item.cchTextMax = 256;
1161 goto HandleDefaultMessage;
1245 sizeof(szBuffer) /
sizeof(
WCHAR)))
1283 sizeof(szBuffer) /
sizeof(
WCHAR)))
1325HandleDefaultMessage:
INT GetIntegerFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue)
VOID SaveAllSettings(PINFO pInfo)
BOOL LoadRdpSettingsFromFile(PRDPSETTINGS pRdpSettings, LPWSTR lpFile)
BOOL SaveRdpSettingsToFile(LPWSTR lpFile, PRDPSETTINGS pRdpSettings)
LPWSTR GetStringFromSettings(PRDPSETTINGS pSettings, LPWSTR lpValue)
#define IDC_SETTINGS_RESOLUTION_TEXT
#define IDD_CONNECTDIALOG
#define RegCloseKey(hKey)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
#define OFN_OVERWRITEPROMPT
#define OFN_PATHMUSTEXIST
struct tagOFNW OPENFILENAMEW
static VOID GeneralOnInit(HWND hwnd, PINFO pInfo)
static VOID DoSaveAs(PINFO pInfo)
INT_PTR CALLBACK GeneralDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
BOOL OpenRDPConnectDialog(HINSTANCE hInstance, PRDPSETTINGS pRdpSettings)
static VOID DisplayOnInit(HWND hwnd, PINFO pInfo)
static VOID FillServerAddressCombo(PINFO pInfo)
static VOID ReLoadDisplayPage(PINFO pInfo)
static VOID OnResolutionChanged(PINFO pInfo, INT position)
INT_PTR CALLBACK DisplayDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
static VOID ReLoadGeneralPage(PINFO pInfo)
static BOOL OnMainCreate(HWND hwnd, PRDPSETTINGS pRdpSettings)
static PSETTINGS_ENTRY GetPossibleSettings(IN LPCWSTR lpDeviceName, OUT DWORD *pSettingsCount, OUT PSETTINGS_ENTRY *CurrentSettings)
static VOID FillResolutionsAndColors(PINFO pInfo)
static BOOL AddDisplayDevice(PINFO pInfo, PDISPLAY_DEVICEW DisplayDevice)
static VOID DoOpenFile(PINFO pInfo)
static VOID LoadUsernameHint(HWND hDlg, INT iCur)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
#define HeapFree(x, y, z)
static const WCHAR Message[]
static const WCHAR Cleanup[]
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define memcpy(s1, s2, n)
void OnTabWndSelChange(void)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
static const WCHAR szName[]
#define TabCtrl_GetCurSel(hwnd)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
WCHAR lfFaceName[LF_FACESIZE]
PRESOLUTION_INFO Resolutions
struct _DISPLAY_DEVICE_ENTRY * Flink
SETTINGS_ENTRY InitialSettings
PSETTINGS_ENTRY CurrentSettings
PDISPLAY_DEVICE_ENTRY DisplayDeviceList
PDISPLAY_DEVICE_ENTRY CurrentDisplayDevice
PRDPSETTINGS pRdpSettings
struct _SETTINGS_ENTRY * Flink
struct _SETTINGS_ENTRY * Blink
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HDC WINAPI CreateICW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_opt_ const DEVMODEW *)
BOOL WINAPI DPtoLP(_In_ HDC hdc, _Inout_updates_(c) LPPOINT lppt, _In_ int c)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define DISPLAY_DEVICE_PRIMARY_DEVICE
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define HKEY_CURRENT_USER
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define GetWindowLongPtrW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
#define CB_FINDSTRINGEXACT
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ENUM_CURRENT_SETTINGS
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
struct tagNMHDR * LPNMHDR
#define SWP_NOOWNERZORDER
#define MAKEINTRESOURCEW(i)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI BringWindowToTop(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
BOOL WINAPI DestroyIcon(_In_ HICON)