ReactOS  0.4.14-dev-614-gbfd8a84
main.c File Reference
#include "progman.h"
#include <shellapi.h>
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define WC_MDICLIENTA   "MDICLIENT"
 
#define WC_MDICLIENTW   L"MDICLIENT"
 
#define WC_MDICLIENT   WC_MDICLIENTA
 
#define BUFFER_SIZE   1024
 

Functions

static VOID MAIN_LoadGroups (VOID)
 
static VOID MAIN_MenuCommand (HWND hWnd, WPARAM wParam, LPARAM lParam)
 
static ATOM MAIN_RegisterMainWinClass (VOID)
 
static VOID MAIN_CreateMainWindow (VOID)
 
static VOID MAIN_CreateMDIWindow (VOID)
 
static VOID MAIN_AutoStart (VOID)
 
PVOID Alloc (IN DWORD dwFlags, IN SIZE_T dwBytes)
 
BOOL Free (IN PVOID lpMem)
 
PVOID ReAlloc (IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
 
PVOID AppendToBuffer (IN PVOID pBuffer, IN PSIZE_T pdwBufferSize, IN PVOID pData, IN SIZE_T dwDataSize)
 
VOID PrintStringV (IN LPCWSTR szStr, IN va_list args)
 
VOID PrintString (IN LPCWSTR szStr,...)
 
VOID PrintResourceString (IN UINT uID,...)
 
VOID PrintWin32Error (IN LPWSTR Message, IN DWORD ErrorCode)
 
int ShowLastWin32Error (VOID)
 
static BOOL GetUserAndDomainName (OUT LPWSTR *UserName, OUT LPWSTR *DomainName)
 
static VOID MAIN_SetMainWindowTitle (VOID)
 
static BOOL MAIN_LoadSettings (VOID)
 
static BOOL MAIN_SaveSettings (VOID)
 
INT WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nCmdShow)
 
static LRESULT CALLBACK MAIN_MainWndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT MAIN_MessageBoxIDS (UINT ids_text, UINT ids_title, WORD type)
 
INT MAIN_MessageBoxIDS_s (UINT ids_text, LPCWSTR str, UINT ids_title, WORD type)
 
VOID MAIN_ReplaceString (LPWSTR *string, LPWSTR replace)
 

Variables

GLOBALS Globals
 

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   1024

Definition at line 55 of file main.c.

◆ WC_MDICLIENT

#define WC_MDICLIENT   WC_MDICLIENTA

Definition at line 42 of file main.c.

◆ WC_MDICLIENTA

#define WC_MDICLIENTA   "MDICLIENT"

Definition at line 36 of file main.c.

◆ WC_MDICLIENTW

#define WC_MDICLIENTW   L"MDICLIENT"

Definition at line 37 of file main.c.

Function Documentation

◆ Alloc()

PVOID Alloc ( IN DWORD  dwFlags,
IN SIZE_T  dwBytes 
)

Definition at line 63 of file main.c.

65 {
66  return HeapAlloc(GetProcessHeap(), dwFlags, dwBytes);
67 }
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175

Referenced by AppendToBuffer(), COMBOEX_Create(), COMBOEX_DrawItem(), COMBOEX_GetText(), COMBOEX_InsertItemA(), COMBOEX_InsertItemW(), COMBOEX_NotifyItem(), COMBOEX_SetItemA(), COMBOEX_SetItemW(), CompareFileName(), create_taskdialog_template(), CreatePropertySheetPageA(), CreatePropertySheetPageW(), DATETIME_Create(), DATETIME_SetFormatA(), DPA_CreateEx(), DrawStatusTextA(), DSA_Create(), Ext2MapExtent(), GetUserAndDomainName(), GROUP_AddGroup(), heap_strdupAtoW(), heap_strdupW(), InitFunctionPtrs(), LISTVIEW_EndEditLabelT(), LISTVIEW_InsertColumnT(), LISTVIEW_InsertItemT(), LISTVIEW_NCCreate(), load_string(), MAIN_LoadSettings(), MAIN_ReplaceString(), MAIN_SetMainWindowTitle(), MakeDragList(), NATIVEFONT_Create(), notify_dispinfoT(), PROGRAM_AddProgram(), PropertySheetA(), PropertySheetW(), PROPSHEET_CollectSheetInfoA(), PROPSHEET_CreateDialog(), PROPSHEET_CreatePage(), PROPSHEET_DialogProc(), PROPSHEET_InsertPage(), PROPSHEET_RemovePage(), PROPSHEET_SetTitleW(), ranges_add(), ranges_clone(), ranges_create(), ranges_del(), REBAR_InsertBandT(), REBAR_NCCreate(), set_sub_item(), SetWindowSubclass(), STATUSBAR_SetParts(), STATUSBAR_SetTextT(), STATUSBAR_WMCreate(), STATUSBAR_WMSetText(), SYSLINK_AppendDocItem(), SYSLINK_ParseText(), SYSLINK_SetItem(), SysLinkWindowProc(), TAB_Create(), TAB_InsertItemT(), taskdialog_add_buttons(), taskdialog_add_control(), textdupTtoW(), TOOLBAR_Cust_AddButton(), TOOLBAR_CustomizeDialogProc(), TOOLBAR_DeleteButton(), TOOLBAR_InsertImageList(), TOOLBAR_NCCreate(), TOOLBAR_Restore(), TOOLBAR_Save(), TOOLBAR_SaveRestoreA(), TOOLBAR_TTGetDispInfo(), TOOLTIPS_AddToolT(), TOOLTIPS_Create(), TOOLTIPS_DelToolT(), TOOLTIPS_SetTitleT(), TOOLTIPS_SetToolInfoT(), TOOLTIPS_UpdateTipTextT(), TRACKBAR_Create(), UDFBuildLongAllocDescs(), UDFBuildShortAllocDescs(), and ValidateEditContents().

◆ AppendToBuffer()

PVOID AppendToBuffer ( IN PVOID  pBuffer,
IN PSIZE_T  pdwBufferSize,
IN PVOID  pData,
IN SIZE_T  dwDataSize 
)

Definition at line 84 of file main.c.

88 {
89  PVOID pTmp;
90  SIZE_T dwBufferSize;
91 
92  dwBufferSize = dwDataSize + *pdwBufferSize;
93 
94  if (pBuffer)
95  pTmp = ReAlloc(0, pBuffer, dwBufferSize);
96  else
97  pTmp = Alloc(0, dwBufferSize);
98 
99  if (!pTmp)
100  return NULL;
101 
102  memcpy((PVOID)((ULONG_PTR)pTmp + *pdwBufferSize), pData, dwDataSize);
103  *pdwBufferSize = dwBufferSize;
104 
105  return pTmp;
106 }
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
PVOID pBuffer
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
Definition: main.c:76
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG_PTR SIZE_T
Definition: typedefs.h:78
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827

◆ Free()

BOOL Free ( IN PVOID  lpMem)

Definition at line 70 of file main.c.

71 {
72  return HeapFree(GetProcessHeap(), 0, lpMem);
73 }
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by GetUserAndDomainName(), MAIN_LoadSettings(), and MAIN_SetMainWindowTitle().

◆ GetUserAndDomainName()

static BOOL GetUserAndDomainName ( OUT LPWSTR UserName,
OUT LPWSTR DomainName 
)
static

Definition at line 183 of file main.c.

185 {
186  BOOL bRet = TRUE;
187  HANDLE hToken;
188  DWORD cbTokenBuffer = 0;
189  PTOKEN_USER pUserToken;
190 
191  LPWSTR lpUserName = NULL;
192  LPWSTR lpDomainName = NULL;
193  DWORD cbUserName = 0;
194  DWORD cbDomainName = 0;
195 
196  SID_NAME_USE SidNameUse;
197 
198  /* Get the process token */
200  return FALSE;
201 
202  /* Retrieve token's information */
203  if (!GetTokenInformation(hToken, TokenUser, NULL, 0, &cbTokenBuffer))
204  {
206  {
207  CloseHandle(hToken);
208  return FALSE;
209  }
210  }
211 
212  pUserToken = Alloc(HEAP_ZERO_MEMORY, cbTokenBuffer);
213  if (!pUserToken)
214  {
215  CloseHandle(hToken);
216  return FALSE;
217  }
218 
219  if (!GetTokenInformation(hToken, TokenUser, pUserToken, cbTokenBuffer, &cbTokenBuffer))
220  {
221  Free(pUserToken);
222  CloseHandle(hToken);
223  return FALSE;
224  }
225 
226  CloseHandle(hToken);
227 
228  /* Retrieve the domain and user name */
229  if (!LookupAccountSidW(NULL,
230  pUserToken->User.Sid,
231  NULL,
232  &cbUserName,
233  NULL,
234  &cbDomainName,
235  &SidNameUse))
236  {
238  {
239  bRet = FALSE;
240  goto done;
241  }
242  }
243 
244  lpUserName = Alloc(HEAP_ZERO_MEMORY, cbUserName * sizeof(WCHAR));
245  if (lpUserName == NULL)
246  {
247  bRet = FALSE;
248  goto done;
249  }
250 
251  lpDomainName = Alloc(HEAP_ZERO_MEMORY, cbDomainName * sizeof(WCHAR));
252  if (lpDomainName == NULL)
253  {
254  bRet = FALSE;
255  goto done;
256  }
257 
258  if (!LookupAccountSidW(NULL,
259  pUserToken->User.Sid,
260  lpUserName,
261  &cbUserName,
262  lpDomainName,
263  &cbDomainName,
264  &SidNameUse))
265  {
266  bRet = FALSE;
267  goto done;
268  }
269 
270  *UserName = lpUserName;
271  *DomainName = lpDomainName;
272 
273 done:
274  if (bRet == FALSE)
275  {
276  if (lpUserName != NULL)
277  Free(lpUserName);
278 
279  if (lpDomainName != NULL)
280  Free(lpDomainName);
281  }
282 
283  Free(pUserToken);
284 
285  return bRet;
286 }
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:406
enum _SID_NAME_USE SID_NAME_USE
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
Definition: misc.c:537
#define TOKEN_QUERY
Definition: setypes.h:874
__wchar_t WCHAR
Definition: xmlstorage.h:180
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL Free(IN PVOID lpMem)
Definition: main.c:70
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
SID_AND_ATTRIBUTES User
Definition: setypes.h:956
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by MAIN_SetMainWindowTitle().

◆ MAIN_AutoStart()

static VOID MAIN_AutoStart ( VOID  )
static

Definition at line 728 of file main.c.

729 {
730  LONG lRet;
731  DWORD dwSize;
732  DWORD dwType;
733 
734  PROGGROUP* hGroup;
735  PROGRAM* hProgram;
736 
738 
739  dwSize = sizeof(buffer);
740  lRet = RegQueryValueExW(Globals.hKeyPMSettings, L"Startup", NULL, &dwType, (LPBYTE)buffer, &dwSize);
741  if (lRet != ERROR_SUCCESS || dwType != REG_SZ)
742  return;
743 
744  for (hGroup = Globals.hGroups; hGroup; hGroup = hGroup->hNext)
745  {
746  if (_wcsicmp(buffer, hGroup->hName) == 0)
747  {
748  for (hProgram = hGroup->hPrograms; hProgram; hProgram = hProgram->hNext)
749  PROGRAM_ExecuteProgram(hProgram);
750  }
751  }
752 }
#define BUFFER_SIZE
Definition: main.c:55
NOTEPAD_GLOBALS Globals
Definition: main.c:29
PROGRAM * hNext
Definition: progman.h:85
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint buffer
Definition: glext.h:5915
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
LPWSTR hName
Definition: progman.h:138
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
Definition: program.c:274
PROGGROUP * hNext
Definition: progman.h:115
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
PROGRAM * hPrograms
Definition: progman.h:139
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define REG_SZ
Definition: layer.c:22

Referenced by wWinMain().

◆ MAIN_CreateMainWindow()

static VOID MAIN_CreateMainWindow ( VOID  )
static

Definition at line 1077 of file main.c.

1078 {
1079  INT left, top, right, bottom;
1080  INT width, height;
1081  INT nCmdShow;
1082  WCHAR buffer[100];
1083 
1084  LONG lRet;
1085  DWORD dwSize;
1086  DWORD dwType;
1087 
1088  Globals.hMDIWnd = NULL;
1089  Globals.hMainMenu = NULL;
1090 
1091  /* Get the geometry of the main window */
1092  dwSize = sizeof(buffer);
1093  lRet = RegQueryValueExW(Globals.hKeyPMSettings, L"Window", NULL, &dwType, (LPBYTE)buffer, &dwSize);
1094  if (lRet != ERROR_SUCCESS || dwType != REG_SZ)
1095  buffer[0] = '\0';
1096 
1097  if (swscanf(buffer, L"%d %d %d %d %d", &left, &top, &right, &bottom, &nCmdShow) == 5)
1098  {
1099  width = right - left;
1100  height = bottom - top;
1101  }
1102  else
1103  {
1104  left = top = width = height = CW_USEDEFAULT;
1105  nCmdShow = SW_SHOWNORMAL;
1106  }
1107 
1108  /* Create the main window */
1109  Globals.hMainWnd =
1111  szTitle,
1112  WS_OVERLAPPEDWINDOW, // /* | WS_CLIPSIBLINGS | WS_CLIPCHILDREN */
1113  left, top, width, height,
1114  NULL, NULL,
1116  NULL);
1117 
1119  ShowWindow(Globals.hMainWnd, nCmdShow);
1121 }
GLint GLint GLsizei width
Definition: gl.h:1546
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define STRING_MAIN_WIN_CLASS_NAME
Definition: progman.h:251
#define ERROR_SUCCESS
Definition: deptool.c:10
WCHAR szTitle[MAX_LOADSTRING]
Definition: main.c:38
BOOL WINAPI UpdateWindow(_In_ HWND)
GLuint buffer
Definition: glext.h:5915
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
int32_t INT
Definition: typedefs.h:56
HINSTANCE hInstance
Definition: main.h:55
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
static VOID MAIN_SetMainWindowTitle(VOID)
Definition: main.c:295
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
GLint GLint bottom
Definition: glext.h:7726
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
static const WCHAR L[]
Definition: oid.c:1250
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
HWND hMainWnd
Definition: main.h:56
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define REG_SZ
Definition: layer.c:22

Referenced by wWinMain().

◆ MAIN_CreateMDIWindow()

static VOID MAIN_CreateMDIWindow ( VOID  )
static

Definition at line 1128 of file main.c.

1129 {
1130  CLIENTCREATESTRUCT ccs;
1131  RECT rect;
1132 
1133  /* Get the geometry of the MDI window */
1135 
1136  ccs.hWindowMenu = Globals.hWindowsMenu;
1138 
1139  /* Create MDI Window */
1140  Globals.hMDIWnd =
1142  rect.left, rect.top,
1143  rect.right - rect.left, rect.bottom - rect.top,
1144  Globals.hMainWnd, 0,
1145  Globals.hInstance, &ccs);
1146 
1147  /* Reset the background of the MDI client window (default: COLOR_APPWORKSPACE + 1) */
1149 
1150  ShowWindow(Globals.hMDIWnd, SW_SHOW);
1151  UpdateWindow(Globals.hMDIWnd);
1152 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
BOOL WINAPI UpdateWindow(_In_ HWND)
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define COLOR_WINDOW
Definition: winuser.h:908
& rect
Definition: startmenu.cpp:1413
HINSTANCE hInstance
Definition: main.h:55
#define GCLP_HBRBACKGROUND
Definition: winuser.h:667
smooth NULL
Definition: ftsmooth.c:416
#define WC_MDICLIENT
Definition: main.c:42
#define SetClassLongPtrW
Definition: winuser.h:5240
#define SW_SHOW
Definition: winuser.h:769
#define PM_FIRST_CHILD
Definition: resource.h:94
#define WS_HSCROLL
Definition: pedump.c:628
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_VSCROLL
Definition: pedump.c:627
HWND hMainWnd
Definition: main.h:56

Referenced by wWinMain().

◆ MAIN_LoadGroups()

static VOID MAIN_LoadGroups ( VOID  )
static

Definition at line 719 of file main.c.

720 {
721 }

Referenced by wWinMain().

◆ MAIN_LoadSettings()

static BOOL MAIN_LoadSettings ( VOID  )
static

Definition at line 332 of file main.c.

333 {
334  LPWSTR lpszTmp;
335  LPWSTR lpszSection;
336  LONG lRet;
337  WCHAR dummy[2];
338  LPWSTR lpszKeyValue;
339  const LPCWSTR lpszIniFile = L"progman.ini";
340  WCHAR szWinDir[MAX_PATH];
341  LPWSTR lpszKey;
342  DWORD Value;
343  HKEY hKey;
344  BOOL bIsIniMigrated;
345  DWORD dwSize;
346  LPWSTR lpszSections;
347  LPWSTR lpszData;
348  DWORD dwRet;
349  DWORD dwType;
350  LPWSTR lpszValue;
351 
352  bIsIniMigrated = FALSE;
353  lpszSections = NULL;
354  lpszData = NULL;
355 
356  /* Try to create/open the Program Manager user key */
358  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Program Manager",
359  0,
360  NULL,
363  NULL,
364  &Globals.hKeyProgMan,
365  NULL) != ERROR_SUCCESS)
366  {
367  return FALSE;
368  }
369 
370  /*
371  * TODO: Add the explanation for the migration...
372  */
373  dwSize = sizeof(Value);
374  lRet = RegQueryValueExW(Globals.hKeyProgMan, L"IniMigrated", NULL, &dwType, (LPBYTE)&Value, &dwSize);
375  if (lRet != ERROR_SUCCESS || dwType != REG_DWORD)
376  Value = 0;
377  bIsIniMigrated = !!Value;
378 
379  if (bIsIniMigrated)
380  {
381  /* The migration was already done, just load the settings */
382  goto LoadSettings;
383  }
384 
385  /* Perform the migration */
386 
387  bIsIniMigrated = TRUE;
389  SetLastError(0);
390  GetPrivateProfileSectionW(L"Settings", dummy, dwSize, lpszIniFile);
392  goto MigrationDone;
393 
394  SetLastError(0);
395  GetPrivateProfileSectionW(L"Groups", dummy, dwSize, lpszIniFile);
397  goto MigrationDone;
398 
399  GetWindowsDirectoryW(szWinDir, ARRAYSIZE(szWinDir));
400  // NOTE: GCC complains we cannot use the "\u2022" (UNICODE Code Point) notation for specifying the bullet character,
401  // because it's only available in C++ or in C99. On the contrary MSVC is fine with it.
402  // Instead we use a hex specification for the character: "\x2022".
403  // Note also that the character "\x07" gives also a bullet, but a larger one.
404  PrintString(
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"
408  L"\n\n"
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"
410  L"\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"
412  L"\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"
414  L"\n"
415  L"Would you like to migrate its contents into the registry?",
416  szWinDir);
417 
418  for (dwSize = BUFFER_SIZE; ; dwSize += BUFFER_SIZE)
419  {
420  lpszSections = Alloc(0, dwSize * sizeof(WCHAR));
421  dwRet = GetPrivateProfileSectionNamesW(lpszSections, dwSize, lpszIniFile);
422  if (dwRet < dwSize - 2)
423  break;
424  Free(lpszSections);
425  }
426  lpszSection = lpszSections;
427  while (*lpszSection)
428  {
429  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
430  lpszSection,
431  0,
432  NULL,
434  KEY_WRITE,
435  NULL,
436  &hKey,
437  NULL);
438  if (lRet == ERROR_SUCCESS)
439  {
440  for (dwSize = BUFFER_SIZE; ; dwSize += BUFFER_SIZE)
441  {
442  lpszData = Alloc(0, dwSize * sizeof(WCHAR));
443  dwRet = GetPrivateProfileSectionW(lpszSection, lpszData, dwSize, lpszIniFile);
444  if (dwRet < dwSize - 2)
445  break;
446  Free(lpszData);
447  }
448  lpszKeyValue = lpszData;
449  while (*lpszKeyValue)
450  {
451  lpszKey = lpszKeyValue;
452  lpszValue = wcschr(lpszKeyValue, L'=');
453  lpszKeyValue += (wcslen(lpszKeyValue) + 1);
454  if (lpszValue)
455  {
456  *lpszValue = '\0';
457  ++lpszValue;
458  Value = wcstoul(lpszValue, &lpszTmp, 0);
459  if (lpszTmp - lpszValue >= wcslen(lpszValue))
460  {
461  lpszValue = (LPWSTR)&Value;
462  dwSize = sizeof(Value);
463  dwType = REG_DWORD;
464  }
465  else
466  {
467  dwSize = wcslen(lpszValue) * sizeof(WCHAR);
468  dwType = REG_SZ;
469  }
470  }
471  else
472  {
473  dwSize = 0;
474  dwType = REG_DWORD;
475  }
476  lRet = RegSetValueExW(hKey, lpszKey, 0, dwType, (LPBYTE)lpszValue, dwSize);
477  }
478  Free(lpszData);
479  RegCloseKey(hKey);
480  lpszSection += (wcslen(lpszSection) + 1);
481  }
482  }
483  Free(lpszSections);
484 
485 MigrationDone:
486  Value = TRUE;
487  RegSetValueExW(Globals.hKeyProgMan, L"IniMigrated", 0, REG_DWORD, (LPBYTE)&Value, sizeof(Value));
488 
489 
491  /* Create the necessary registry keys for the Program Manager and load its settings from the registry */
492 
493  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
494  L"Settings",
495  0,
496  NULL,
499  NULL,
500  &Globals.hKeyPMSettings,
501  NULL);
502 
503  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
504  L"Common Groups",
505  0,
506  NULL,
509  NULL,
510  &Globals.hKeyPMCommonGroups,
511  NULL);
512 
513  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
514  L"Groups",
515  0,
516  NULL,
519  NULL,
520  &Globals.hKeyPMAnsiGroups,
521  NULL);
522 
523  lRet = RegCreateKeyExW(Globals.hKeyProgMan,
524  L"UNICODE Groups",
525  0,
526  NULL,
529  NULL,
530  &Globals.hKeyPMUnicodeGroups,
531  NULL);
532 
534  L"Program Groups",
535  0,
536  NULL,
539  NULL,
540  &Globals.hKeyAnsiGroups,
541  NULL);
542 
544  L"UNICODE Program Groups",
545  0,
546  NULL,
549  NULL,
550  &Globals.hKeyUnicodeGroups,
551  NULL);
552 
554  L"SOFTWARE\\Program Groups",
555  0,
556  NULL,
559  NULL,
560  &Globals.hKeyCommonGroups,
561  NULL);
562 
563  dwSize = sizeof(Globals.bAutoArrange);
564  RegQueryValueExW(Globals.hKeyPMSettings, L"AutoArrange", NULL, &dwType, (LPBYTE)&Globals.bAutoArrange, &dwSize);
565 
566  dwSize = sizeof(Globals.bMinOnRun);
567  RegQueryValueExW(Globals.hKeyPMSettings, L"MinOnRun", NULL, &dwType, (LPBYTE)&Globals.bMinOnRun, &dwSize);
568 
569  dwSize = sizeof(Globals.bSaveSettings);
570  RegQueryValueExW(Globals.hKeyPMSettings, L"SaveSettings", NULL, &dwType, (LPBYTE)&Globals.bSaveSettings, &dwSize);
571 
572  return TRUE;
573 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define TRUE
Definition: types.h:120
#define BUFFER_SIZE
Definition: main.c:55
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
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)
Definition: reg.c:1091
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2351
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
void LoadSettings(void)
Definition: settings.c:53
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
VOID PrintString(IN LPCWSTR szStr,...)
Definition: main.c:124
DWORD WINAPI GetPrivateProfileSectionNamesW(LPWSTR buffer, DWORD size, LPCWSTR filename)
Definition: profile.c:1641
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:417
static const WCHAR L[]
Definition: oid.c:1250
BOOL Free(IN PVOID lpMem)
Definition: main.c:70
WCHAR * LPWSTR
Definition: xmlstorage.h:184
INT WINAPI GetPrivateProfileSectionW(LPCWSTR section, LPWSTR buffer, DWORD len, LPCWSTR filename)
Definition: profile.c:1351
#define REG_DWORD
Definition: sdbapi.c:596
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by wWinMain().

◆ MAIN_MainWndProc()

static LRESULT CALLBACK MAIN_MainWndProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 759 of file main.c.

760 {
761  switch (uMsg)
762  {
763  case WM_INITMENU:
764  {
765  PROGGROUP* hActiveGroup = GROUP_ActiveGroup();
766  if (hActiveGroup)
767  {
768  if (PROGRAM_ActiveProgram(hActiveGroup))
769  {
775  }
776  else
777  {
778  if (!hActiveGroup->hWnd || IsIconic(hActiveGroup->hWnd))
780  else
782 
787  }
788  }
789  else
790  {
796  }
797 
799  MF_BYCOMMAND | (Globals.bAutoArrange ? MF_CHECKED : MF_UNCHECKED));
800  CheckMenuItem(Globals.hOptionMenu, PM_MIN_ON_RUN,
801  MF_BYCOMMAND | (Globals.bMinOnRun ? MF_CHECKED : MF_UNCHECKED));
803  MF_BYCOMMAND | (Globals.bSaveSettings ? MF_CHECKED : MF_UNCHECKED));
804  break;
805  }
806 
807  case WM_DESTROY:
808  if (Globals.bSaveSettings)
810  PostQuitMessage(0);
811  break;
812 
813  case WM_COMMAND:
816  break;
817  }
818 
819  return DefFrameProcW(hWnd, Globals.hMDIWnd, uMsg, wParam, lParam);
820 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
PROGRAM * PROGRAM_ActiveProgram(PROGGROUP *hGroup)
Definition: program.c:331
#define MF_BYCOMMAND
Definition: winuser.h:202
#define PM_MOVE
Definition: resource.h:79
HWND hWnd
Definition: settings.c:17
HWND hWnd
Definition: progman.h:116
#define PM_SAVE_SETTINGS
Definition: resource.h:88
BOOL WINAPI IsIconic(_In_ HWND)
WPARAM wParam
Definition: combotst.c:138
PROGGROUP * GROUP_ActiveGroup(VOID)
Definition: group.c:671
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define PM_DELETE
Definition: resource.h:81
#define WM_DESTROY
Definition: winuser.h:1591
#define PM_FIRST_CHILD
Definition: resource.h:94
#define MF_CHECKED
Definition: winuser.h:132
#define MF_ENABLED
Definition: winuser.h:128
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
static VOID MAIN_MenuCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: main.c:828
#define WM_COMMAND
Definition: winuser.h:1722
#define MF_UNCHECKED
Definition: winuser.h:204
#define PM_OPEN
Definition: resource.h:78
#define PM_AUTO_ARRANGE
Definition: resource.h:86
#define WM_INITMENU
Definition: winuser.h:1727
static BOOL MAIN_SaveSettings(VOID)
Definition: main.c:577
#define PM_MIN_ON_RUN
Definition: resource.h:87
#define PM_ATTRIBUTES
Definition: resource.h:82
#define PM_COPY
Definition: resource.h:80
#define MF_GRAYED
Definition: winuser.h:129
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
LRESULT WINAPI DefFrameProcW(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by MAIN_RegisterMainWinClass().

◆ MAIN_MenuCommand()

static VOID MAIN_MenuCommand ( HWND  hWnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 828 of file main.c.

829 {
830 #if 0
831  HLOCAL hActiveGroup = GROUP_ActiveGroup();
832  HLOCAL hActiveProgram = PROGRAM_ActiveProgram(hActiveGroup);
833  HWND hActiveGroupWnd = GROUP_GroupWnd(hActiveGroup);
834 
835  switch(wParam)
836  {
837  /* Menu File */
838  case PM_NEW:
839  switch (DIALOG_New((hActiveGroupWnd && !IsIconic(hActiveGroupWnd)) ?
841  {
842  case PM_NEW_PROGRAM:
843  if (hActiveGroup) PROGRAM_NewProgram(hActiveGroup);
844  break;
845 
846  case PM_NEW_GROUP:
847  GROUP_NewGroup();
848  break;
849  }
850  break;
851 
852 
853  case PM_DELETE:
854  if (hActiveProgram)
855  {
856  if (DIALOG_Delete(IDS_DELETE_PROGRAM_s, PROGRAM_ProgramName(hActiveProgram)))
857  PROGRAM_DeleteProgram(hActiveProgram, TRUE);
858  }
859  else if (hActiveGroup)
860  {
861  if (DIALOG_Delete(IDS_DELETE_GROUP_s, GROUP_GroupName(hActiveGroup)))
862  GROUP_DeleteGroup(hActiveGroup);
863  }
864  break;
865 
866 
867 
868  case PM_SAVE_SETTINGS:
869  Globals.bSaveSettings = !Globals.bSaveSettings;
871  MF_BYCOMMAND | (Globals.bSaveSettings ?
873  WritePrivateProfileStringA("Settings", "SaveSettings",
874  Globals.bSaveSettings ? "1" : "0",
875  Globals.lpszIniFile);
876  WritePrivateProfileStringA(NULL,NULL,NULL,Globals.lpszIniFile); /* flush it */
877  break;
878 
879 
880  case PM_ARRANGE:
881 
882  if (hActiveGroupWnd && !IsIconic(hActiveGroupWnd))
883  ArrangeIconicWindows(hActiveGroupWnd);
884  else
885  SendMessageW(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0);
886  break;
887 
888  }
889 
890 
891 
892 
893 #endif
894 
895  DWORD Value;
896 
897  PROGGROUP* hActiveGroup;
898  PROGRAM* hActiveProgram;
899  HWND hActiveGroupWnd;
900 
901  hActiveGroup = GROUP_ActiveGroup();
902  hActiveProgram = PROGRAM_ActiveProgram(hActiveGroup);
903  hActiveGroupWnd = (hActiveGroup ? hActiveGroup->hWnd : NULL);
904 
905  switch (wParam)
906  {
907  /* Menu File */
908 
909  case PM_NEW:
910  {
911  BOOL Success;
912  INT nResult;
913 
914  if (!hActiveGroupWnd || IsIconic(hActiveGroupWnd))
915  Success = DIALOG_New(PM_NEW_GROUP, &nResult);
916  else
917  Success = DIALOG_New(PM_NEW_PROGRAM, &nResult);
918  if (!Success)
919  break;
920 
921  if (nResult & 1)
922  {
924  BOOL bIsCommonGroup;
925 
926  format = (nResult & 0xC) >> 2;
927  bIsCommonGroup = (nResult & 2) != 0;
928  GROUP_NewGroup(format, bIsCommonGroup);
929  }
930  else if (hActiveGroup)
931  {
932  PROGRAM_NewProgram(hActiveGroup);
933  }
934 
935  break;
936  }
937 
938  case PM_OPEN:
939  if (hActiveProgram)
940  PROGRAM_ExecuteProgram(hActiveProgram);
941  else if (hActiveGroupWnd)
942  OpenIcon(hActiveGroupWnd);
943  break;
944 
945  case PM_MOVE:
946  case PM_COPY:
947  if (hActiveProgram)
948  PROGRAM_CopyMoveProgram(hActiveProgram, wParam == PM_MOVE);
949  break;
950 
951  case PM_DELETE:
952  {
953  if (hActiveProgram)
954  {
955  if (DIALOG_Delete(IDS_DELETE_PROGRAM_s, hActiveProgram->hName))
956  PROGRAM_DeleteProgram(hActiveProgram, TRUE);
957  }
958  else if (hActiveGroup && DIALOG_Delete(IDS_DELETE_GROUP_s, hActiveGroup->hName))
959  {
960  GROUP_DeleteGroup(hActiveGroup);
961  }
962  break;
963  }
964 
965  case PM_ATTRIBUTES:
966  if (hActiveProgram)
967  PROGRAM_ModifyProgram(hActiveProgram);
968  else if (hActiveGroup)
969  GROUP_ModifyGroup(hActiveGroup);
970  break;
971 
972  case PM_EXECUTE:
973  DIALOG_Execute();
974  break;
975 
976  case PM_EXIT:
977  // MAIN_SaveSettings();
978  PostQuitMessage(0);
979  break;
980 
981 
982  /* Menu Options */
983 
984  case PM_AUTO_ARRANGE:
985  Globals.bAutoArrange = !Globals.bAutoArrange;
987  MF_BYCOMMAND | (Globals.bAutoArrange ? MF_CHECKED : MF_UNCHECKED));
988  Value = Globals.bAutoArrange;
989  RegSetValueExW(Globals.hKeyPMSettings, L"AutoArrange", 0, REG_DWORD, (LPBYTE)&Value, sizeof(Value));
990  break;
991 
992  case PM_MIN_ON_RUN:
993  Globals.bMinOnRun = !Globals.bMinOnRun;
994  CheckMenuItem(Globals.hOptionMenu, PM_MIN_ON_RUN,
995  MF_BYCOMMAND | (Globals.bMinOnRun ? MF_CHECKED : MF_UNCHECKED));
996  Value = Globals.bMinOnRun;
997  RegSetValueExW(Globals.hKeyPMSettings, L"MinOnRun", 0, REG_DWORD, (LPBYTE)&Value, sizeof(Value));
998  break;
999 
1000  case PM_SAVE_SETTINGS:
1001  Globals.bSaveSettings = !Globals.bSaveSettings;
1002  CheckMenuItem(Globals.hOptionMenu, PM_SAVE_SETTINGS,
1003  MF_BYCOMMAND | (Globals.bSaveSettings ? MF_CHECKED : MF_UNCHECKED));
1004  Value = Globals.bSaveSettings;
1005  RegSetValueExW(Globals.hKeyPMSettings, L"SaveSettings", 0, REG_DWORD, (LPBYTE)&Value, sizeof(Value));
1006  break;
1007 
1008  case PM_SAVE_SETTINGS_NOW:
1010  break;
1011 
1012 
1013  /* Menu Windows */
1014 
1015  case PM_OVERLAP:
1016  SendMessageW(Globals.hMDIWnd, WM_MDICASCADE, 0, 0);
1017  break;
1018 
1019  case PM_SIDE_BY_SIDE:
1021  break;
1022 
1023  case PM_ARRANGE:
1024  if (!hActiveGroupWnd || IsIconic(hActiveGroupWnd))
1025  SendMessageW(Globals.hMDIWnd, WM_MDIICONARRANGE, 0, 0);
1026  else
1027  SendMessageA(hActiveGroup->hListView, LVM_ARRANGE, 0, 0);
1028  break;
1029 
1030 
1031  /* Menu Help */
1032 
1033  case PM_CONTENTS:
1034  if (!WinHelpW(Globals.hMainWnd, L"progman.hlp", HELP_CONTENTS, 0))
1036  break;
1037 
1038  case PM_ABOUT:
1039  ShellAboutW(hWnd, szTitle, NULL, Globals.hMainIcon);
1040  break;
1041 
1042  default:
1044  break;
1045  }
1046 
1047 }
VOID DIALOG_Execute(VOID)
Definition: dialog.c:1021
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define TRUE
Definition: types.h:120
NOTEPAD_GLOBALS Globals
Definition: main.c:29
VOID PROGRAM_CopyMoveProgram(PROGRAM *hProgram, BOOL bMove)
Definition: program.c:236
#define HELP_CONTENTS
Definition: winuser.h:2380
PROGRAM * PROGRAM_ActiveProgram(PROGGROUP *hGroup)
Definition: program.c:331
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL DIALOG_Delete(UINT ids_text_s, LPCWSTR lpszName)
Definition: dialog.c:361
#define PM_EXECUTE
Definition: resource.h:83
#define PM_SIDE_BY_SIDE
Definition: resource.h:92
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define PM_MOVE
Definition: resource.h:79
#define IDS_NOT_IMPLEMENTED
Definition: resource.h:59
#define WM_MDICASCADE
Definition: winuser.h:1801
UINT WINAPI ArrangeIconicWindows(_In_ HWND)
WCHAR szTitle[MAX_LOADSTRING]
Definition: main.c:38
HWND hWnd
Definition: settings.c:17
HWND hWnd
Definition: progman.h:116
#define PM_OVERLAP
Definition: resource.h:91
#define PM_SAVE_SETTINGS
Definition: resource.h:88
#define PM_SAVE_SETTINGS_NOW
Definition: resource.h:89
BOOL WINAPI IsIconic(_In_ HWND)
VOID PROGRAM_DeleteProgram(PROGRAM *hProgram, BOOL bUpdateGrpFile)
Definition: program.c:289
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
#define PM_EXIT
Definition: resource.h:84
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
PROGGROUP * GROUP_ActiveGroup(VOID)
Definition: group.c:671
#define WM_MDIICONARRANGE
Definition: winuser.h:1802
unsigned char * LPBYTE
Definition: typedefs.h:52
enum _GROUPFORMAT GROUPFORMAT
unsigned int BOOL
Definition: ntddk_ex.h:94
#define PM_ARRANGE
Definition: resource.h:93
#define PM_DELETE
Definition: resource.h:81
LPWSTR hName
Definition: progman.h:138
VOID PROGRAM_ExecuteProgram(PROGRAM *hProgram)
Definition: program.c:274
#define IDS_WINHELP_ERROR
Definition: resource.h:64
smooth NULL
Definition: ftsmooth.c:416
#define PM_NEW_PROGRAM
Definition: resource.h:118
#define MF_CHECKED
Definition: winuser.h:132
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
#define IDS_DELETE_PROGRAM_s
Definition: resource.h:56
#define MDITILE_VERTICAL
Definition: winuser.h:2164
BOOL WINAPI OpenIcon(_In_ HWND)
#define PM_ABOUT
Definition: resource.h:102
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
VOID GROUP_ModifyGroup(PROGGROUP *hGroup)
Definition: group.c:596
#define LVM_ARRANGE
Definition: commctrl.h:2528
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
BOOL DIALOG_New(INT nDefault, PINT pnResult)
Definition: dialog.c:233
#define PM_CONTENTS
Definition: resource.h:101
#define MF_UNCHECKED
Definition: winuser.h:204
#define PM_OPEN
Definition: resource.h:78
#define PM_AUTO_ARRANGE
Definition: resource.h:86
#define PM_NEW_GROUP
Definition: resource.h:117
#define IDS_DELETE_GROUP_s
Definition: resource.h:55
VOID GROUP_DeleteGroup(PROGGROUP *hGroup)
Definition: group.c:627
static BOOL MAIN_SaveSettings(VOID)
Definition: main.c:577
HWND hListView
Definition: progman.h:118
LPWSTR hName
Definition: progman.h:93
VOID GROUP_NewGroup(GROUPFORMAT format, BOOL bIsCommonGroup)
Definition: group.c:392
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define PM_NEW
Definition: main.h:36
VOID PROGRAM_ModifyProgram(PROGRAM *hProgram)
Definition: program.c:116
#define MB_OK
Definition: winuser.h:784
#define PM_MIN_ON_RUN
Definition: resource.h:87
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
#define IDS_ERROR
Definition: resource.h:18
#define PM_ATTRIBUTES
Definition: resource.h:82
#define PM_COPY
Definition: resource.h:80
VOID PROGRAM_NewProgram(PROGGROUP *hGroup)
Definition: program.c:80
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
Definition: profile.c:1484
#define REG_DWORD
Definition: sdbapi.c:596
HWND hMainWnd
Definition: main.h:56
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_MDITILE
Definition: winuser.h:1800
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by MAIN_MainWndProc().

◆ MAIN_MessageBoxIDS()

INT MAIN_MessageBoxIDS ( UINT  ids_text,
UINT  ids_title,
WORD  type 
)

Definition at line 1159 of file main.c.

1160 {
1163 
1164  LoadStringW(Globals.hInstance, ids_text , text , ARRAYSIZE(text));
1166 
1168 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
const WCHAR * text
Definition: package.c:1827
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: main.h:55
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_STRING_LEN
Definition: main.c:73
HWND hMainWnd
Definition: main.h:56
static char title[]
Definition: ps.c:92

Referenced by DIALOG_COPY_MOVE_DlgProc(), DIALOG_EXECUTE_DlgProc(), DIALOG_GROUP_DlgProc(), DIALOG_NEW_DlgProc(), DIALOG_PROGRAM_DlgProc(), DIALOG_SYMBOL_DlgProc(), GROUP_AddGroup(), MAIN_MenuCommand(), MAIN_ReplaceString(), and PROGRAM_AddProgram().

◆ MAIN_MessageBoxIDS_s()

INT MAIN_MessageBoxIDS_s ( UINT  ids_text,
LPCWSTR  str,
UINT  ids_title,
WORD  type 
)

Definition at line 1174 of file main.c.

1175 {
1179 
1180  LoadStringW(Globals.hInstance, ids_text , text , ARRAYSIZE(text));
1182  wsprintfW(newtext, text, str);
1183 
1184  return MessageBoxW(Globals.hMainWnd, newtext, title, type);
1185 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
NOTEPAD_GLOBALS Globals
Definition: main.c:29
const WCHAR * text
Definition: package.c:1827
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: main.h:55
const WCHAR * str
#define MAX_PATHNAME_LEN
Definition: progman.h:54
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_STRING_LEN
Definition: main.c:73
HWND hMainWnd
Definition: main.h:56
static char title[]
Definition: ps.c:92

Referenced by DIALOG_Delete(), GRPFILE_ReadGroupFile(), and GRPFILE_WriteGroupFile().

◆ MAIN_RegisterMainWinClass()

static ATOM MAIN_RegisterMainWinClass ( VOID  )
static

Definition at line 1054 of file main.c.

1055 {
1056  WNDCLASSW wndClass;
1057 
1058  wndClass.style = CS_HREDRAW | CS_VREDRAW;
1059  wndClass.lpfnWndProc = MAIN_MainWndProc;
1060  wndClass.cbClsExtra = 0;
1061  wndClass.cbWndExtra = 0;
1062  wndClass.hInstance = Globals.hInstance;
1063  wndClass.hIcon = Globals.hMainIcon;
1065  wndClass.hbrBackground = (HBRUSH)GetStockObject(NULL_BRUSH);
1066  wndClass.lpszMenuName = NULL;
1068 
1069  return RegisterClassW(&wndClass);
1070 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define STRING_MAIN_WIN_CLASS_NAME
Definition: progman.h:251
UINT style
Definition: winuser.h:3151
LPCWSTR lpszMenuName
Definition: winuser.h:3159
#define NULL_BRUSH
Definition: wingdi.h:900
#define CS_HREDRAW
Definition: winuser.h:648
int cbClsExtra
Definition: winuser.h:3153
HINSTANCE hInstance
Definition: main.h:55
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WNDPROC lpfnWndProc
Definition: winuser.h:3152
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3160
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3154
HICON hIcon
Definition: winuser.h:3156
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
HCURSOR hCursor
Definition: winuser.h:3157
HBRUSH hbrBackground
Definition: winuser.h:3158
HINSTANCE hInstance
Definition: winuser.h:3155
#define IDC_ARROW
Definition: winuser.h:682
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static LRESULT CALLBACK MAIN_MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: main.c:759

Referenced by wWinMain().

◆ MAIN_ReplaceString()

VOID MAIN_ReplaceString ( LPWSTR string,
LPWSTR  replace 
)

Definition at line 1192 of file main.c.

1193 {
1194  LPWSTR newstring;
1195 
1196  newstring = Alloc(HEAP_ZERO_MEMORY, (wcslen(replace) + 1) * sizeof(WCHAR));
1197  if (newstring)
1198  {
1199  wcscpy(newstring, replace);
1200  *string = newstring;
1201  }
1202  else
1203  {
1205  }
1206 }
#define IDS_OUT_OF_MEMORY
Definition: resource.h:63
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define IDS_ERROR
Definition: resource.h:18
WCHAR * LPWSTR
Definition: xmlstorage.h:184
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
INT MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type)
Definition: main.c:1159

Referenced by GROUP_ModifyGroup(), and PROGRAM_ModifyProgram().

◆ MAIN_SaveSettings()

static BOOL MAIN_SaveSettings ( VOID  )
static

Definition at line 577 of file main.c.

578 {
579  WINDOWPLACEMENT WndPl;
580  DWORD dwSize;
581  WCHAR buffer[100];
582 
583  WndPl.length = sizeof(WndPl);
585  StringCbPrintfW(buffer, sizeof(buffer),
586  L"%d %d %d %d %d",
587  WndPl.rcNormalPosition.left,
588  WndPl.rcNormalPosition.top,
589  WndPl.rcNormalPosition.right,
590  WndPl.rcNormalPosition.bottom,
591  WndPl.showCmd);
592 
593  dwSize = wcslen(buffer) * sizeof(WCHAR);
594  RegSetValueExW(Globals.hKeyPMSettings, L"Window", 0, REG_SZ, (LPBYTE)buffer, dwSize);
595 
596  return TRUE;
597 }
#define TRUE
Definition: types.h:120
NOTEPAD_GLOBALS Globals
Definition: main.c:29
LONG top
Definition: windef.h:307
GLuint buffer
Definition: glext.h:5915
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
unsigned char * LPBYTE
Definition: typedefs.h:52
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
RECT rcNormalPosition
Definition: winuser.h:3270
LONG bottom
Definition: windef.h:309
HWND hMainWnd
Definition: main.h:56
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define REG_SZ
Definition: layer.c:22

Referenced by MAIN_MainWndProc(), and MAIN_MenuCommand().

◆ MAIN_SetMainWindowTitle()

static VOID MAIN_SetMainWindowTitle ( VOID  )
static

Definition at line 295 of file main.c.

296 {
297  LPWSTR caption;
298  SIZE_T size;
299 
300  LPWSTR lpDomainName = NULL;
301  LPWSTR lpUserName = NULL;
302 
303  if (GetUserAndDomainName(&lpUserName, &lpDomainName) && lpUserName && lpDomainName)
304  {
305  size = (256 + 3 + wcslen(lpDomainName) + wcslen(lpUserName) + 1) * sizeof(WCHAR);
306  caption = Alloc(HEAP_ZERO_MEMORY, size);
307  if (caption)
308  {
309  StringCbPrintfW(caption, size, L"%s - %s\\%s", szTitle, lpDomainName, lpUserName);
310  SetWindowTextW(Globals.hMainWnd, caption);
311  Free(caption);
312  }
313  else
314  {
316  }
317  }
318  else
319  {
321  }
322 
323  if (lpUserName) Free(lpUserName);
324  if (lpDomainName) Free(lpDomainName);
325 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
static BOOL GetUserAndDomainName(OUT LPWSTR *UserName, OUT LPWSTR *DomainName)
Definition: main.c:183
WCHAR szTitle[MAX_LOADSTRING]
Definition: main.c:38
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
static const WCHAR L[]
Definition: oid.c:1250
BOOL Free(IN PVOID lpMem)
Definition: main.c:70
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hMainWnd
Definition: main.h:56
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by MAIN_CreateMainWindow().

◆ PrintResourceString()

VOID PrintResourceString ( IN UINT  uID,
  ... 
)

Definition at line 134 of file main.c.

135 {
136  WCHAR Buffer[4096];
137  va_list args;
138 
139  va_start(args, uID);
142  va_end(args);
143 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
Definition: match.c:390
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HINSTANCE hInstance
Definition: main.h:55
#define va_end(ap)
Definition: acmsvcex.h:90
VOID PrintStringV(IN LPCWSTR szStr, IN va_list args)
Definition: main.c:114
char * va_list
Definition: acmsvcex.h:78
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
char * args[]
Definition: main.c:34
#define va_start(ap, A)
Definition: acmsvcex.h:91

◆ PrintString()

VOID PrintString ( IN LPCWSTR  szStr,
  ... 
)

Definition at line 124 of file main.c.

125 {
126  va_list args;
127 
128  va_start(args, szStr);
129  PrintStringV(szStr, args);
130  va_end(args);
131 }
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
VOID PrintStringV(IN LPCWSTR szStr, IN va_list args)
Definition: main.c:114
char * va_list
Definition: acmsvcex.h:78
char * args[]
Definition: main.c:34
#define va_start(ap, A)
Definition: acmsvcex.h:91

Referenced by MAIN_LoadSettings(), and PrintWin32Error().

◆ PrintStringV()

VOID PrintStringV ( IN LPCWSTR  szStr,
IN va_list  args 
)

Definition at line 114 of file main.c.

116 {
117  WCHAR Buffer[4096];
118 
120  MessageBoxW(Globals.hMainWnd, Buffer, L"Information", MB_OK);
121 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
Definition: match.c:390
Definition: bufpool.h:45
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
#define MB_OK
Definition: winuser.h:784
HWND hMainWnd
Definition: main.h:56

Referenced by PrintResourceString(), and PrintString().

◆ PrintWin32Error()

VOID PrintWin32Error ( IN LPWSTR  Message,
IN DWORD  ErrorCode 
)

Definition at line 146 of file main.c.

147 {
148  LPWSTR lpMsgBuf;
149 
152  (LPWSTR)&lpMsgBuf, 0, NULL);
153 
154  PrintString(L"%s: %s\n", Message, lpMsgBuf);
155  LocalFree(lpMsgBuf);
156 }
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
#define LANG_NEUTRAL
Definition: nls.h:22
#define SUBLANG_DEFAULT
Definition: nls.h:168
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
VOID PrintString(IN LPCWSTR szStr,...)
Definition: main.c:124
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
CHAR Message[80]
Definition: alive.c:5
static const WCHAR L[]
Definition: oid.c:1250
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MAKELANGID(p, s)
Definition: nls.h:15
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DisplayEntryPoint(), and main().

◆ ReAlloc()

PVOID ReAlloc ( IN DWORD  dwFlags,
IN PVOID  lpMem,
IN SIZE_T  dwBytes 
)

Definition at line 76 of file main.c.

79 {
80  return HeapReAlloc(GetProcessHeap(), dwFlags, lpMem, dwBytes);
81 }
#define GetProcessHeap()
Definition: compat.h:403
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define HeapReAlloc
Definition: compat.h:401

Referenced by AppendToBuffer(), DSA_DeleteItem(), DSA_InsertItem(), DSA_SetItem(), InitFunctionPtrs(), Str_SetPtrA(), Str_SetPtrW(), SYSLINK_Render(), TOOLBAR_AddBitmap(), TOOLBAR_AddStringA(), TOOLBAR_AddStringW(), TOOLBAR_InternalInsertButtonsT(), TRACKBAR_RecalculateTics(), and TRACKBAR_SetTic().

◆ ShowLastWin32Error()

int ShowLastWin32Error ( VOID  )

Definition at line 158 of file main.c.

159 {
160  DWORD dwError;
161  LPWSTR lpMsgBuf = NULL;
162  WCHAR Buffer[4096];
163 
164  dwError = GetLastError();
165 
168  (LPWSTR)&lpMsgBuf, 0, NULL);
169  _snwprintf(Buffer, ARRAYSIZE(Buffer), L"Error %d: %s\n", dwError, lpMsgBuf);
170  LocalFree(lpMsgBuf);
171  return MessageBoxW(Globals.hMainWnd, Buffer, L"Error", MB_OK);
172 }
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define LANG_NEUTRAL
Definition: nls.h:22
#define SUBLANG_DEFAULT
Definition: nls.h:168
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MB_OK
Definition: winuser.h:784
#define MAKELANGID(p, s)
Definition: nls.h:15
WCHAR * LPWSTR
Definition: xmlstorage.h:184
HWND hMainWnd
Definition: main.h:56

◆ wWinMain()

INT WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPWSTR  lpCmdLine,
INT  nCmdShow 
)

Definition at line 605 of file main.c.

606 {
607  MSG msg;
609 
610  /*
611  * Set our shutdown parameters: we want to shutdown the very last,
612  * but before any TaskMgr instance (which has a shutdown level of 1).
613  */
615 
617  Globals.hGroups = NULL;
618  Globals.hActiveGroup = NULL;
619 
620  /* Load Program Manager's settings */
622 
623  /* Load the default icons */
628 
629  /* Initialize the common controls */
630  icex.dwSize = sizeof(icex);
631  icex.dwICC = ICC_HOTKEY_CLASS | ICC_LISTVIEW_CLASSES; // | ICC_STANDARD_CLASSES;
632  InitCommonControlsEx(&icex);
633 
634  /* Register the window classes */
635  if (!hPrevInstance) // FIXME: Unused on Win32!
636  {
637  if (!MAIN_RegisterMainWinClass()) goto Quit;
638  if (!GROUP_RegisterGroupWinClass()) goto Quit;
639  }
640 
641  /* Set up the strings, the main window, the accelerators, the menu, and the MDI child window */
647 
648  /* Load all the groups */
649  // MAIN_CreateGroups();
650  MAIN_LoadGroups();
651 
652  /* Load the Startup group: start the initial applications */
653  MAIN_AutoStart();
654 
655  /* Message loop */
656  while (GetMessageW(&msg, NULL, 0, 0))
657  {
658  if (!TranslateMDISysAccel(Globals.hMDIWnd, &msg) &&
660  {
663  }
664  }
665 
666 Quit:
667 
668  /* Save the settings, close the registry keys and quit */
669 
670  // MAIN_SaveSettings();
671  RegCloseKey(Globals.hKeyCommonGroups);
672  RegCloseKey(Globals.hKeyUnicodeGroups);
673  RegCloseKey(Globals.hKeyAnsiGroups);
674  RegCloseKey(Globals.hKeyPMUnicodeGroups);
675  RegCloseKey(Globals.hKeyPMAnsiGroups);
676  RegCloseKey(Globals.hKeyPMCommonGroups);
677  RegCloseKey(Globals.hKeyPMSettings);
678  RegCloseKey(Globals.hKeyProgMan);
679 
680  return 0;
681 }
#define IDI_GROUP_COMMON_ICON
Definition: resource.h:41
#define IDA_ACCEL
Definition: resource.h:47
BOOL WINAPI TranslateMessage(_In_ const MSG *)
ATOM GROUP_RegisterGroupWinClass(VOID)
Definition: group.c:369
NOTEPAD_GLOBALS Globals
Definition: main.c:29
static VOID MAIN_LoadGroups(VOID)
Definition: main.c:719
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static VOID MAIN_CreateMDIWindow(VOID)
Definition: main.c:1128
VOID STRING_LoadMenus(VOID)
Definition: string.c:41
#define ICC_HOTKEY_CLASS
Definition: commctrl.h:64
static ATOM MAIN_RegisterMainWinClass(VOID)
Definition: main.c:1054
VOID STRING_LoadStrings(VOID)
Definition: string.c:36
HINSTANCE hInstance
Definition: main.h:55
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
Definition: proc.c:949
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
static BOOL MAIN_LoadSettings(VOID)
Definition: main.c:332
#define IDI_WINLOGO
Definition: winuser.h:704
HINSTANCE hInstance
Definition: main.c:36
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define IDI_GROUP_PERSONAL_ICON
Definition: resource.h:40
#define IDI_APPICON
Definition: resource.h:166
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define msg(x)
Definition: auth_time.c:54
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
static VOID MAIN_CreateMainWindow(VOID)
Definition: main.c:1077
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HWND hMainWnd
Definition: main.h:56
static VOID MAIN_AutoStart(VOID)
Definition: main.c:728
BOOL WINAPI TranslateMDISysAccel(_In_ HWND, _In_ LPMSG)

Variable Documentation

◆ Globals

GLOBALS Globals

Definition at line 45 of file main.c.