36 #define WC_MDICLIENTA "MDICLIENT" 37 #define WC_MDICLIENTW L"MDICLIENT" 40 #define WC_MDICLIENT WC_MDICLIENTW 42 #define WC_MDICLIENT WC_MDICLIENTA 55 #define BUFFER_SIZE 1024 92 dwBufferSize = dwDataSize + *pdwBufferSize;
97 pTmp =
Alloc(0, dwBufferSize);
103 *pdwBufferSize = dwBufferSize;
188 DWORD cbTokenBuffer = 0;
193 DWORD cbUserName = 0;
194 DWORD cbDomainName = 0;
245 if (lpUserName ==
NULL)
252 if (lpDomainName ==
NULL)
270 *UserName = lpUserName;
271 *DomainName = lpDomainName;
276 if (lpUserName !=
NULL)
279 if (lpDomainName !=
NULL)
323 if (lpUserName)
Free(lpUserName);
324 if (lpDomainName)
Free(lpDomainName);
339 const LPCWSTR lpszIniFile =
L"progman.ini";
352 bIsIniMigrated =
FALSE;
358 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Program Manager",
377 bIsIniMigrated = !!
Value;
387 bIsIniMigrated =
TRUE;
405 L"The Program Manager has detected the presence of a legacy settings file PROGMAN.INI in the directory '%s' " 406 L"and is going to migrate its contents into the current-user Program Manager settings registry key:\n" 407 L"HKCU\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Program Manager" 409 L"\x2022 The migration operation will potentially overwrite all the existing current-user Program Manager settings in the registry by those stored in the PROGMAN.INI file.\n" 411 L"\x2022 The migration is done once, so that, at the next launch of the Program Manager, the new migrated settings are directly used.\n" 413 L"\x2022 It is possible to trigger later the migration by manually deleting the registry value \"IniMigrated\" under the current-user Program Manager settings registry key (specified above).\n" 415 L"Would you like to migrate its contents into the registry?",
426 lpszSection = lpszSections;
448 lpszKeyValue = lpszData;
449 while (*lpszKeyValue)
451 lpszKey = lpszKeyValue;
452 lpszValue =
wcschr(lpszKeyValue,
L'=');
453 lpszKeyValue += (
wcslen(lpszKeyValue) + 1);
459 if (lpszTmp - lpszValue >=
wcslen(lpszValue))
480 lpszSection += (
wcslen(lpszSection) + 1);
544 L"UNICODE Program Groups",
554 L"SOFTWARE\\Program Groups",
583 WndPl.
length =
sizeof(WndPl);
630 icex.
dwSize =
sizeof(icex);
744 for (hGroup =
Globals.hGroups; hGroup; hGroup = hGroup->
hNext)
748 for (hProgram = hGroup->
hPrograms; hProgram; hProgram = hProgram->
hNext)
833 HWND hActiveGroupWnd = GROUP_GroupWnd(hActiveGroup);
859 else if (hActiveGroup)
874 Globals.bSaveSettings ?
"1" :
"0",
882 if (hActiveGroupWnd && !
IsIconic(hActiveGroupWnd))
899 HWND hActiveGroupWnd;
903 hActiveGroupWnd = (hActiveGroup ? hActiveGroup->
hWnd :
NULL);
914 if (!hActiveGroupWnd ||
IsIconic(hActiveGroupWnd))
926 format = (nResult & 0xC) >> 2;
927 bIsCommonGroup = (nResult & 2) != 0;
930 else if (hActiveGroup)
941 else if (hActiveGroupWnd)
968 else if (hActiveGroup)
1024 if (!hActiveGroupWnd ||
IsIconic(hActiveGroupWnd))
1200 *
string = newstring;
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
VOID DIALOG_Execute(VOID)
#define IDS_OUT_OF_MEMORY
#define IDI_GROUP_COMMON_ICON
GLint GLint GLsizei width
BOOL WINAPI TranslateMessage(_In_ const MSG *)
ATOM GROUP_RegisterGroupWinClass(VOID)
_In_ NDIS_ERROR_CODE ErrorCode
VOID PROGRAM_CopyMoveProgram(PROGRAM *hProgram, BOOL bMove)
PROGRAM * PROGRAM_ActiveProgram(PROGGROUP *hGroup)
#define STRING_MAIN_WIN_CLASS_NAME
BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName)
enum _SID_NAME_USE SID_NAME_USE
static VOID MAIN_LoadGroups(VOID)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HKEY_CURRENT_USER
TW_UINT32 TW_UINT16 TW_UINT16 MSG
static BOOL GetUserAndDomainName(OUT LPWSTR *UserName, OUT LPWSTR *DomainName)
#define IDS_NOT_IMPLEMENTED
UINT WINAPI ArrangeIconicWindows(_In_ HWND)
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
WCHAR szTitle[MAX_LOADSTRING]
BOOL WINAPI UpdateWindow(_In_ HWND)
static VOID MAIN_CreateMDIWindow(VOID)
VOID STRING_LoadMenus(VOID)
DWORD WINAPI GetLastError(VOID)
static ATOM MAIN_RegisterMainWinClass(VOID)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
VOID STRING_LoadStrings(VOID)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define PM_SAVE_SETTINGS_NOW
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI IsIconic(_In_ HWND)
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
PROGGROUP * GROUP_ActiveGroup(VOID)
INT WINAPI GetPrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len, LPCSTR filename)
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
#define sprintf(buf, format,...)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define WM_MDIICONARRANGE
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
enum _GROUPFORMAT GROUPFORMAT
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
VOID PrintWin32Error(IN LPWSTR Message, IN DWORD ErrorCode)
static VOID MAIN_SetMainWindowTitle(VOID)
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
VOID PrintStringV(IN LPCWSTR szStr, IN va_list args)
#define GCLP_HBRBACKGROUND
#define IDS_WINHELP_ERROR
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
VOID PrintString(IN LPCWSTR szStr,...)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
static BOOL MAIN_LoadSettings(VOID)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR buffer, DWORD size, LPCWSTR filename)
#define ERROR_FILE_NOT_FOUND
#define FORMAT_MESSAGE_FROM_SYSTEM
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
#define REG_OPTION_NON_VOLATILE
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
#define IDS_FILE_READ_ERROR_s
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDS_DELETE_PROGRAM_s
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI OpenIcon(_In_ HWND)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
VOID GROUP_ModifyGroup(PROGGROUP *hGroup)
VOID PrintResourceString(IN UINT uID,...)
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
BOOL Free(IN PVOID lpMem)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
BOOL DIALOG_New(INT nDefault, PINT pnResult)
#define memcpy(s1, s2, n)
#define GetCurrentProcess()
#define IDI_GROUP_PERSONAL_ICON
GLint GLint GLsizei GLsizei height
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
#define IDS_DELETE_GROUP_s
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
VOID GROUP_DeleteGroup(PROGGROUP *hGroup)
#define ICC_LISTVIEW_CLASSES
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
static BOOL MAIN_SaveSettings(VOID)
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
VOID PROGRAM_ModifyProgram(PROGRAM *hProgram)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define WS_OVERLAPPEDWINDOW
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
static VOID MAIN_CreateMainWindow(VOID)
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
#define MAKEINTRESOURCEW(i)
GLdouble GLdouble GLdouble GLdouble top
VOID PROGRAM_NewProgram(PROGGROUP *hGroup)
GLuint GLuint GLsizei GLenum type
INT WINAPI GetPrivateProfileSectionW(LPCWSTR section, LPWSTR buffer, DWORD len, LPCWSTR filename)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
int ShowLastWin32Error(VOID)
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
static VOID MAIN_AutoStart(VOID)
#define HeapFree(x, y, z)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define RegCloseKey(hKey)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
LRESULT WINAPI DefFrameProcW(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static LRESULT CALLBACK MAIN_MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
#define HKEY_LOCAL_MACHINE
#define ERROR_INSUFFICIENT_BUFFER
PVOID AppendToBuffer(IN PVOID pBuffer, IN PSIZE_T pdwBufferSize, IN PVOID pData, IN SIZE_T dwDataSize)