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;
#define IDS_OUT_OF_MEMORY
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
WCHAR szTitle[MAX_LOADSTRING]
BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName)
BOOL DIALOG_New(INT nDefault, PINT pnResult)
VOID DIALOG_Execute(VOID)
ATOM GROUP_RegisterGroupWinClass(VOID)
VOID GROUP_ModifyGroup(PROGGROUP *hGroup)
VOID GROUP_DeleteGroup(PROGGROUP *hGroup)
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup)
PROGGROUP * GROUP_ActiveGroup(VOID)
static VOID MAIN_CreateMainWindow(VOID)
INT MAIN_MessageBoxIDS_s(UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
static LRESULT CALLBACK MAIN_MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static VOID MAIN_LoadGroups(VOID)
static VOID MAIN_AutoStart(VOID)
VOID PrintString(IN LPCWSTR szStr,...)
static ATOM MAIN_RegisterMainWinClass(VOID)
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
static VOID MAIN_CreateMDIWindow(VOID)
VOID PrintResourceString(IN UINT uID,...)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
static BOOL MAIN_LoadSettings(VOID)
VOID MAIN_ReplaceString(LPWSTR *string, LPWSTR replace)
static BOOL MAIN_SaveSettings(VOID)
static BOOL GetUserAndDomainName(OUT LPWSTR *UserName, OUT LPWSTR *DomainName)
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
int ShowLastWin32Error(VOID)
VOID PrintStringV(IN LPCWSTR szStr, IN va_list args)
static VOID MAIN_SetMainWindowTitle(VOID)
VOID PrintWin32Error(IN LPWSTR Message, IN DWORD ErrorCode)
PVOID AppendToBuffer(IN PVOID pBuffer, IN PSIZE_T pdwBufferSize, IN PVOID pData, IN SIZE_T dwDataSize)
#define IDS_NOT_IMPLEMENTED
#define IDI_GROUP_PERSONAL_ICON
#define IDS_FILE_READ_ERROR_s
#define IDS_WINHELP_ERROR
#define IDI_GROUP_COMMON_ICON
#define PM_SAVE_SETTINGS_NOW
#define IDS_DELETE_PROGRAM_s
#define IDS_DELETE_GROUP_s
#define RegCloseKey(hKey)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
#define ERROR_INSUFFICIENT_BUFFER
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)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR buffer, DWORD size, LPCWSTR filename)
INT WINAPI GetPrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR def_val, LPSTR buffer, UINT len, LPCSTR filename)
INT WINAPI GetPrivateProfileSectionW(LPCWSTR section, LPWSTR buffer, DWORD len, LPCWSTR filename)
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
static const WCHAR Message[]
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
DWORD GRPFILE_ReadGroupFile(LPCWSTR lpszPath, BOOL bIsCommonGroup)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
enum _SID_NAME_USE SID_NAME_USE
#define memcpy(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define sprintf(buf, format,...)
_In_ NDIS_ERROR_CODE ErrorCode
#define REG_OPTION_NON_VOLATILE
#define WS_OVERLAPPEDWINDOW
VOID PROGRAM_CopyMoveProgram(PROGRAM *hProgram, BOOL bMove)
VOID PROGRAM_ModifyProgram(PROGRAM *hProgram)
VOID STRING_LoadStrings(VOID)
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
VOID STRING_LoadMenus(VOID)
PROGRAM * PROGRAM_ActiveProgram(PROGGROUP *hGroup)
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
#define STRING_MAIN_WIN_CLASS_NAME
enum _GROUPFORMAT GROUPFORMAT
VOID PROGRAM_NewProgram(PROGGROUP *hGroup)
#define ICC_LISTVIEW_CLASSES
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
TW_UINT32 TW_UINT16 TW_UINT16 MSG
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
LRESULT WINAPI DefFrameProcW(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
UINT WINAPI ArrangeIconicWindows(_In_ HWND)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
BOOL WINAPI OpenIcon(_In_ HWND)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI IsIconic(_In_ HWND)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define WM_MDIICONARRANGE
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define MAKEINTRESOURCEW(i)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define GCLP_HBRBACKGROUND
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free