Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

791 lines
21 KiB

  1. #include "setedit.h"
  2. #include <lmcons.h>
  3. #include <lmerr.h>
  4. #include <lmapibuf.h>
  5. #include <lmwksta.h>
  6. #include <uiexport.h>
  7. #include <stdio.h> // for sprintf
  8. #include <locale.h> // for setlocale
  9. #include "utils.h"
  10. #include "perfdata.h" // for OpenSystemPerfData
  11. #include "grafdata.h" // for GraphInsertLine
  12. #include "fileopen.h" // for FileGetName
  13. #include "fileutil.h" // for FileRead etc
  14. #include "command.h" // for PrepareMenu
  15. #include "system.h"
  16. #include "globals.h"
  17. #include "pmemory.h" // for MemoryFree
  18. #include "status.h" // for StatusLineReady
  19. #include "pmhelpid.h"
  20. // test for delimiter, end of line and non-digit characters
  21. // used by IsNumberInUnicodeList routine
  22. //
  23. #define DIGIT 1
  24. #define DELIMITER 2
  25. #define INVALID 3
  26. // globals used for International Date and Time formats
  27. enum DATE_STYLE {
  28. YEAR_FIRST, // YYMMDD
  29. DAY_FIRST, // DDMMYY
  30. MONTH_FIRST // MMDDYY
  31. } DateStyle ;
  32. TCHAR szInternational[] = TEXT("Intl") ;
  33. TCHAR sz1159[6] ; // AM String
  34. TCHAR sz2359[6] ; // PM String
  35. int iTime ; // = 0 for 12-hour format, <> 0 for 24-hour format
  36. int YearCharCount ; // = 4 for 1990, = 2 for 90
  37. TCHAR szDateFormat[ResourceStringLen] ;
  38. TCHAR szTimeFormat[ResourceStringLen] ; // time format including msec
  39. TCHAR szTimeFormat1[ResourceStringLen] ; // time format without msec
  40. TCHAR LeadingZeroStr [] = TEXT("%02d") ;
  41. TCHAR NoLeadingZeroStr [] = TEXT("%d") ;
  42. TCHAR szDecimal [2] ;
  43. TCHAR szCurrentDecimal [2] ;
  44. #define EvalThisChar(c,d) ( \
  45. (c == d) ? DELIMITER : \
  46. (c == 0) ? DELIMITER : \
  47. (c < (WCHAR)'0') ? INVALID : \
  48. (c > (WCHAR)'9') ? INVALID : \
  49. DIGIT)
  50. #define SIZE_OF_BIGGEST_INTEGER 16
  51. // #define SIZE_OF_BIGGEST_INTEGER (16*sizeof(WCHAR))
  52. //==========================================================================//
  53. // Typedefs //
  54. //==========================================================================//
  55. BOOL AddObjectToSystem ( PLINE , PPERFSYSTEM );
  56. HWND
  57. PerfmonViewWindow (void)
  58. /*
  59. Effect: Return the current data window, i.e. the window currently
  60. visible as the client area of Perfmon. This is either a
  61. chart window.
  62. */
  63. {
  64. return (hWndGraph) ;
  65. }
  66. #define szChooseComputerLibrary TEXT("ntlanman.dll")
  67. #define szChooseComputerFunction "I_SystemFocusDialog"
  68. BOOL
  69. ChooseComputer (
  70. HWND hWndParent,
  71. LPTSTR lpszComputer
  72. )
  73. /*
  74. Effect: Display the choose Domain/Computer dialog provided by
  75. network services. If the user selects a computer,
  76. copy the computer name to lpszComputer and return
  77. nonnull. If the user cancels, return FALSE.
  78. Internals: This dialog and code is currently not an exported
  79. routine regularly found on any user's system. Right
  80. now, we dynamically load and call the routine.
  81. This is definitely temporary code that will be
  82. rewritten when NT stabilizes. The callers of this
  83. routine, however, will not need to be modified.
  84. Also, the Domain/Computer dialog currently allows
  85. a domain to be selected, which we cannot use. We
  86. therefore loop until the user cancels or selects
  87. a computer, putting up a message if the user selects
  88. a domain.
  89. Assert: lpszComputer is at least MAX_SYSTEM_NAME_LENGTH + 1
  90. characters.
  91. */
  92. {
  93. BOOL bSuccess ;
  94. WCHAR wszWideComputer[MAX_COMPUTERNAME_LENGTH + 3] ;
  95. HLIBRARY hLibrary ;
  96. LPFNI_SYSTEMFOCUSDIALOG lpfnChooseComputer ;
  97. LONG lError ;
  98. // bring up the select network computer dialog
  99. hLibrary = LoadLibrary (szChooseComputerLibrary) ;
  100. if (!hLibrary || hLibrary == INVALID_HANDLE_VALUE) {
  101. return (FALSE) ;
  102. }
  103. lpfnChooseComputer = (LPFNI_SYSTEMFOCUSDIALOG)
  104. GetProcAddress (hLibrary, szChooseComputerFunction) ;
  105. if (!lpfnChooseComputer) {
  106. FreeLibrary (hLibrary) ;
  107. return (FALSE) ;
  108. }
  109. lError = (*lpfnChooseComputer) (hWndParent,
  110. FOCUSDLG_SERVERS_ONLY | FOCUSDLG_BROWSE_ALL_DOMAINS,
  111. wszWideComputer,
  112. sizeof(wszWideComputer) / sizeof(WCHAR),
  113. &bSuccess,
  114. pszHelpFile,
  115. HC_PM_idDlgSelectNetworkComputer) ;
  116. if (bSuccess) {
  117. lstrcpy (lpszComputer, wszWideComputer) ;
  118. }
  119. FreeLibrary (hLibrary) ;
  120. return (bSuccess) ;
  121. }
  122. void
  123. SystemTimeDateString (
  124. SYSTEMTIME *pSystemTime,
  125. LPTSTR lpszDate
  126. )
  127. {
  128. int wYear ;
  129. wYear = pSystemTime->wYear ;
  130. if (YearCharCount == 2) {
  131. wYear %= 100 ;
  132. }
  133. switch (DateStyle) {
  134. case YEAR_FIRST:
  135. TSPRINTF (lpszDate, szDateFormat,
  136. wYear, pSystemTime->wMonth, pSystemTime->wDay) ;
  137. break ;
  138. case DAY_FIRST:
  139. TSPRINTF (lpszDate, szDateFormat,
  140. pSystemTime->wDay, pSystemTime->wMonth, wYear) ;
  141. break ;
  142. case MONTH_FIRST:
  143. default:
  144. TSPRINTF (lpszDate, szDateFormat,
  145. pSystemTime->wMonth, pSystemTime->wDay, wYear) ;
  146. break ;
  147. }
  148. }
  149. void
  150. SystemTimeTimeString (
  151. SYSTEMTIME *pSystemTime,
  152. LPTSTR lpszTime,
  153. BOOL bOutputMsec
  154. )
  155. {
  156. int iHour ;
  157. BOOL bPM ;
  158. if (iTime) {
  159. // 24 hor format
  160. if (bOutputMsec) {
  161. TSPRINTF (lpszTime, szTimeFormat,
  162. pSystemTime->wHour,
  163. pSystemTime->wMinute,
  164. (FLOAT)pSystemTime->wSecond +
  165. (FLOAT)pSystemTime->wMilliseconds / (FLOAT) 1000.0) ;
  166. } else {
  167. TSPRINTF (lpszTime, szTimeFormat1,
  168. pSystemTime->wHour,
  169. pSystemTime->wMinute,
  170. pSystemTime->wSecond) ;
  171. }
  172. } else {
  173. // 12 hour format
  174. iHour = pSystemTime->wHour ;
  175. bPM = (iHour >= 12) ;
  176. if (iHour > 12)
  177. iHour -= 12 ;
  178. else if (!iHour)
  179. iHour = 12 ;
  180. if (bOutputMsec) {
  181. TSPRINTF (lpszTime, szTimeFormat,
  182. iHour, pSystemTime->wMinute,
  183. (FLOAT)pSystemTime->wSecond +
  184. (FLOAT)pSystemTime->wMilliseconds / (FLOAT) 1000.0 ,
  185. bPM ? sz2359 : sz1159) ;
  186. } else {
  187. TSPRINTF (lpszTime, szTimeFormat1,
  188. iHour, pSystemTime->wMinute,
  189. pSystemTime->wSecond,
  190. bPM ? sz2359 : sz1159) ;
  191. }
  192. }
  193. }
  194. void
  195. ShowPerfmonMenu (
  196. BOOL bMenu
  197. )
  198. {
  199. if (!bMenu) {
  200. WindowEnableTitle (hWndMain, FALSE) ;
  201. // SetMenu(hWndMain, NULL) ;
  202. } else {
  203. WindowEnableTitle (hWndMain, TRUE) ;
  204. switch (iPerfmonView) {
  205. case IDM_VIEWCHART:
  206. SetMenu (hWndMain, hMenuChart) ;
  207. break ;
  208. }
  209. }
  210. if (bMenu != Options.bMenubar) {
  211. PrepareMenu (GetMenu (hWndMain)) ;
  212. }
  213. Options.bMenubar = bMenu ;
  214. }
  215. void
  216. SmallFileSizeString (
  217. int iFileSize,
  218. LPTSTR lpszFileText
  219. )
  220. {
  221. if (iFileSize < 1000000)
  222. TSPRINTF (lpszFileText, TEXT(" %1.1fK "), ((FLOAT) iFileSize) / 1000.0f) ;
  223. else
  224. TSPRINTF (lpszFileText, TEXT(" %1.1fM "), ((FLOAT) iFileSize) / 1000000.0f) ;
  225. }
  226. BOOL
  227. DoWindowDrag (
  228. HWND hWnd,
  229. LPARAM lParam
  230. )
  231. {
  232. POINT lPoint ;
  233. if (!Options.bMenubar && !IsZoomed (hWndMain)) {
  234. // convert lParam from client to screen
  235. lPoint.x = LOWORD (lParam) ;
  236. lPoint.y = HIWORD (lParam) ;
  237. ClientToScreen (hWnd, &lPoint) ;
  238. lParam = MAKELONG (lPoint.x, lPoint.y) ;
  239. SendMessage (hWndMain, WM_NCLBUTTONDOWN, HTCAPTION, lParam) ;
  240. return (TRUE) ;
  241. } else
  242. return (FALSE) ;
  243. }
  244. // Filetimes are in 100NS units
  245. #define FILETIMES_PER_SECOND 10000000
  246. int
  247. SystemTimeDifference (
  248. SYSTEMTIME *pst1,
  249. SYSTEMTIME *pst2
  250. )
  251. {
  252. LARGE_INTEGER li1, li2 ;
  253. LARGE_INTEGER liDifference, liDifferenceSeconds ;
  254. DWORD uRemainder ;
  255. int RetInteger;
  256. BOOL bNegative;
  257. li1.HighPart = li1.LowPart = 0 ;
  258. li2.HighPart = li2.LowPart = 0 ;
  259. SystemTimeToFileTime (pst1, (FILETIME *) &li1) ;
  260. SystemTimeToFileTime (pst2, (FILETIME *) &li2) ;
  261. // check for special cases when the time can be 0
  262. if (li2.HighPart == 0 && li2.LowPart == 0) {
  263. if (li1.HighPart == 0 && li1.LowPart == 0) {
  264. return 0 ;
  265. } else {
  266. return -INT_MAX ;
  267. }
  268. } else if (li1.HighPart == 0 && li1.LowPart == 0) {
  269. return INT_MAX ;
  270. }
  271. liDifference.QuadPart = li2.QuadPart - li1.QuadPart ;
  272. bNegative = liDifference.QuadPart < 0 ;
  273. // add the round-off factor before doing the division
  274. if (bNegative) {
  275. liDifferenceSeconds.QuadPart = (LONGLONG)(- FILETIMES_PER_SECOND / 2) ;
  276. } else {
  277. liDifferenceSeconds.QuadPart = (LONGLONG)(FILETIMES_PER_SECOND / 2) ;
  278. }
  279. liDifferenceSeconds.QuadPart = liDifferenceSeconds.QuadPart +
  280. liDifference.QuadPart ;
  281. liDifferenceSeconds.QuadPart = liDifferenceSeconds.QuadPart /
  282. FILETIMES_PER_SECOND;
  283. RetInteger = liDifferenceSeconds.LowPart;
  284. if (bNegative) {
  285. return (-RetInteger) ;
  286. } else {
  287. return (RetInteger) ;
  288. }
  289. }
  290. BOOL
  291. InsertLine (
  292. PLINE pLine
  293. )
  294. {
  295. BOOL bReturn;
  296. bReturn = ChartInsertLine (pGraphs, pLine) ;
  297. return bReturn;
  298. }
  299. void
  300. SetPerfmonOptions (
  301. OPTIONS *pOptions
  302. )
  303. {
  304. Options = *pOptions ;
  305. ShowPerfmonMenu (Options.bMenubar) ;
  306. SizePerfmonComponents () ;
  307. // WindowSetTopmost (hWndMain, Options.bAlwaysOnTop) ;
  308. }
  309. void
  310. ChangeSaveFileName (
  311. LPTSTR szFileName,
  312. int iPMView
  313. )
  314. {
  315. LPTSTR *ppFullName ;
  316. LPTSTR *ppFileName ;
  317. BOOL errorInput = FALSE ;
  318. switch (iPMView) {
  319. case IDM_VIEWCHART:
  320. ppFileName = &pChartFileName ;
  321. ppFullName = &pChartFullFileName ;
  322. break ;
  323. default:
  324. errorInput = TRUE ;
  325. break ;
  326. }
  327. if (errorInput) {
  328. return ;
  329. }
  330. // release last filename
  331. if (*ppFullName) {
  332. MemoryFree (*ppFullName) ;
  333. *ppFileName = NULL ;
  334. *ppFullName = NULL ;
  335. }
  336. // allocate new file name and display it
  337. if (szFileName && (*ppFullName = StringAllocate (szFileName))) {
  338. *ppFileName = ExtractFileName (*ppFullName) ;
  339. }
  340. StatusLineReady (hWndStatus) ;
  341. }
  342. // define in Addline.c
  343. extern PLINESTRUCT pLineEdit ;
  344. #define bEditLine (pLineEdit != NULL)
  345. BOOL
  346. RemoveObjectsFromSystem (
  347. PPERFSYSTEM pSystem
  348. )
  349. {
  350. SIZE_T dwBufferSize = 0;
  351. if (ARGUMENT_PRESENT (pSystem)) {
  352. if (pSystem->lpszValue) {
  353. dwBufferSize = MemorySize (pSystem->lpszValue);
  354. memset (pSystem->lpszValue, 0, (size_t)dwBufferSize);
  355. return TRUE;
  356. } else {
  357. return FALSE;
  358. }
  359. } else {
  360. return FALSE;
  361. }
  362. }
  363. BOOL
  364. SetSystemValueNameToGlobal (
  365. PPERFSYSTEM pSystem
  366. )
  367. {
  368. if (!bEditLine && ARGUMENT_PRESENT(pSystem)) {
  369. if (pSystem->lpszValue && RemoveObjectsFromSystem(pSystem)) {
  370. lstrcpy (
  371. pSystem->lpszValue,
  372. TEXT("Global ")) ;
  373. return TRUE;
  374. } else {
  375. return FALSE;
  376. }
  377. } else {
  378. return FALSE;
  379. }
  380. }
  381. void
  382. CreatePerfmonSystemObjects ()
  383. {
  384. ColorBtnFace = GetSysColor (COLOR_BTNFACE) ;
  385. hBrushFace = CreateSolidBrush (ColorBtnFace) ;
  386. hPenHighlight = CreatePen (PS_SOLID, 1, GetSysColor (COLOR_BTNHIGHLIGHT)) ;
  387. hPenShadow = CreatePen (PS_SOLID, 1, GetSysColor (COLOR_BTNSHADOW)) ;
  388. }
  389. void
  390. DeletePerfmonSystemObjects ()
  391. {
  392. if (hBrushFace) {
  393. DeleteBrush (hBrushFace) ;
  394. hBrushFace = 0 ;
  395. }
  396. if (hPenHighlight) {
  397. DeletePen (hPenHighlight) ;
  398. hPenHighlight = 0 ;
  399. }
  400. if (hPenShadow) {
  401. DeletePen (hPenShadow) ;
  402. hPenShadow = 0 ;
  403. }
  404. }
  405. // This routine count the number of the same charatcer in the input string
  406. int
  407. SameCharCount (
  408. LPTSTR pInputString
  409. )
  410. {
  411. int Count = 0 ;
  412. TCHAR InputChar = *pInputString ;
  413. if (InputChar) {
  414. while (InputChar == *pInputString) {
  415. Count ++ ;
  416. pInputString ++ ;
  417. }
  418. }
  419. return (Count) ;
  420. }
  421. // create the format to be used in SystemTimeDateString()
  422. BOOL
  423. CreateDateFormat (
  424. LPTSTR pShortDate
  425. )
  426. {
  427. int iIndex ;
  428. int iDayCount ;
  429. int iMonthCount ;
  430. int DateSeparatorCount ;
  431. TCHAR szDateSeparator [10] ;
  432. BOOL bFirstLeading, bSecondLeading, bThirdLeading ;
  433. // get the date format based on the first char
  434. if (*pShortDate == TEXT('M') || *pShortDate == TEXT('m')) {
  435. DateStyle = MONTH_FIRST ;
  436. } else if (*pShortDate == TEXT('D') || *pShortDate == TEXT('d')) {
  437. DateStyle = DAY_FIRST ;
  438. } else if (*pShortDate == TEXT('Y') || *pShortDate == TEXT('y')) {
  439. DateStyle = YEAR_FIRST ;
  440. } else {
  441. // bad format
  442. return FALSE ;
  443. }
  444. bFirstLeading = bSecondLeading = bThirdLeading = FALSE ;
  445. switch (DateStyle) {
  446. case YEAR_FIRST:
  447. // YYYY-MM-DD
  448. YearCharCount = SameCharCount (pShortDate) ;
  449. pShortDate += YearCharCount ;
  450. DateSeparatorCount = SameCharCount (pShortDate) ;
  451. // get the separator string
  452. for (iIndex = 0; iIndex < DateSeparatorCount; iIndex ++) {
  453. szDateSeparator [iIndex] = *pShortDate++ ;
  454. }
  455. szDateSeparator [iIndex] = TEXT('\0') ;
  456. iMonthCount = SameCharCount (pShortDate) ;
  457. pShortDate += iMonthCount + DateSeparatorCount ;
  458. iDayCount = SameCharCount (pShortDate) ;
  459. if (YearCharCount == 2) {
  460. bFirstLeading = TRUE ;
  461. }
  462. if (iMonthCount == 2) {
  463. bSecondLeading = TRUE ;
  464. }
  465. if (iDayCount == 2) {
  466. bThirdLeading = TRUE ;
  467. }
  468. break ;
  469. case MONTH_FIRST:
  470. // MM-DD-YYYY
  471. iMonthCount = SameCharCount (pShortDate) ;
  472. pShortDate += iMonthCount ;
  473. DateSeparatorCount = SameCharCount (pShortDate) ;
  474. // get the separator string
  475. for (iIndex = 0; iIndex < DateSeparatorCount; iIndex ++) {
  476. szDateSeparator [iIndex] = *pShortDate++ ;
  477. }
  478. szDateSeparator [iIndex] = TEXT('\0') ;
  479. iDayCount = SameCharCount (pShortDate) ;
  480. pShortDate += iMonthCount + DateSeparatorCount ;
  481. YearCharCount = SameCharCount (pShortDate) ;
  482. if (iMonthCount == 2) {
  483. bFirstLeading = TRUE ;
  484. }
  485. if (iDayCount == 2) {
  486. bSecondLeading = TRUE ;
  487. }
  488. if (YearCharCount == 2) {
  489. bThirdLeading = TRUE ;
  490. }
  491. break ;
  492. case DAY_FIRST:
  493. // DD-MM-YYYY
  494. iDayCount = SameCharCount (pShortDate) ;
  495. pShortDate += iDayCount ;
  496. DateSeparatorCount = SameCharCount (pShortDate) ;
  497. // get the separator string
  498. for (iIndex = 0; iIndex < DateSeparatorCount; iIndex ++) {
  499. szDateSeparator [iIndex] = *pShortDate++ ;
  500. }
  501. szDateSeparator [iIndex] = TEXT('\0') ;
  502. iMonthCount = SameCharCount (pShortDate) ;
  503. pShortDate += iMonthCount + DateSeparatorCount ;
  504. YearCharCount = SameCharCount (pShortDate) ;
  505. if (iDayCount == 2) {
  506. bFirstLeading = TRUE ;
  507. }
  508. if (iMonthCount == 2) {
  509. bSecondLeading = TRUE ;
  510. }
  511. if (YearCharCount == 2) {
  512. bThirdLeading = TRUE ;
  513. }
  514. break ;
  515. }
  516. // now generate the date format
  517. lstrcpy (szDateFormat, bFirstLeading ? LeadingZeroStr : NoLeadingZeroStr) ;
  518. lstrcat (szDateFormat, szDateSeparator) ;
  519. lstrcat (szDateFormat, bSecondLeading ? LeadingZeroStr : NoLeadingZeroStr) ;
  520. lstrcat (szDateFormat, szDateSeparator) ;
  521. lstrcat (szDateFormat, bThirdLeading ? LeadingZeroStr : NoLeadingZeroStr) ;
  522. return TRUE ;
  523. }
  524. BOOL
  525. CreateTimeFormat (
  526. LPTSTR pTimeSeparator,
  527. int iLeadingZero
  528. )
  529. {
  530. // create the format to be used in SystemTimeTimeString
  531. if (iLeadingZero) {
  532. lstrcpy (szTimeFormat, LeadingZeroStr) ;
  533. } else {
  534. lstrcpy (szTimeFormat, NoLeadingZeroStr) ;
  535. }
  536. lstrcat (szTimeFormat, pTimeSeparator) ;
  537. lstrcat (szTimeFormat, LeadingZeroStr) ;
  538. lstrcat (szTimeFormat, pTimeSeparator) ;
  539. // lstrcat (szTimeFormat, LeadingZeroStr) ;
  540. // for the msec
  541. lstrcat (szTimeFormat, TEXT("%02.1f")) ;
  542. if (iTime == 0) {
  543. lstrcat (szTimeFormat, TEXT(" %s ")) ;
  544. }
  545. return TRUE ;
  546. }
  547. BOOL
  548. GetInternational()
  549. {
  550. TCHAR szShortDate[40] ;
  551. TCHAR szTime[40] ; // time separator
  552. DWORD RetCode ;
  553. int iTLZero = 0 ; // = 0 for no leading zero, <> 0 for leading zero
  554. CHAR aLanguageStr [2] ;
  555. LPSTR pRetStr ;
  556. // read the data from the win.ini (which i smapped to registry)
  557. RetCode = GetProfileString(szInternational,
  558. TEXT("sShortDate"), szShortDate, szShortDate, sizeof(szShortDate)/sizeof(TCHAR));
  559. if (RetCode) {
  560. RetCode = GetProfileString(szInternational,
  561. TEXT("sTime"), szTime, szTime, sizeof(szTime)/sizeof(TCHAR));
  562. }
  563. if (RetCode) {
  564. iTime = GetProfileInt(szInternational, TEXT("iTime"), iTime);
  565. iTLZero = GetProfileInt(szInternational, TEXT("iTLZero"), iTLZero);
  566. if (iTime == 0) {
  567. // get the AM PM strings for 12-hour format.
  568. // These two strings could be NULL.
  569. sz1159[0] = sz2359[0] = TEXT('\0') ;
  570. GetProfileString(szInternational,
  571. TEXT("s1159"), sz1159, sz1159, sizeof(sz1159)/sizeof(TCHAR));
  572. GetProfileString(szInternational,
  573. TEXT("s2359"), sz2359, sz2359, sizeof(sz2359)/sizeof(TCHAR));
  574. }
  575. }
  576. // create the two formats
  577. if (RetCode) {
  578. RetCode = (DWORD) CreateDateFormat (szShortDate) ;
  579. }
  580. if (RetCode) {
  581. RetCode = (DWORD) CreateTimeFormat (szTime, iTLZero) ;
  582. }
  583. // use the system default language numeric
  584. aLanguageStr[0] = '\0' ;
  585. pRetStr = setlocale(LC_NUMERIC, aLanguageStr);
  586. return (RetCode != 0) ;
  587. }
  588. // this routine is called to get the date/time formats either
  589. // for the resource or from the registry.
  590. void
  591. GetDateTimeFormats ()
  592. {
  593. if (!GetInternational()) {
  594. // GetInternational failed, then get default formats from resource
  595. iTime = 0 ;
  596. DateStyle = MONTH_FIRST ;
  597. YearCharCount = 4 ;
  598. StringLoad (IDS_S1159, sz1159) ;
  599. StringLoad (IDS_S2359, sz2359) ;
  600. StringLoad (IDS_TIME_FORMAT, szTimeFormat) ;
  601. StringLoad (IDS_SHORT_DATE_FORMAT, szDateFormat) ;
  602. }
  603. WindowInvalidate (PerfmonViewWindow()) ;
  604. // reset all the field taht may be affected by the
  605. // language numberic changes
  606. }
  607. void
  608. ConvertDecimalPoint (
  609. LPTSTR lpFloatPointStr
  610. )
  611. {
  612. if (szCurrentDecimal[0] == szDecimal[0]) {
  613. // no need to convert anything
  614. return ;
  615. }
  616. while (*lpFloatPointStr) {
  617. if (*lpFloatPointStr == szCurrentDecimal[0]) {
  618. *lpFloatPointStr = szDecimal[0] ;
  619. break ;
  620. }
  621. ++lpFloatPointStr ;
  622. }
  623. }
  624. void
  625. ReconvertDecimalPoint (
  626. LPTSTR lpFloatPointStr
  627. )
  628. {
  629. if (szCurrentDecimal[0] == szDecimal[0]) {
  630. // no need to convert anything
  631. return ;
  632. }
  633. while (*lpFloatPointStr) {
  634. if (*lpFloatPointStr == szDecimal[0]) {
  635. *lpFloatPointStr = szCurrentDecimal[0] ;
  636. break ;
  637. }
  638. ++lpFloatPointStr ;
  639. }
  640. }