ReactOS  0.4.14-dev-49-gfb4591c
welcome.c
Go to the documentation of this file.
1 /*
2  * ReactOS applications
3  * Copyright (C) 2001, 2002, 2003 ReactOS Team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 /*
20  * COPYRIGHT: See COPYING in the top level directory
21  * PROJECT: ReactOS "Welcome"/AutoRun application
22  * FILE: base/setup/welcome/welcome.c
23  * PROGRAMMERS: Eric Kohl
24  * Casper S. Hornstrup (chorns@users.sourceforge.net)
25  * Hermes Belusca-Maito
26  *
27  * NOTE:
28  * This utility can be customized by using localized INI configuration files.
29  * The default strings are stored in the utility's resources.
30  */
31 
32 #include <stdarg.h>
33 #include <tchar.h>
34 
35 #include <windef.h>
36 #include <winbase.h>
37 #include <wingdi.h>
38 #include <winnls.h>
39 #include <winuser.h>
40 #include <shellapi.h>
41 #include <strsafe.h>
42 
43 #include <reactos/buildno.h>
44 
45 #include "resource.h"
46 
47 #define LIGHT_BLUE RGB(214, 239, 247)
48 #define DARK_BLUE RGB(107, 123, 140)
49 
50 #define TITLE_WIDTH 480
51 #define TITLE_HEIGHT 93
52 
53 /* GLOBALS ******************************************************************/
54 
55 TCHAR szWindowClass[] = TEXT("WelcomeWindowClass");
57 
59 
61 
64 
67 
68 #define BUFFER_SIZE 1024
69 
70 #define TOPIC_TITLE_LENGTH 80
71 #define TOPIC_DESC_LENGTH 1024
72 
73 typedef struct _TOPIC
74 {
77 
78  /*
79  * TRUE : szCommand contains a command (e.g. executable to run);
80  * FALSE: szCommand contains a custom "Welcome"/AutoRun action.
81  */
83 
88  TCHAR szArgs[512];
89 } TOPIC, *PTOPIC;
90 
93 
95 
98 
99 #define TOPIC_BTN_ID_BASE 100
100 
101 INT nTopic = -1; // Active (focused) topic
102 INT nDefaultTopic = -1; // Default selected topic
103 
107 
112 
114 HBRUSH hbrDarkBlue;
115 
119 
120 
123 
124 
125 /* FUNCTIONS ****************************************************************/
126 
127 INT GetLocaleName(IN LCID Locale, OUT LPTSTR lpLCData, IN SIZE_T cchData)
128 {
129  INT cchRet, cchRet2;
130 
131  /* Try to retrieve the locale language name (LOCALE_SNAME is supported on Vista+) */
132  cchRet = GetLocaleInfo(Locale, LOCALE_SNAME, lpLCData, cchData);
133  if (cchRet || (GetLastError() != ERROR_INVALID_FLAGS))
134  return cchRet;
135 
136  /*
137  * We failed because LOCALE_SNAME was unrecognized, so try to manually build
138  * a language name in the form xx-YY (WARNING: this method has its limitations).
139  */
140  cchRet = GetLocaleInfo(Locale, LOCALE_SISO639LANGNAME, lpLCData, cchData);
141  if (cchRet <= 1)
142  return cchRet;
143 
144  lpLCData += (cchRet - 1);
145  cchData -= (cchRet - 1);
146  if (cchData <= 1)
147  return cchRet;
148 
149  /* Try to get the second part; we add the '-' separator only if we succeed */
150  cchRet2 = GetLocaleInfo(Locale, LOCALE_SISO3166CTRYNAME, lpLCData + 1, cchData - 1);
151  if (cchRet2 <= 1)
152  return cchRet;
153  cchRet += cchRet2; // 'cchRet' already counts '-'.
154 
155  *lpLCData = _T('-');
156 
157  return cchRet;
158 }
159 
161 {
162  LPTSTR pEscape = NULL; // Next backslash escape sequence.
163 
164  while (lpString && *lpString)
165  {
166  /* Find the next backslash escape sequence */
167  pEscape = _tcschr(lpString, _T('\\'));
168  if (!pEscape)
169  break;
170 
171  /* Go past the escape backslash */
172  lpString = pEscape + 1;
173 
174  /* Find which sequence it is */
175  switch (*lpString)
176  {
177  case _T('\0'):
178  // *pEscape = _T('\0'); // Enable if one wants to convert <NULL> into <NULL>.
179  // lpString = pEscape + 1; // Loop will stop at the next iteration.
180  break;
181 
182  /* New-line and carriage return */
183  case _T('n'): case _T('r'):
184  // case _T('\\'): // others?
185  // So far we only need to deal with the newlines.
186  {
187  if (*lpString == _T('n'))
188  *pEscape = _T('\n');
189  else if (*lpString == _T('r'))
190  *pEscape = _T('\r');
191 
192  memmove(lpString, lpString + 1, (_tcslen(lpString + 1) + 1) * sizeof(TCHAR));
193  break;
194  }
195 
196  /* \xhhhh hexadecimal character specification */
197  case _T('x'):
198  {
199  LPTSTR lpStringNew;
200  *pEscape = (WCHAR)_tcstoul(lpString + 1, &lpStringNew, 16);
201  memmove(lpString, lpStringNew, (_tcslen(lpStringNew) + 1) * sizeof(TCHAR));
202  break;
203  }
204 
205  /* Unknown escape sequence, ignore it */
206  default:
207  lpString++;
208  break;
209  }
210  }
211 }
212 
213 /*
214  * Expands the path for the ReactOS Installer "reactos.exe".
215  * See also base/system/userinit/userinit.c!StartInstaller()
216  */
217 BOOL
219  IN LPCTSTR lpInstallerName,
220  OUT LPTSTR lpInstallerPath,
221  IN SIZE_T PathSize)
222 {
223  SYSTEM_INFO SystemInfo;
224  SIZE_T cchInstallerNameLen;
225  PTSTR ptr;
226  DWORD dwAttribs;
227 
228  cchInstallerNameLen = _tcslen(lpInstallerName);
229  if (PathSize < cchInstallerNameLen)
230  {
231  /* The buffer is not large enough to contain the installer file name */
232  *lpInstallerPath = 0;
233  return FALSE;
234  }
235 
236  /*
237  * First, try to find the installer using the default drive, under
238  * the directory whose name corresponds to the currently-running
239  * CPU architecture.
240  */
241  GetSystemInfo(&SystemInfo);
242 
243  *lpInstallerPath = 0;
244  GetModuleFileName(NULL, lpInstallerPath, PathSize - cchInstallerNameLen - 1);
245  ptr = _tcschr(lpInstallerPath, _T('\\'));
246  if (ptr)
247  *++ptr = 0;
248  else
249  *lpInstallerPath = 0;
250 
251  /* Append the corresponding CPU architecture */
252  switch (SystemInfo.wProcessorArchitecture)
253  {
255  StringCchCat(lpInstallerPath, PathSize, TEXT("I386"));
256  break;
257 
259  StringCchCat(lpInstallerPath, PathSize, TEXT("MIPS"));
260  break;
261 
263  StringCchCat(lpInstallerPath, PathSize, TEXT("ALPHA"));
264  break;
265 
267  StringCchCat(lpInstallerPath, PathSize, TEXT("PPC"));
268  break;
269 
271  StringCchCat(lpInstallerPath, PathSize, TEXT("SHX"));
272  break;
273 
275  StringCchCat(lpInstallerPath, PathSize, TEXT("ARM"));
276  break;
277 
279  StringCchCat(lpInstallerPath, PathSize, TEXT("IA64"));
280  break;
281 
283  StringCchCat(lpInstallerPath, PathSize, TEXT("ALPHA64"));
284  break;
285 
287  StringCchCat(lpInstallerPath, PathSize, TEXT("AMD64"));
288  break;
289 
290  // case PROCESSOR_ARCHITECTURE_MSIL: /* .NET CPU-independent code */
292  default:
294  break;
295  }
296 
298  StringCchCat(lpInstallerPath, PathSize, TEXT("\\"));
299  StringCchCat(lpInstallerPath, PathSize, lpInstallerName);
300 
301  dwAttribs = GetFileAttributes(lpInstallerPath);
302  if ((dwAttribs != INVALID_FILE_ATTRIBUTES) &&
303  !(dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
304  {
305  /* We have found the installer */
306  return TRUE;
307  }
308 
309  /*
310  * We failed. Try to find the installer from either the current
311  * ReactOS installation directory, or from our current directory.
312  */
313  *lpInstallerPath = 0;
314  if (GetWindowsDirectory(lpInstallerPath, PathSize - cchInstallerNameLen - 1))
315  StringCchCat(lpInstallerPath, PathSize, TEXT("\\"));
316  StringCchCat(lpInstallerPath, PathSize, lpInstallerName);
317 
318  dwAttribs = GetFileAttributes(lpInstallerPath);
319  if ((dwAttribs != INVALID_FILE_ATTRIBUTES) &&
320  !(dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
321  {
322  /* We have found the installer */
323  return TRUE;
324  }
325 
326  /* Installer not found */
327  *lpInstallerPath = 0;
328  return FALSE;
329 }
330 
332 {
333  dwNumberTopics = 0;
334  pTopics = NULL;
335 }
336 
338 {
339  PTOPIC pTopic, *pTopicsTmp;
340 
341  /* Allocate (or reallocate) the list of topics */
342  if (!pTopics)
343  pTopicsTmp = HeapAlloc(GetProcessHeap(), 0, (dwNumberTopics + 1) * sizeof(*pTopics));
344  else
345  pTopicsTmp = HeapReAlloc(GetProcessHeap(), 0, pTopics, (dwNumberTopics + 1) * sizeof(*pTopics));
346  if (!pTopicsTmp)
347  return NULL; // Cannot reallocate more
348  pTopics = pTopicsTmp;
349 
350  /* Allocate a new topic entry */
351  pTopic = HeapAlloc(GetProcessHeap(), 0, sizeof(*pTopic));
352  if (!pTopic)
353  return NULL; // Cannot reallocate more
354  pTopics[dwNumberTopics++] = pTopic;
355 
356  /* Return the allocated topic entry */
357  return pTopic;
358 }
359 
360 PTOPIC
364  IN LPTSTR szDesc OPTIONAL,
365  IN LPTSTR szCommand OPTIONAL,
366  IN LPTSTR szArgs OPTIONAL,
367  IN LPTSTR szAction OPTIONAL)
368 {
369  PTOPIC pTopic = AddNewTopic();
370  if (!pTopic)
371  return NULL;
372 
373  if (szText && *szText)
374  StringCchCopy(pTopic->szText, ARRAYSIZE(pTopic->szText), szText);
375  else
376  *pTopic->szText = 0;
377 
378  if (szTitle && *szTitle)
379  StringCchCopy(pTopic->szTitle, ARRAYSIZE(pTopic->szTitle), szTitle);
380  else
381  *pTopic->szTitle = 0;
382 
383  if (szDesc && *szDesc)
384  {
385  StringCchCopy(pTopic->szDesc, ARRAYSIZE(pTopic->szDesc), szDesc);
386  TranslateEscapes(pTopic->szDesc);
387  }
388  else
389  {
390  *pTopic->szDesc = 0;
391  }
392 
393  if (szCommand && *szCommand)
394  {
395  pTopic->bIsCommand = TRUE;
396 
397  /* Check for special applications: ReactOS Installer */
398  if (_tcsicmp(szCommand, TEXT("reactos.exe")) == 0)
399  {
400  ExpandInstallerPath(szCommand, pTopic->szCommand, ARRAYSIZE(pTopic->szCommand));
401  }
402  else
403  {
404  /* Expand any environment string in the command line */
405  DWORD dwSize = ExpandEnvironmentStringsW(szCommand, NULL, 0);
406  if (dwSize <= ARRAYSIZE(pTopic->szCommand))
407  ExpandEnvironmentStringsW(szCommand, pTopic->szCommand, ARRAYSIZE(pTopic->szCommand));
408  else
409  StringCchCopy(pTopic->szCommand, ARRAYSIZE(pTopic->szCommand), szCommand);
410  }
411  }
412  else
413  {
414  pTopic->bIsCommand = FALSE;
415  *pTopic->szCommand = 0;
416  }
417 
418  /* Only care about command arguments if we actually have a command */
419  if (*pTopic->szCommand)
420  {
421  if (szArgs && *szArgs)
422  {
423  StringCchCopy(pTopic->szArgs, ARRAYSIZE(pTopic->szArgs), szArgs);
424  }
425  else
426  {
427  /* Check for special applications: ReactOS Shell */
428  if (/* pTopic->szCommand && */ *pTopic->szCommand &&
429  _tcsicmp(pTopic->szCommand, TEXT("explorer.exe")) == 0)
430  {
431 #if 0
432  TCHAR CurrentDir[MAX_PATH];
433  GetCurrentDirectory(ARRAYSIZE(CurrentDir), CurrentDir);
434 #endif
435  StringCchCopy(pTopic->szArgs, ARRAYSIZE(pTopic->szArgs), TEXT("\\"));
436  }
437  else
438  {
439  *pTopic->szArgs = 0;
440  }
441  }
442  }
443  else
444  {
445  *pTopic->szArgs = 0;
446  }
447 
448  /* Only care about custom actions if we actually don't have a command */
449  if (!*pTopic->szCommand && szAction && *szAction)
450  {
451  /*
452  * Re-use the pTopic->szCommand member. We distinguish with respect to
453  * a regular command by using the pTopic->bIsCommand flag.
454  */
455  pTopic->bIsCommand = FALSE;
456  StringCchCopy(pTopic->szCommand, ARRAYSIZE(pTopic->szCommand), szAction);
457  TranslateEscapes(pTopic->szCommand);
458  }
459 
460  return pTopic;
461 }
462 
463 static VOID
465 {
466 #define MAX_NUMBER_INTERNAL_TOPICS 3
467 
468  UINT i;
469  LPTSTR lpszCommand, lpszAction;
470  TOPIC newTopic, *pTopic;
471 
472  for (i = 0; i < MAX_NUMBER_INTERNAL_TOPICS; ++i)
473  {
474  lpszCommand = NULL, lpszAction = NULL;
475 
476  /* Retrieve the information */
477  if (!LoadString(hInstance, IDS_TOPIC_BUTTON0 + i, newTopic.szText, ARRAYSIZE(newTopic.szText)))
478  *newTopic.szText = 0;
479  if (!LoadString(hInstance, IDS_TOPIC_TITLE0 + i, newTopic.szTitle, ARRAYSIZE(newTopic.szTitle)))
480  *newTopic.szTitle = 0;
481  if (!LoadString(hInstance, IDS_TOPIC_DESC0 + i, newTopic.szDesc, ARRAYSIZE(newTopic.szDesc)))
482  *newTopic.szDesc = 0;
483 
484  if (!LoadString(hInstance, IDS_TOPIC_COMMAND0 + i, newTopic.szCommand, ARRAYSIZE(newTopic.szCommand)))
485  *newTopic.szCommand = 0;
486 
487  /* Only care about command arguments if we actually have a command */
488  if (*newTopic.szCommand)
489  {
490  lpszCommand = newTopic.szCommand;
491  if (!LoadString(hInstance, IDS_TOPIC_CMD_ARGS0 + i, newTopic.szArgs, ARRAYSIZE(newTopic.szArgs)))
492  *newTopic.szArgs = 0;
493  }
494  /* Only care about custom actions if we actually don't have a command */
495  else // if (!*newTopic.szCommand)
496  {
497  lpszAction = newTopic.szCommand;
498  if (!LoadString(hInstance, IDS_TOPIC_ACTION0 + i, newTopic.szCommand, ARRAYSIZE(newTopic.szCommand)))
499  *newTopic.szCommand = 0;
500  }
501 
502  /* Allocate a new topic */
503  pTopic = AddNewTopicEx(newTopic.szText,
504  newTopic.szTitle,
505  newTopic.szDesc,
506  lpszCommand,
507  newTopic.szArgs,
508  lpszAction);
509  if (!pTopic)
510  break; // Cannot reallocate more
511  }
512 }
513 
514 static BOOL
516 {
517  DWORD dwRet;
518  DWORD dwAttribs;
519  DWORD dwSize;
520  TCHAR szBuffer[LOCALE_NAME_MAX_LENGTH];
521  TCHAR szIniPath[MAX_PATH];
522  LPTSTR lpszSections = NULL, lpszSection = NULL;
523  LPTSTR lpszCommand, lpszAction;
524  TOPIC newTopic, *pTopic;
525 
526  /* Retrieve the locale name (on which the INI file name is based) */
527  dwRet = (DWORD)GetLocaleName(Locale, szBuffer, ARRAYSIZE(szBuffer));
528  if (!dwRet)
529  {
530  /* Fall back to english (US) */
531  StringCchCopy(szBuffer, ARRAYSIZE(szBuffer), TEXT("en-US"));
532  }
533 
534  /* Build the INI file name */
535  StringCchPrintf(szIniPath, ARRAYSIZE(szIniPath),
536  TEXT("%s\\%s.ini"), lpResPath, szBuffer);
537 
538  /* Verify that the file exists, otherwise fall back to english (US) */
539  dwAttribs = GetFileAttributes(szIniPath);
540  if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
541  (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
542  {
543  StringCchCopy(szBuffer, ARRAYSIZE(szBuffer), TEXT("en-US"));
544 
545  StringCchPrintf(szIniPath, ARRAYSIZE(szIniPath),
546  TEXT("%s\\%s.ini"), lpResPath, szBuffer);
547  }
548 
549  /* Verify that the file exists, otherwise fall back to internal (localized) resource */
550  dwAttribs = GetFileAttributes(szIniPath);
551  if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
552  (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
553  {
554  return FALSE; // For localized resources, see the general function.
555  }
556 
557  /* Try to load the default localized strings */
558  GetPrivateProfileString(TEXT("Defaults"), TEXT("AppTitle"), TEXT("ReactOS - Welcome") /* default */,
559  szAppTitle, ARRAYSIZE(szAppTitle), szIniPath);
560  GetPrivateProfileString(TEXT("Defaults"), TEXT("DefaultTopicTitle"), TEXT("") /* default */,
562  if (!GetPrivateProfileString(TEXT("Defaults"), TEXT("DefaultTopicDescription"), TEXT("") /* default */,
563  szDefaultDesc, ARRAYSIZE(szDefaultDesc), szIniPath))
564  {
565  *szDefaultDesc = 0;
566  }
567  else
568  {
570  }
571 
572  /* Allocate a buffer big enough to hold all the section names */
573  for (dwSize = BUFFER_SIZE; ; dwSize += BUFFER_SIZE)
574  {
575  lpszSections = HeapAlloc(GetProcessHeap(), 0, dwSize * sizeof(TCHAR));
576  if (!lpszSections)
577  return TRUE; // FIXME!
578  dwRet = GetPrivateProfileSectionNames(lpszSections, dwSize, szIniPath);
579  if (dwRet < dwSize - 2)
580  break;
581  HeapFree(GetProcessHeap(), 0, lpszSections);
582  }
583 
584  /* Loop over the sections and load the topics */
585  lpszSection = lpszSections;
586  for (; lpszSection && *lpszSection; lpszSection += (_tcslen(lpszSection) + 1))
587  {
588  /* Ignore everything that is not a topic */
589  if (_tcsnicmp(lpszSection, TEXT("Topic"), 5) != 0)
590  continue;
591 
592  lpszCommand = NULL, lpszAction = NULL;
593 
594  /* Retrieve the information */
595  GetPrivateProfileString(lpszSection, TEXT("MenuText"), TEXT("") /* default */,
596  newTopic.szText, ARRAYSIZE(newTopic.szText), szIniPath);
597  GetPrivateProfileString(lpszSection, TEXT("Title"), TEXT("") /* default */,
598  newTopic.szTitle, ARRAYSIZE(newTopic.szTitle), szIniPath);
599  GetPrivateProfileString(lpszSection, TEXT("Description"), TEXT("") /* default */,
600  newTopic.szDesc, ARRAYSIZE(newTopic.szDesc), szIniPath);
601 
602  GetPrivateProfileString(lpszSection, TEXT("ConfigCommand"), TEXT("") /* default */,
603  newTopic.szCommand, ARRAYSIZE(newTopic.szCommand), szIniPath);
604 
605  /* Only care about command arguments if we actually have a command */
606  if (*newTopic.szCommand)
607  {
608  lpszCommand = newTopic.szCommand;
609  GetPrivateProfileString(lpszSection, TEXT("ConfigArgs"), TEXT("") /* default */,
610  newTopic.szArgs, ARRAYSIZE(newTopic.szArgs), szIniPath);
611  }
612  /* Only care about custom actions if we actually don't have a command */
613  else // if (!*newTopic.szCommand)
614  {
615  lpszAction = newTopic.szCommand;
616  GetPrivateProfileString(lpszSection, TEXT("Action"), TEXT("") /* default */,
617  newTopic.szCommand, ARRAYSIZE(newTopic.szCommand), szIniPath);
618  }
619 
620  /* Allocate a new topic */
621  pTopic = AddNewTopicEx(newTopic.szText,
622  newTopic.szTitle,
623  newTopic.szDesc,
624  lpszCommand,
625  newTopic.szArgs,
626  lpszAction);
627  if (!pTopic)
628  break; // Cannot reallocate more
629  }
630 
631  HeapFree(GetProcessHeap(), 0, lpszSections);
632 
633  return TRUE;
634 }
635 
636 static VOID
638 {
639  DWORD dwAttribs;
640  BOOL bLoadDefaultResources;
641  TCHAR szAppPath[MAX_PATH];
642  TCHAR szIniPath[MAX_PATH];
643  TCHAR szResPath[MAX_PATH];
644 
645  /* Initialize the topic list */
647 
648  /*
649  * First, try to load the default internal (localized) strings.
650  * They can be redefined by the localized INI files.
651  */
653  StringCchCopy(szAppTitle, ARRAYSIZE(szAppTitle), TEXT("ReactOS - Welcome"));
655  *szDefaultTitle = 0;
657  *szDefaultDesc = 0;
658 
659  /* Retrieve the full path to this application */
660  GetModuleFileName(NULL, szAppPath, ARRAYSIZE(szAppPath));
661  if (*szAppPath)
662  {
663  LPTSTR lpFileName = _tcsrchr(szAppPath, _T('\\'));
664  if (lpFileName)
665  *lpFileName = 0;
666  else
667  *szAppPath = 0;
668  }
669 
670  /* Build the full INI file path name */
671  StringCchPrintf(szIniPath, ARRAYSIZE(szIniPath), TEXT("%s\\welcome.ini"), szAppPath);
672 
673  /* Verify that the file exists, otherwise use the default configuration */
674  dwAttribs = GetFileAttributes(szIniPath);
675  if ((dwAttribs == INVALID_FILE_ATTRIBUTES) ||
676  (dwAttribs & FILE_ATTRIBUTE_DIRECTORY))
677  {
678  /* Use the default internal (localized) resources */
680  return;
681  }
682 
683  /* Load the settings from the INI configuration file */
684  bDisplayCheckBox = !!GetPrivateProfileInt(TEXT("Welcome"), TEXT("DisplayCheckBox"), FALSE /* default */, szIniPath);
685  bDisplayExitBtn = !!GetPrivateProfileInt(TEXT("Welcome"), TEXT("DisplayExitButton"), TRUE /* default */, szIniPath);
686 
687  /* Load the default internal (localized) resources if needed */
688  bLoadDefaultResources = !!GetPrivateProfileInt(TEXT("Welcome"), TEXT("LoadDefaultResources"), FALSE /* default */, szIniPath);
689  if (bLoadDefaultResources)
691 
692  GetPrivateProfileString(TEXT("Welcome"), TEXT("ResourceDir"), TEXT("") /* default */,
693  szResPath, ARRAYSIZE(szResPath), szIniPath);
694 
695  /* Set the current directory to the one of this application, and retrieve the resources */
696  SetCurrentDirectory(szAppPath);
698  {
699  /*
700  * Loading localized resources from INI file failed, try to load the
701  * internal resources only if they were not already loaded earlier.
702  */
703  if (!bLoadDefaultResources)
705  }
706 }
707 
708 static VOID
710 {
711  if (!pTopics)
712  return;
713 
714  while (dwNumberTopics--)
715  {
716  if (pTopics[dwNumberTopics])
718  }
720  pTopics = NULL;
721  dwNumberTopics = 0;
722 }
723 
724 #if 0
725 static VOID
727 {
728  LPTSTR lpMessageBuffer = NULL;
729  DWORD dwError = GetLastError();
730 
731  if (dwError == ERROR_SUCCESS)
732  return;
733 
737  NULL,
738  dwError,
740  (LPTSTR)&lpMessageBuffer,
741  0, NULL))
742  {
743  return;
744  }
745 
746  MessageBox(hWnd, lpMessageBuffer, szAppTitle, MB_OK | MB_ICONERROR);
747  LocalFree(lpMessageBuffer);
748 }
749 #endif
750 
751 int WINAPI
753  HINSTANCE hPrevInstance,
754  LPTSTR lpszCmdLine,
755  int nCmdShow)
756 {
757  HANDLE hMutex = NULL;
758  WNDCLASSEX wndclass;
759  MSG msg;
760  HWND hWndFocus;
761  INT xPos, yPos;
762  INT xWidth, yHeight;
763  RECT rcWindow;
764  HICON hMainIcon;
765  HMENU hSystemMenu;
768 
769  BITMAP BitmapInfo;
770  ULONG ulInnerWidth = TITLE_WIDTH;
771  ULONG ulInnerHeight = (TITLE_WIDTH * 3) / 4;
772  ULONG ulTitleHeight = TITLE_HEIGHT + 3;
773 
774  UNREFERENCED_PARAMETER(hPrevInstance);
775  UNREFERENCED_PARAMETER(lpszCmdLine);
776 
777  /* Ensure only one instance is running */
780  {
781  /* If already started, find its window */
783 
784  /* Activate window */
787 
788  /* Close the mutex handle and quit */
790  return 0;
791  }
792 
793 #if 0
794  /* Mirroring is enabled from within the resources */
795  switch (GetUserDefaultUILanguage())
796  {
799  break;
800 
801  default:
802  break;
803  }
804 #endif
805 
806  hInstance = hInst;
807 
808  /* Load icons */
810 
811  /* Register the window class */
812  wndclass.cbSize = sizeof(wndclass);
813  wndclass.style = CS_HREDRAW | CS_VREDRAW;
814  wndclass.lpfnWndProc = (WNDPROC)MainWndProc;
815  wndclass.cbClsExtra = 0;
816  wndclass.cbWndExtra = 0;
817  wndclass.hInstance = hInstance;
818  wndclass.hIcon = hMainIcon;
819  wndclass.hIconSm = NULL;
820  wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
821  wndclass.hbrBackground = NULL;
822  wndclass.lpszMenuName = NULL;
823  wndclass.lpszClassName = szWindowClass;
824 
825  RegisterClassEx(&wndclass);
826 
827  /* Load the banner bitmap, and compute the window dimensions */
829  if (hTitleBitmap)
830  {
831  GetObject(hTitleBitmap, sizeof(BitmapInfo), &BitmapInfo);
832  ulInnerWidth = BitmapInfo.bmWidth;
833  ulInnerHeight = (ulInnerWidth * 3) / 4;
834  ulTitleHeight = BitmapInfo.bmHeight + 3;
836  }
837  ulInnerHeight -= GetSystemMetrics(SM_CYCAPTION);
838 
839  rcWindow.top = 0;
840  rcWindow.bottom = ulInnerHeight - 1;
841  rcWindow.left = 0;
842  rcWindow.right = ulInnerWidth - 1;
843 
844  AdjustWindowRect(&rcWindow, dwStyle, FALSE);
845  xWidth = rcWindow.right - rcWindow.left;
846  yHeight = rcWindow.bottom - rcWindow.top;
847 
848  /* Compute the window position */
849  xPos = (GetSystemMetrics(SM_CXSCREEN) - xWidth) / 2;
850  yPos = (GetSystemMetrics(SM_CYSCREEN) - yHeight) / 2;
851 
852  rcTitlePanel.top = 0;
853  rcTitlePanel.bottom = ulTitleHeight;
854  rcTitlePanel.left = 0;
855  rcTitlePanel.right = ulInnerWidth - 1;
856 
858  rcLeftPanel.bottom = ulInnerHeight - 1;
859  rcLeftPanel.left = 0;
860  rcLeftPanel.right = ulInnerWidth / 3;
861 
865  rcRightPanel.right = ulInnerWidth - 1;
866 
867  /* Load the configuration and the resources */
869 
870  /* Create main window */
872  szAppTitle,
873  dwStyle,
874  xPos,
875  yPos,
876  xWidth,
877  yHeight,
878  0,
879  0,
880  hInstance,
881  NULL);
882 
883  hSystemMenu = GetSystemMenu(hWndMain, FALSE);
884  if (hSystemMenu)
885  {
886  RemoveMenu(hSystemMenu, SC_SIZE, MF_BYCOMMAND);
887  RemoveMenu(hSystemMenu, SC_MAXIMIZE, MF_BYCOMMAND);
888  }
889 
890  ShowWindow(hWndMain, nCmdShow);
892 
893  while (GetMessage(&msg, NULL, 0, 0) != FALSE)
894  {
895  /* Check for ENTER key presses */
896  if (msg.message == WM_KEYDOWN && msg.wParam == VK_RETURN)
897  {
898  /*
899  * The user pressed the ENTER key. Retrieve the handle to the
900  * child window that has the keyboard focus, and send it a
901  * WM_COMMAND message.
902  */
903  hWndFocus = GetFocus();
904  if (hWndFocus)
905  {
907  (WPARAM)GetDlgCtrlID(hWndFocus), (LPARAM)hWndFocus);
908  }
909  }
910  /* Allow using keyboard navigation */
911  else if (!IsDialogMessage(hWndMain, &msg))
912  {
915  }
916  }
917 
918  /* Cleanup */
919  FreeResources();
920 
921  /* Close the mutex handle and quit */
923  return msg.wParam;
924 }
925 
926 
929 {
930  static WPARAM wParamOld = 0;
931  static LPARAM lParamOld = 0;
932 
933  LONG i;
934 
935  if (uMsg == WM_MOUSEMOVE)
936  {
937  /* Ignore mouse-move messages on the same point */
938  if ((wParam == wParamOld) && (lParam == lParamOld))
939  return 0;
940 
941  /* Retrieve the topic index of this button */
943 
944  /*
945  * Change the focus to this button if the current topic index differs
946  * (we will receive WM_SETFOCUS afterwards).
947  */
948  if (nTopic != i)
949  SetFocus(hWnd);
950 
951  wParamOld = wParam;
952  lParamOld = lParam;
953  }
954  else if (uMsg == WM_SETFOCUS)
955  {
956  /* Retrieve the topic index of this button */
958 
959  /* Change the current topic index and repaint the description panel */
960  if (nTopic != i)
961  {
962  nTopic = i;
964  }
965  }
966  else if (uMsg == WM_KILLFOCUS)
967  {
968  /*
969  * We lost focus, either because the user changed button focus,
970  * or because the main window to which we belong went inactivated.
971  * If we are in the latter case, we ignore the focus change.
972  * If we are in the former case, we reset to the default topic.
973  */
975  {
976  nTopic = -1;
978  }
979  }
980 
981  return CallWindowProc(fnOldBtn, hWnd, uMsg, wParam, lParam);
982 }
983 
984 
985 static BOOL
987 {
988  PCWSTR Command = NULL, Args = NULL;
989 
990  if (nTopic < 0)
991  return TRUE;
992 
994  if (/* !Command && */ !*Command)
995  return TRUE;
996 
997  /* Check for known actions */
998  if (!pTopics[nTopic]->bIsCommand)
999  {
1000  if (!_tcsicmp(Command, TEXT("<exit>")))
1001  return FALSE;
1002 
1003  if (!_tcsnicmp(Command, TEXT("<msg>"), 5))
1004  {
1005  MessageBox(hWndMain, Command + 5, TEXT("ReactOS"), MB_OK | MB_TASKMODAL);
1006  return TRUE;
1007  }
1008  }
1009  else
1010  /* Run the command */
1011  {
1012  Args = pTopics[nTopic]->szArgs;
1013  if (!*Args) Args = NULL;
1015  Command, Args,
1016  NULL, SW_SHOWDEFAULT);
1017  }
1018 
1019  return TRUE;
1020 }
1021 
1022 
1023 static DWORD
1025  HFONT hFont,
1026  LPCTSTR szText,
1027  DWORD dwWidth)
1028 {
1029  HFONT hOldFont;
1030  RECT rect;
1031 
1032  rect.left = 0;
1033  rect.right = dwWidth - 20;
1034  rect.top = 0;
1035  rect.bottom = 25;
1036 
1037  hOldFont = (HFONT)SelectObject(hDC, hFont);
1039  SelectObject(hDC, hOldFont);
1040 
1041  return (rect.bottom-rect.top + 14);
1042 }
1043 
1044 
1045 static LRESULT
1047 {
1048  UINT i;
1049  INT nLength;
1050  HDC ScreenDC;
1051  LOGFONT lf;
1052  DWORD dwTop;
1053  DWORD dwHeight = 0;
1054  TCHAR szText[80];
1055 
1058 
1061 
1062  ZeroMemory(&lf, sizeof(lf));
1063 
1064  lf.lfEscapement = 0;
1065  lf.lfOrientation = 0; // TA_BASELINE;
1066  // lf.lfItalic = lf.lfUnderline = lf.lfStrikeOut = FALSE;
1067  lf.lfCharSet = ANSI_CHARSET;
1073  StringCchCopy(lf.lfFaceName, ARRAYSIZE(lf.lfFaceName), TEXT("Tahoma"));
1074 
1075  /* Topic title font */
1076  lf.lfHeight = -18;
1077  lf.lfWidth = 0;
1078  lf.lfWeight = FW_NORMAL;
1080 
1081  /* Topic description font */
1082  lf.lfHeight = -11;
1083  lf.lfWidth = 0;
1084  lf.lfWeight = FW_THIN;
1086 
1087  /* Topic button font */
1088  lf.lfHeight = -11;
1089  lf.lfWidth = 0;
1090  lf.lfWeight = FW_BOLD;
1092 
1093  /* Load title bitmap */
1094  if (hTitleBitmap)
1096 
1097  /* Load topic bitmaps */
1099  for (i = 0; i < dwNumberTopics; i++)
1100  {
1101  // FIXME: Not implemented yet!
1102  // pTopics[i]->hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TOPIC_BITMAP0 + i));
1103  pTopics[i]->hBitmap = NULL;
1104  }
1105 
1106  ScreenDC = GetWindowDC(hWnd);
1107  hdcMem = CreateCompatibleDC(ScreenDC);
1108  ReleaseDC(hWnd, ScreenDC);
1109 
1110  /* Load and create the menu buttons */
1111  dwTop = rcLeftPanel.top;
1112  for (i = 0; i < dwNumberTopics; i++)
1113  {
1114  if (*pTopics[i]->szText)
1115  {
1118  pTopics[i]->szText,
1120 
1121  pTopics[i]->hWndButton = CreateWindow(TEXT("BUTTON"),
1122  pTopics[i]->szText,
1123  (*pTopics[i]->szCommand ? 0 : WS_DISABLED) |
1126  rcLeftPanel.left,
1127  dwTop,
1129  dwHeight,
1130  hWnd,
1131  (HMENU)IntToPtr(TOPIC_BTN_ID_BASE + i), // Similar to SetWindowLongPtr(GWLP_ID)
1132  hInstance,
1133  NULL);
1134  nDefaultTopic = i;
1137  }
1138  else
1139  {
1140  pTopics[i]->hWndButton = NULL;
1141  }
1142 
1143  dwTop += dwHeight;
1144  }
1145 
1146  /* Create the checkbox */
1147  if (bDisplayCheckBox)
1148  {
1150  if (nLength > 0)
1151  {
1152  lf.lfHeight = -10;
1153  lf.lfWidth = 0;
1154  lf.lfWeight = FW_THIN;
1156 
1157  hWndCheckButton = CreateWindow(TEXT("BUTTON"),
1158  szText,
1161  rcLeftPanel.left + 8,
1162  rcLeftPanel.bottom - 8 - 13,
1164  13,
1165  hWnd,
1167  hInstance,
1168  NULL);
1170  }
1171  else
1172  {
1175  }
1176  }
1177 
1178  /* Create the "Exit" button */
1179  if (bDisplayExitBtn)
1180  {
1182  if (nLength > 0)
1183  {
1184  hWndCloseButton = CreateWindow(TEXT("BUTTON"),
1185  szText,
1187  rcRightPanel.right - 8 - 57,
1188  rcRightPanel.bottom - 8 - 21,
1189  57,
1190  21,
1191  hWnd,
1193  hInstance,
1194  NULL);
1195  nDefaultTopic = -1;
1197  }
1198  else
1199  {
1201  }
1202  }
1203 
1204  return 0;
1205 }
1206 
1207 
1208 static LRESULT
1210 {
1212 
1213  /* Retrieve the low-word from wParam */
1214  wParam = LOWORD(wParam);
1215 
1216  /* Execute action */
1217  if (wParam == IDC_CLOSEBUTTON)
1218  {
1220  }
1222  {
1224  DestroyWindow(hWnd); // Corresponds to a <exit> action.
1225  }
1226 
1227  return 0;
1228 }
1229 
1230 
1231 static VOID
1233 {
1234  HBITMAP hOldBitmap;
1235  HBRUSH hOldBrush;
1236 
1237  /* Title bitmap */
1238  hOldBitmap = (HBITMAP)SelectObject(hdcMem, hTitleBitmap);
1239  BitBlt(hdc,
1240  rcPanel->left,
1241  rcPanel->top,
1242  rcPanel->right - rcPanel->left,
1243  rcPanel->bottom - 3,
1244  hdcMem, 0, 0, SRCCOPY);
1245  SelectObject(hdcMem, hOldBitmap);
1246 
1247  /* Dark blue line */
1248  hOldBrush = (HBRUSH)SelectObject(hdc, hbrDarkBlue);
1249  PatBlt(hdc,
1250  rcPanel->left,
1251  rcPanel->bottom - 3,
1252  rcPanel->right - rcPanel->left,
1253  3,
1254  PATCOPY);
1255  SelectObject(hdc, hOldBrush);
1256 }
1257 
1258 
1259 static LRESULT
1261 {
1262  HPEN hPen;
1263  HPEN hOldPen;
1264  HDC hdc;
1265  PAINTSTRUCT ps;
1266  HBITMAP hOldBitmap = NULL;
1267  HBRUSH hOldBrush;
1268  HFONT hOldFont;
1269  RECT rcTitle, rcDescription;
1270  BITMAP bmpInfo;
1271  TCHAR szVersion[50];
1272  LPTSTR lpTitle = NULL, lpDesc = NULL;
1273 
1276 
1277  hdc = BeginPaint(hWnd, &ps);
1278 
1279  /* Banner panel */
1281 
1282  /* Left panel */
1283  hOldBrush = (HBRUSH)SelectObject(hdc, hbrLightBlue);
1284  PatBlt(hdc,
1285  rcLeftPanel.left,
1286  rcLeftPanel.top,
1289  PATCOPY);
1290  SelectObject(hdc, hOldBrush);
1291 
1292  /* Right panel */
1293  hOldBrush = (HBRUSH)SelectObject(hdc, GetStockObject(WHITE_BRUSH));
1294  PatBlt(hdc,
1296  rcRightPanel.top,
1299  PATCOPY);
1300  SelectObject(hdc, hOldBrush);
1301 
1302  /* Draw dark vertical line */
1303  hPen = CreatePen(PS_SOLID, 0, DARK_BLUE);
1304  hOldPen = (HPEN)SelectObject(hdc, hPen);
1307  SelectObject(hdc, hOldPen);
1308  DeleteObject(hPen);
1309 
1310  /* Draw topic bitmap */
1311  if ((nTopic == -1) && (hDefaultTopicBitmap))
1312  {
1313  GetObject(hDefaultTopicBitmap, sizeof(bmpInfo), &bmpInfo);
1315  BitBlt(hdc,
1316  rcRightPanel.right - bmpInfo.bmWidth,
1317  rcRightPanel.bottom - bmpInfo.bmHeight,
1318  bmpInfo.bmWidth,
1319  bmpInfo.bmHeight,
1320  hdcMem,
1321  0,
1322  0,
1323  SRCCOPY);
1324  }
1325  else if ((nTopic != -1) && (pTopics[nTopic]->hBitmap))
1326  {
1327  GetObject(pTopics[nTopic]->hBitmap, sizeof(bmpInfo), &bmpInfo);
1328  hOldBitmap = (HBITMAP)SelectObject(hdcMem, pTopics[nTopic]->hBitmap);
1329  BitBlt(hdc,
1330  rcRightPanel.right - bmpInfo.bmWidth,
1331  rcRightPanel.bottom - bmpInfo.bmHeight,
1332  bmpInfo.bmWidth,
1333  bmpInfo.bmHeight,
1334  hdcMem,
1335  0,
1336  0,
1337  SRCCOPY);
1338  }
1339 
1340  if (nTopic == -1)
1341  {
1343  lpDesc = szDefaultDesc;
1344  }
1345  else
1346  {
1348  lpDesc = pTopics[nTopic]->szDesc;
1349  }
1350 
1352 
1353  /* Draw version information */
1355  TEXT("ReactOS ") TEXT(KERNEL_VERSION_STR));
1356 
1357  /*
1358  * Compute the original rect (position & size) of the version info,
1359  * depending whether the checkbox is displayed (version info in the
1360  * right panel) or not (version info in the left panel).
1361  */
1362  if (bDisplayCheckBox)
1363  rcTitle = rcRightPanel;
1364  else
1365  rcTitle = rcLeftPanel;
1366 
1367  rcTitle.left = rcTitle.left + 8;
1368  rcTitle.right = rcTitle.right - 5;
1369  rcTitle.top = rcTitle.bottom - 43;
1370  rcTitle.bottom = rcTitle.bottom - 8;
1371 
1375  DrawText(hdc, szVersion, -1, &rcTitle, DT_BOTTOM | DT_SINGLELINE);
1376  SelectObject(hdc, hOldFont);
1377 
1378  /* Draw topic title */
1379  rcTitle.left = rcRightPanel.left + 12;
1380  rcTitle.right = rcRightPanel.right - 8;
1381  rcTitle.top = rcRightPanel.top + 8;
1382  rcTitle.bottom = rcTitle.top + 57;
1383  hOldFont = (HFONT)SelectObject(hdc, hFontTopicTitle);
1384  DrawText(hdc, lpTitle, -1, &rcTitle, DT_TOP | DT_CALCRECT);
1386  DrawText(hdc, lpTitle, -1, &rcTitle, DT_TOP);
1387  SelectObject(hdc, hOldFont);
1388 
1389  /* Draw topic description */
1390  rcDescription.left = rcRightPanel.left + 12;
1391  rcDescription.right = rcRightPanel.right - 8;
1392  rcDescription.top = rcTitle.bottom + 8;
1393  rcDescription.bottom = rcRightPanel.bottom - 20;
1396  DrawText(hdc, lpDesc, -1, &rcDescription, DT_TOP | DT_WORDBREAK);
1397  SelectObject(hdc, hOldFont);
1398 
1399  SetBkMode(hdc, OPAQUE);
1400 
1401  SelectObject(hdcMem, hOldBrush);
1402  SelectObject(hdcMem, hOldBitmap);
1403 
1404  EndPaint(hWnd, &ps);
1405 
1406  return 0;
1407 }
1408 
1409 
1410 static LRESULT
1412 {
1414  HPEN hPen, hOldPen;
1415  HBRUSH hOldBrush;
1416  INT iBkMode;
1417  TCHAR szText[80];
1418 
1421 
1422 #if 0
1423  /* Neither the checkbox button nor the close button implement owner-drawing */
1424  if (lpDis->hwndItem == hWndCheckButton)
1425  return 0;
1426  if (lpDis->hwndItem == hWndCloseButton)
1427  {
1428  DrawFrameControl(lpDis->hDC,
1429  &lpDis->rcItem,
1430  DFC_BUTTON,
1432  return TRUE;
1433  }
1434 #endif
1435 
1436  if (lpDis->CtlID == (ULONG)(TOPIC_BTN_ID_BASE + nTopic))
1437  hOldBrush = (HBRUSH)SelectObject(lpDis->hDC, GetStockObject(WHITE_BRUSH));
1438  else
1439  hOldBrush = (HBRUSH)SelectObject(lpDis->hDC, hbrLightBlue);
1440 
1441  PatBlt(lpDis->hDC,
1442  lpDis->rcItem.left,
1443  lpDis->rcItem.top,
1444  lpDis->rcItem.right,
1445  lpDis->rcItem.bottom,
1446  PATCOPY);
1447  SelectObject(lpDis->hDC, hOldBrush);
1448 
1449  hPen = CreatePen(PS_SOLID, 0, DARK_BLUE);
1450  hOldPen = (HPEN)SelectObject(lpDis->hDC, hPen);
1451  MoveToEx(lpDis->hDC, lpDis->rcItem.left, lpDis->rcItem.bottom - 1, NULL);
1452  LineTo(lpDis->hDC, lpDis->rcItem.right, lpDis->rcItem.bottom - 1);
1453  SelectObject(lpDis->hDC, hOldPen);
1454  DeleteObject(hPen);
1455 
1456  InflateRect(&lpDis->rcItem, -10, -4);
1457  OffsetRect(&lpDis->rcItem, 0, 1);
1461  iBkMode = SetBkMode(lpDis->hDC, TRANSPARENT);
1462  DrawText(lpDis->hDC, szText, -1, &lpDis->rcItem, DT_TOP | DT_LEFT | DT_WORDBREAK);
1463  SetBkMode(lpDis->hDC, iBkMode);
1464 
1465  return TRUE;
1466 }
1467 
1468 
1469 static LRESULT
1471 {
1472  static WPARAM wParamOld = 0;
1473  static LPARAM lParamOld = 0;
1474 
1475  /* Ignore mouse-move messages on the same point */
1476  if ((wParam == wParamOld) && (lParam == lParamOld))
1477  return 0;
1478 
1479  /*
1480  * If the user moves the mouse over the main window, outside of the
1481  * topic buttons, reset the current topic to the default one and
1482  * change the focus to some other default button (to keep keyboard
1483  * navigation possible).
1484  */
1485  if (nTopic != -1)
1486  {
1487  INT nOldTopic = nTopic;
1488  nTopic = -1;
1489  /* Also repaint the buttons, otherwise nothing repaints... */
1490  InvalidateRect(pTopics[nOldTopic]->hWndButton, NULL, TRUE);
1491 
1492  /* Set the focus to some other default button */
1493  if (hWndCheckButton)
1495  else if (hWndCloseButton)
1497  // SetFocus(hWnd);
1498 
1499  /* Repaint the description panel */
1501  }
1502 
1503  wParamOld = wParam;
1504  lParamOld = lParam;
1505 
1506  return 0;
1507 }
1508 
1509 
1510 static LRESULT
1512 {
1514 
1515  if ((HWND)lParam == hWndCheckButton)
1516  {
1518  return (LRESULT)hbrLightBlue;
1519  }
1520 
1521  return 0;
1522 }
1523 
1524 
1525 static LRESULT
1527 {
1530 
1531  if (wParam != WA_INACTIVE)
1532  {
1533  /*
1534  * The main window is re-activated, set the focus back to
1535  * either the current topic or a default button.
1536  */
1537  if (nTopic != -1)
1538  SetFocus(pTopics[nTopic]->hWndButton);
1539  else if (hWndCheckButton)
1541  else if (hWndCloseButton)
1543 
1544  // InvalidateRect(hWndMain, &rcRightPanel, TRUE);
1545  }
1546 
1547  return 0;
1548 }
1549 
1550 
1551 static LRESULT
1553 {
1554  UINT i;
1555 
1559 
1560  for (i = 0; i < dwNumberTopics; i++)
1561  {
1562  if (pTopics[i]->hWndButton)
1563  DestroyWindow(pTopics[i]->hWndButton);
1564  }
1565 
1566  if (hWndCloseButton)
1568 
1569  if (hWndCheckButton)
1571 
1572  DeleteDC(hdcMem);
1573 
1574  /* Delete bitmaps */
1577  for (i = 0; i < dwNumberTopics; i++)
1578  {
1579  if (pTopics[i]->hBitmap)
1581  }
1582 
1586 
1587  if (hFontCheckButton)
1589 
1592 
1593  return 0;
1594 }
1595 
1596 
1599  UINT uMsg,
1600  WPARAM wParam,
1601  LPARAM lParam)
1602 {
1603  switch (uMsg)
1604  {
1605  case WM_CREATE:
1606  return OnCreate(hWnd, wParam, lParam);
1607 
1608  case WM_COMMAND:
1609  return OnCommand(hWnd, wParam, lParam);
1610 
1611  case WM_ACTIVATE:
1612  return OnActivate(hWnd, wParam, lParam);
1613 
1614  case WM_PAINT:
1615  return OnPaint(hWnd, wParam, lParam);
1616 
1617  case WM_DRAWITEM:
1618  return OnDrawItem(hWnd, wParam, lParam);
1619 
1620  case WM_CTLCOLORSTATIC:
1621  return OnCtlColorStatic(hWnd, wParam, lParam);
1622 
1623  case WM_MOUSEMOVE:
1624  return OnMouseMove(hWnd, wParam, lParam);
1625 
1626  case WM_DESTROY:
1628  PostQuitMessage(0);
1629  return 0;
1630  }
1631 
1632  return DefWindowProc(hWnd, uMsg, wParam, lParam);
1633 }
1634 
1635 /* EOF */
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define CallWindowProc
Definition: winuser.h:5636
#define WS_DISABLED
Definition: pedump.c:621
HFONT hFontCheckButton
Definition: welcome.c:111
HBITMAP hDefaultTopicBitmap
Definition: welcome.c:106
#define DFCS_FLAT
Definition: winuser.h:510
UINT style
Definition: winuser.h:3176
#define MAKEINTRESOURCE
Definition: winuser.h:591
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define SW_SHOWDEFAULT
Definition: winuser.h:774
#define IN
Definition: typedefs.h:38
#define DispatchMessage
Definition: winuser.h:5666
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: lang.c:806
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define BS_OWNERDRAW
Definition: pedump.c:661
BOOL WINAPI TranslateMessage(_In_ const MSG *)
TCHAR szCommand[512]
Definition: welcome.c:87
#define IDS_TOPIC_DESC0
Definition: resource.h:23
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
static HICON
Definition: imagelist.c:84
LPCSTR lpszMenuName
Definition: winuser.h:3184
#define TRUE
Definition: types.h:120
#define DARK_BLUE
Definition: welcome.c:48
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define DFC_BUTTON
Definition: winuser.h:476
#define PROCESSOR_ARCHITECTURE_SHX
Definition: ketypes.h:109
#define CloseHandle
Definition: compat.h:398
#define RegisterClassEx
Definition: winuser.h:5738
#define MF_BYCOMMAND
Definition: winuser.h:202
#define FindWindow
Definition: winuser.h:5678
#define PROCESSOR_ARCHITECTURE_ARM
Definition: ketypes.h:110
#define LAYOUT_RTL
Definition: wingdi.h:1370
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DEFAULT_QUALITY
Definition: wingdi.h:435
#define LOCALE_SISO639LANGNAME
Definition: winnls.h:127
HCURSOR hCursor
Definition: winuser.h:3182
WNDPROC lpfnWndProc
Definition: winuser.h:3177
#define CreateWindow
Definition: winuser.h:5655
#define FF_DONTCARE
Definition: wingdi.h:447
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define _tcsicmp
Definition: xmlstorage.h:205
#define PROCESSOR_ARCHITECTURE_UNKNOWN
Definition: ketypes.h:115
#define IDS_APPTITLE
Definition: resource.h:3
LPCSTR lpszClassName
Definition: winuser.h:3185
static LRESULT OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1209
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define LOCALE_USER_DEFAULT
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define DT_WORDBREAK
Definition: winuser.h:544
#define MAX_NUMBER_INTERNAL_TOPICS
struct _TOPIC * PTOPIC
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define SUBLANG_DEFAULT
Definition: nls.h:168
TCHAR szTitle[TOPIC_TITLE_LENGTH]
Definition: welcome.c:85
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:27
_In_ DWORD nLength
Definition: wincon.h:461
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND hWnd
Definition: settings.c:17
#define GetLocaleInfo
Definition: winnls.h:1183
LONG top
Definition: windef.h:292
HWND hWndCheckButton
Definition: welcome.c:62
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
RECT rcRightPanel
Definition: welcome.c:118
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define CS_HREDRAW
Definition: winuser.h:648
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
static VOID FreeResources(VOID)
Definition: welcome.c:709
#define WHITE_BRUSH
Definition: wingdi.h:901
HWND WINAPI SetFocus(_In_opt_ HWND)
TCHAR szAppTitle[80]
Definition: welcome.c:56
BYTE lfCharSet
Definition: dimm.idl:50
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define StringCchCat
Definition: strsafe.h:317
TCHAR szText[80]
Definition: welcome.c:84
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
DWORD LCID
Definition: nls.h:13
UINT_PTR WPARAM
Definition: windef.h:207
#define IDS_DEFAULT_TOPIC_TITLE
Definition: resource.h:9
HICON hIconSm
Definition: winuser.h:3186
Definition: shell.h:41
LONG left
Definition: windef.h:291
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define PROCESSOR_ARCHITECTURE_MIPS
Definition: ketypes.h:106
int32_t INT_PTR
Definition: typedefs.h:62
TCHAR szDesc[TOPIC_DESC_LENGTH]
Definition: welcome.c:86
#define IsDialogMessage
Definition: winuser.h:5710
#define WS_CLIPCHILDREN
Definition: pedump.c:619
INT nTopic
Definition: welcome.c:101
LONG right
Definition: windef.h:293
BOOL WINAPI DestroyWindow(_In_ HWND)
DWORD dwNumberTopics
Definition: welcome.c:91
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
INT_PTR CALLBACK ButtonSubclassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:928
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:56
#define LANG_HEBREW
Definition: nls.h:67
#define VK_RETURN
Definition: winuser.h:2176
#define SetWindowLongPtr
Definition: treelist.c:70
#define PROCESSOR_ARCHITECTURE_ALPHA64
Definition: ketypes.h:112
DWORD WINAPI GetSysColor(_In_ int)
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
TCHAR szDefaultDesc[TOPIC_DESC_LENGTH]
Definition: welcome.c:97
PTOPIC AddNewTopicEx(IN LPTSTR szText OPTIONAL, IN LPTSTR szTitle OPTIONAL, IN LPTSTR szDesc OPTIONAL, IN LPTSTR szCommand OPTIONAL, IN LPTSTR szArgs OPTIONAL, IN LPTSTR szAction OPTIONAL)
Definition: welcome.c:361
HFONT hFont
Definition: main.c:53
CHAR * LPTSTR
Definition: xmlstorage.h:192
BYTE lfOutPrecision
Definition: dimm.idl:51
#define DrawText
Definition: winuser.h:5672
#define TITLE_HEIGHT
Definition: welcome.c:51
#define IDC_CLOSEBUTTON
Definition: resource.h:5
#define GetWindowText
Definition: winuser.h:5699
#define PROCESSOR_ARCHITECTURE_IA64
Definition: ketypes.h:111
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI GetDlgCtrlID(_In_ HWND)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
void ShowLastWin32Error(HWND hwndParent)
Definition: winutils.c:11
#define PS_SOLID
Definition: wingdi.h:585
#define LOCALE_NAME_MAX_LENGTH
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
RECT rcTitlePanel
Definition: welcome.c:116
#define SM_CXSCREEN
Definition: winuser.h:949
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
Definition: glfuncs.h:248
#define IDS_TOPIC_CMD_ARGS0
Definition: resource.h:31
HWND hWndButton
Definition: welcome.c:76
#define PROCESSOR_ARCHITECTURE_ALPHA
Definition: ketypes.h:107
#define IDS_TOPIC_COMMAND0
Definition: resource.h:27
#define StringCchPrintf
Definition: strsafe.h:517
#define DT_LEFT
Definition: winuser.h:534
HINSTANCE hInstance
Definition: winuser.h:3180
static const WCHAR szText[]
Definition: dialog.c:139
#define DT_CALCRECT
Definition: winuser.h:526
static VOID PaintBanner(HDC hdc, LPRECT rcPanel)
Definition: welcome.c:1232
struct _TOPIC TOPIC
unsigned int BOOL
Definition: ntddk_ex.h:94
Definition: welcome.c:73
#define MB_TASKMODAL
Definition: winuser.h:810
long LONG
Definition: pedump.c:60
static VOID LoadLocalizedResourcesInternal(VOID)
Definition: welcome.c:464
#define _tcsnicmp
Definition: xmlstorage.h:207
#define BUFFER_SIZE
Definition: welcome.c:68
LONG lfHeight
Definition: dimm.idl:42
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define ShellExecute
Definition: shellapi.h:689
#define CLIP_DEFAULT_PRECIS
Definition: wingdi.h:425
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static PVOID ptr
Definition: dispmode.c:27
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
#define GetCurrentDirectory
Definition: winbase.h:3622
static LRESULT OnActivate(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1526
#define SC_MAXIMIZE
Definition: winuser.h:2563
#define TRANSPARENT
Definition: wingdi.h:949
#define IDS_TOPIC_TITLE0
Definition: resource.h:19
#define TOPIC_TITLE_LENGTH
Definition: welcome.c:70
size_t __cdecl _tcslen(const _TCHAR *str)
Definition: tcslen.h:9
#define TITLE_WIDTH
Definition: welcome.c:50
LONG lfWeight
Definition: dimm.idl:46
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
smooth NULL
Definition: ftsmooth.c:416
#define IDS_TOPIC_ACTION0
Definition: resource.h:35
INT_PTR CALLBACK MainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1598
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
UINT cbSize
Definition: winuser.h:3175
BOOL bDisplayCheckBox
Definition: welcome.c:65
char ** Args
Definition: acdebug.h:343
BOOL WINAPI IsWindowEnabled(_In_ HWND)
BYTE lfPitchAndFamily
Definition: dimm.idl:54
#define WS_CHILDWINDOW
Definition: pedump.c:639
HANDLE hMutex
Definition: mutex.c:11
static LRESULT OnDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1411
BOOL ExpandInstallerPath(IN LPCTSTR lpInstallerName, OUT LPTSTR lpInstallerPath, IN SIZE_T PathSize)
Definition: welcome.c:218
HBITMAP hBitmap
Definition: welcome.c:75
CHAR * PTSTR
Definition: xmlstorage.h:191
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
Definition: tcschr.h:4
HBRUSH hbrBackground
Definition: winuser.h:3183
static const WCHAR dwHeight[]
Definition: provider.c:60
static VOID LoadConfiguration(VOID)
Definition: welcome.c:637
static LRESULT OnPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1260
#define DefWindowProc
Definition: ros2win.h:31
#define WM_DESTROY
Definition: winuser.h:1591
#define IntToPtr(i)
Definition: basetsd.h:89
#define GetPrivateProfileSectionNames
Definition: winbase.h:3651
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1716
#define LoadBitmap
Definition: winuser.h:5712
#define WS_CAPTION
Definition: pedump.c:624
#define CS_VREDRAW
Definition: winuser.h:653
char TCHAR
Definition: xmlstorage.h:189
#define SM_CYSCREEN
Definition: winuser.h:950
#define _T(x)
Definition: vfdio.h:22
int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
Definition: welcome.c:752
#define WM_KILLFOCUS
Definition: winuser.h:1596
#define WS_OVERLAPPED
Definition: pedump.c:615
#define GetProcessHeap()
Definition: compat.h:395
HBRUSH hbrDarkBlue
Definition: welcome.c:114
#define SM_CYCAPTION
Definition: winuser.h:953
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CreateMutex
Definition: winbase.h:3573
INT nDefaultTopic
Definition: welcome.c:102
VOID TranslateEscapes(IN OUT LPTSTR lpString)
Definition: welcome.c:160
#define BS_MULTILINE
Definition: winuser.h:267
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define COLOR_WINDOWTEXT
Definition: winuser.h:911
static LRESULT OnCtlColorStatic(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1511
#define MAX_PATH
Definition: compat.h:26
TCHAR szWindowClass[]
Definition: welcome.c:55
#define WINAPI
Definition: msvc.h:8
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define LOCALE_SNAME
Definition: winnls.h:129
#define LIGHT_BLUE
Definition: welcome.c:47
#define OUT_DEFAULT_PRECIS
Definition: wingdi.h:414
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FW_THIN
Definition: wingdi.h:368
BOOL bDisplayExitBtn
Definition: welcome.c:66
int cbWndExtra
Definition: winuser.h:3179
#define GetModuleFileName
Definition: winbase.h:3648
#define IDC_CHECKBUTTON
Definition: resource.h:4
LONG lfWidth
Definition: dimm.idl:43
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
VOID InitializeTopicList(VOID)
Definition: welcome.c:331
#define GetObject
Definition: wingdi.h:4463
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
#define IDS_FONTNAME
Definition: resource.h:11
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114
LONG lfOrientation
Definition: dimm.idl:45
#define WM_PAINT
Definition: winuser.h:1602
static LRESULT OnMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1470
#define IDB_DEFAULT_TOPIC_BITMAP
Definition: resource.h:41
static LPCWSTR szVersion
Definition: asmcache.c:748
#define FormatMessage
Definition: winbase.h:3612
HWND hWndCloseButton
Definition: welcome.c:63
#define COLOR_GRAYTEXT
Definition: winuser.h:922
HICON hIcon
Definition: winuser.h:3181
#define _tcstoul
Definition: tchar.h:595
#define OPAQUE
Definition: wingdi.h:948
#define StringCchCopy
Definition: strsafe.h:139
HDC hdc
Definition: main.c:9
#define IDI_MAIN
Definition: resource.h:4
static BOOL LoadLocalizedResourcesFromINI(LCID Locale, LPTSTR lpResPath)
Definition: welcome.c:515
HWND hWndMain
Definition: welcome.c:60
#define MB_ICONERROR
Definition: winuser.h:781
BOOL bIsCommand
Definition: welcome.c:82
#define MessageBox
Definition: winuser.h:5723
#define WS_TABSTOP
Definition: pedump.c:634
HBITMAP hTitleBitmap
Definition: welcome.c:105
#define WM_COMMAND
Definition: winuser.h:1722
HFONT hFontTopicButton
Definition: welcome.c:108
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define IDS_CHECKTEXT
Definition: resource.h:12
#define GetFileAttributes
Definition: winbase.h:3632
static LRESULT OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1046
#define LoadCursor
Definition: winuser.h:5713
#define GWLP_WNDPROC
Definition: treelist.c:66
BYTE lfQuality
Definition: dimm.idl:53
#define PATCOPY
Definition: wingdi.h:334
HINSTANCE hInstance
Definition: welcome.c:58
#define PROCESSOR_ARCHITECTURE_INTEL
Definition: ketypes.h:105
#define BS_FLAT
Definition: winuser.h:280
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2880
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:401
static HDC hDC
Definition: 3dtext.c:33
ULONG_PTR SIZE_T
Definition: typedefs.h:78
HFONT hFontTopicDescription
Definition: welcome.c:110
#define DT_SINGLELINE
Definition: winuser.h:540
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOWNORMAL
Definition: winuser.h:764
int cbClsExtra
Definition: winuser.h:3178
#define TOPIC_BTN_ID_BASE
Definition: welcome.c:99
HINSTANCE hInst
Definition: dxdiag.c:13
#define TEXT(s)
Definition: k32.h:26
#define TOPIC_DESC_LENGTH
Definition: welcome.c:71
TCHAR szDefaultTitle[TOPIC_TITLE_LENGTH]
Definition: welcome.c:96
#define FW_BOLD
Definition: wingdi.h:377
TCHAR szArgs[512]
Definition: welcome.c:88
#define WM_ACTIVATE
Definition: winuser.h:1594
#define PROCESSOR_ARCHITECTURE_PPC
Definition: ketypes.h:108
static DWORD GetButtonHeight(HDC hDC, HFONT hFont, LPCTSTR szText, DWORD dwWidth)
Definition: welcome.c:1024
#define WS_MINIMIZEBOX
Definition: pedump.c:631
BOOL WINAPI DeleteDC(_In_ HDC)
#define LOCALE_SISO3166CTRYNAME
Definition: winnls.h:128
#define GetPrivateProfileString
Definition: winbase.h:3652
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
BYTE lfClipPrecision
Definition: dimm.idl:52
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SC_SIZE
Definition: winuser.h:2559
#define DFCS_BUTTONPUSH
Definition: winuser.h:501
Definition: bl.h:1331
#define HeapReAlloc
Definition: compat.h:393
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:142
#define DT_TOP
Definition: winuser.h:542
HDC WINAPI GetWindowDC(_In_opt_ HWND)
#define CreateFontIndirect
Definition: wingdi.h:4439
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1757
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define MB_OK
Definition: winuser.h:784
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define GetMessage
Definition: winuser.h:5691
#define IDS_TOPIC_BUTTON0
Definition: resource.h:15
static BOOL RunAction(INT nTopic)
Definition: welcome.c:986
WORD wProcessorArchitecture
Definition: winbase.h:1122
#define WM_SETFONT
Definition: winuser.h:1632
#define FW_NORMAL
Definition: wingdi.h:372
#define WM_DRAWITEM
Definition: winuser.h:1627
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HWND WINAPI GetFocus(void)
Definition: window.c:1905
#define msg(x)
Definition: auth_time.c:54
#define IDC_ARROW
Definition: winuser.h:682
#define SendMessage
Definition: winuser.h:5744
_TCHAR * _tcsrchr(const _TCHAR *s, _XINT c)
Definition: tcsrchr.h:4
#define OUT
Definition: typedefs.h:39
#define WM_CREATE
Definition: winuser.h:1590
WNDPROC fnOldBtn
Definition: welcome.c:94
TCHAR lpTitle[80]
Definition: ctm.c:69
INT GetLocaleName(IN LCID Locale, OUT LPTSTR lpLCData, IN SIZE_T cchData)
Definition: welcome.c:127
static LRESULT OnDestroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
Definition: welcome.c:1552
unsigned int ULONG
Definition: retypes.h:1
HFONT hFontTopicTitle
Definition: welcome.c:109
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
#define MAKELANGID(p, s)
Definition: nls.h:15
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:294
#define WA_INACTIVE
Definition: winuser.h:2597
static HBITMAP
Definition: button.c:44
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define LoadIcon
Definition: winuser.h:5714
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_SETFOCUS
Definition: winuser.h:1595
#define ANSI_CHARSET
Definition: wingdi.h:382
PTOPIC * pTopics
Definition: welcome.c:92
PTOPIC AddNewTopic(VOID)
Definition: welcome.c:337
LONG_PTR LRESULT
Definition: windef.h:209
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
#define GetWindowsDirectory
Definition: winbase.h:3674
#define DT_BOTTOM
Definition: winuser.h:525
#define IDS_DEFAULT_TOPIC_DESC
Definition: resource.h:10
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static HBITMAP hBitmap
Definition: timezone.c:35
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
#define GWLP_ID
Definition: winuser.h:854
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define SRCCOPY
Definition: wingdi.h:332
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define LoadString
Definition: winuser.h:5720
#define IDB_TITLE_BITMAP
Definition: resource.h:40
HDC hdcMem
Definition: welcome.c:104
#define IDS_CLOSETEXT
Definition: resource.h:13
static const WCHAR dwWidth[]
Definition: provider.c:59
#define SetCurrentDirectory
Definition: winbase.h:3720
_In_ LPCSTR lpFileName
Definition: winbase.h:3011
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50
LONG lfEscapement
Definition: dimm.idl:44
HBRUSH hbrLightBlue
Definition: welcome.c:113
RECT rcLeftPanel
Definition: welcome.c:117
#define GetPrivateProfileInt
Definition: winbase.h:3649
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68