home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 February / CMCD0205.ISO / Software / Shareware / Programare / flashplayer / Samples / WinApi / Demo / Demo.cpp next >
Encoding:
C/C++ Source or Header  |  2004-10-30  |  18.9 KB  |  569 lines

  1. //==================================================================================================
  2. // Includes
  3.  
  4. #include "stdafx.h"
  5. #include "Demo.h"
  6. #include <commdlg.h>
  7. #include <string>
  8.  
  9. //==================================================================================================
  10. // FlashPlayerControl
  11.  
  12. // FlashPlayerControl header
  13. #include "../../../FlashPlayerControl/include/FlashPlayerControl.h"
  14.  
  15. // FlashPlayerControl lib
  16. #pragma comment(lib, "../../../FlashPlayerControl/lib/FlashPlayerControl.lib")
  17.  
  18. //==================================================================================================
  19. // Typedefs
  20.  
  21. // To work with TCHAR strings
  22. typedef std::basic_string<TCHAR> tstring;
  23.  
  24. //==================================================================================================
  25. // Global Variables
  26.  
  27. // Current instance
  28. HINSTANCE g_hInstance;
  29. // FlashPlayerControl window handle
  30. HWND g_hwndFlashPlayerControl;
  31.  
  32. //==================================================================================================
  33. // Forward declarations
  34.  
  35. // Processes messages for the main window
  36. LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  37.  
  38. // Load resource helper
  39. void LoadResourceHelper( /* in */ LPCTSTR lpszName, 
  40.                          /* in */ LPCTSTR lpszType, 
  41.                          /* out */ LPVOID& lpData, 
  42.                          /* out */ DWORD& dwSize);
  43.  
  44. // Message handlers
  45. LRESULT OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  46. LRESULT OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  47. LRESULT OnDestroy(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  48. LRESULT OnSize(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  49.  
  50. // FlashPlayerControl specific message handlers
  51. LRESULT OnFSCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  52. LRESULT OnProgress(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  53. LRESULT OnReadyStateChange(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  54. LRESULT OnLoadExternalResource(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  55.  
  56. //==================================================================================================
  57. // Entry point
  58. int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
  59. {
  60.     // Store instance handle in our global variable
  61.     g_hInstance = hInstance;
  62.  
  63.     //==============================================================================================
  64.     // Main window class registration...BEGIN
  65.  
  66.     WNDCLASSEX wcex = { 0 };
  67.  
  68.     wcex.cbSize = sizeof(WNDCLASSEX); 
  69.  
  70.     wcex.style = CS_HREDRAW | CS_VREDRAW;
  71.     wcex.lpfnWndProc = &WndProc;
  72.     wcex.cbClsExtra    = 0;
  73.     wcex.cbWndExtra    = 0;
  74.     wcex.hInstance = g_hInstance;
  75.     wcex.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_DEMO));
  76.     wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
  77.     wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  78.     wcex.lpszMenuName = MAKEINTRESOURCE(IDC_DEMO);
  79.     wcex.lpszClassName = _T("DEMO");
  80.     wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
  81.  
  82.     RegisterClassEx(&wcex);
  83.  
  84.     // Main window class registration...BEGIN
  85.     //==============================================================================================
  86.  
  87.     //==============================================================================================
  88.     // FlashPlayerControl library initialization...BEGIN
  89.  
  90. #ifdef WITH_EMBEDDED_FLASH_OCX_CODE
  91.  
  92.     // swflash.ocx/flash.ocx embedding...
  93.  
  94.     LPVOID lpFlashOCXCodeData = NULL;
  95.     DWORD dwFlashOCXCodeSize = 0;
  96.  
  97.     LoadResourceHelper(_T("FLASHOCXCODE"), _T("BIN"), lpFlashOCXCodeData, dwFlashOCXCodeSize);
  98.  
  99.     if (!RegisterFlashWindowClassEx(lpFlashOCXCodeData, dwFlashOCXCodeSize))
  100.     {
  101.         MessageBox(NULL, _T("RegisterFlashWindowClass() failed"), _T("Error"), MB_OK | MB_ICONSTOP);
  102.         return FALSE;
  103.     }
  104.  
  105. #else
  106.  
  107.     if (!RegisterFlashWindowClass())
  108.     {
  109.         MessageBox(NULL, _T("RegisterFlashWindowClass() failed"), _T("Error"), MB_OK | MB_ICONSTOP);
  110.         return FALSE;
  111.     }
  112.  
  113. #endif // WITH_EMBEDDED_FLASH_OCX_CODE
  114.  
  115.     // FlashPlayerControl library initialization...END
  116.     //==============================================================================================
  117.  
  118.     //==============================================================================================
  119.     // Main window creating...BEGIN
  120.  
  121.     HWND hWnd;
  122.  
  123.     hWnd = 
  124.         CreateWindow(_T("DEMO"), 
  125.                      _T("DEMO"), 
  126.                      WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, 
  127.                      CW_USEDEFAULT, 
  128.                      0, 
  129.                      CW_USEDEFAULT, 
  130.                      0, 
  131.                      NULL, 
  132.                      NULL, 
  133.                      g_hInstance, 
  134.                      NULL);
  135.  
  136.     if (NULL == hWnd)
  137.         return FALSE;
  138.  
  139.     ShowWindow(hWnd, nCmdShow);
  140.     UpdateWindow(hWnd);
  141.  
  142.     // Main window creating...END
  143.     //==============================================================================================
  144.  
  145.     MSG msg = { 0 };
  146.     HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_DEMO));
  147.  
  148.     // Main message loop
  149.     while (GetMessage(&msg, NULL, 0, 0)) 
  150.     {
  151.         if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
  152.         {
  153.             TranslateMessage(&msg);
  154.             DispatchMessage(&msg);
  155.         }
  156.     }
  157.  
  158.     // FlashPlayerControl library deinitialization...BEGIN
  159.     UnregisterFlashWindowClass();
  160.  
  161.     return (int)msg.wParam;
  162. }
  163.  
  164. //==================================================================================================
  165. // Processes messages for the main window
  166. LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
  167. {
  168.     LRESULT lResult = 0;
  169.     BOOL bHandled = FALSE;
  170.  
  171.     switch (uMsg) 
  172.     {
  173.         case WM_COMMAND:
  174.         {
  175.             lResult = OnCommand(hWnd, wParam, lParam, bHandled);
  176.  
  177.             break;
  178.         }
  179.  
  180.         case WM_DESTROY:
  181.         {
  182.             lResult = OnDestroy(hWnd, wParam, lParam, bHandled);
  183.  
  184.             break;
  185.         }
  186.  
  187.         case WM_CREATE:
  188.         {
  189.             lResult = OnCreate(hWnd, wParam, lParam, bHandled);
  190.  
  191.             break;
  192.         }
  193.  
  194.         case WM_SIZE:
  195.         {
  196.             lResult = OnSize(hWnd, wParam, lParam, bHandled);
  197.  
  198.             break;
  199.         }
  200.  
  201.         case WM_NOTIFY:
  202.         {
  203.             NMHDR* pNMHDR = (NMHDR*)lParam;
  204.  
  205.             if (pNMHDR->hwndFrom == g_hwndFlashPlayerControl)
  206.             {
  207.                 switch (pNMHDR->code)
  208.                 {
  209.                     case FPCN_FSCOMMAND:
  210.                     {
  211.                         lResult = OnFSCommand(hWnd, wParam, lParam, bHandled);
  212.  
  213.                         break;
  214.                     }
  215.  
  216.                     case FPCN_ONPROGRESS:
  217.                     {
  218.                         lResult = OnProgress(hWnd, wParam, lParam, bHandled);
  219.  
  220.                         break;
  221.                     }
  222.  
  223.                     case FPCN_ONREADYSTATECHANGE:
  224.                     {
  225.                         lResult = OnReadyStateChange(hWnd, wParam, lParam, bHandled);
  226.  
  227.                         break;
  228.                     }
  229.  
  230.                     case FPCN_LOADEXTERNALRESOURCE:
  231.                     {
  232.                         lResult = OnLoadExternalResource(hWnd, wParam, lParam, bHandled);
  233.  
  234.                         break;
  235.                     }
  236.                 }
  237.             }
  238.         }
  239.  
  240.         break;
  241.     }
  242.  
  243.     if (!bHandled)
  244.         lResult = DefWindowProc(hWnd, uMsg, wParam, lParam);
  245.  
  246.     return lResult;
  247. }
  248. //==================================================================================================
  249.  
  250. //==================================================================================================
  251. // Load resource helper
  252. void LoadResourceHelper( /* in */ LPCTSTR lpszName, 
  253.                          /* in */ LPCTSTR lpszType, 
  254.                          /* out */ LPVOID& lpData, 
  255.                          /* out */ DWORD& dwSize)
  256. {
  257.     HMODULE hModule = GetModuleHandle(NULL);
  258.     HRSRC hResInfo = FindResource(hModule, lpszName, lpszType);
  259.     HGLOBAL hResData = LoadResource(hModule, hResInfo);
  260.     lpData = LockResource(hResData);
  261.     dwSize = SizeofResource(hModule, hResInfo);
  262. }
  263. //==================================================================================================
  264.  
  265. //==================================================================================================
  266. LRESULT OnCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  267. {
  268.     LRESULT lResult = 0;
  269.  
  270.     int wmId = LOWORD(wParam); 
  271.     int wmEvent = HIWORD(wParam); 
  272.  
  273.     // Parse the menu selections
  274.     switch (wmId)
  275.     {
  276.         case IDM_EXIT:
  277.         {
  278.             DestroyWindow(hWnd);
  279.             bHandled = TRUE;
  280.             break;
  281.         }
  282.  
  283.         case ID_FILE_OPEN:
  284.         {
  285.             DWORD dwOPENFILENAMESize;
  286.  
  287.         #if (defined(WINVER) && (_WIN32_WINNT >= 0x0500))
  288.             OSVERSIONINFO vi;
  289.             ZeroMemory(&vi, sizeof(OSVERSIONINFO));
  290.             vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  291.             ::GetVersionEx(&vi);
  292.             // if running under NT and version is >= 5
  293.             if (vi.dwPlatformId == VER_PLATFORM_WIN32_NT && vi.dwMajorVersion >= 5)
  294.                 dwOPENFILENAMESize = sizeof(OPENFILENAME);
  295.             else
  296.                 dwOPENFILENAMESize = OPENFILENAME_SIZE_VERSION_400;
  297.         #else
  298.                 dwOPENFILENAMESize = sizeof(OPENFILENAME);
  299.         #endif // defined(WINVER) && (_WIN32_WINNT >= 0x0500)
  300.  
  301.             OPENFILENAME* pOpenFileName = (OPENFILENAME*)new char[dwOPENFILENAMESize];
  302.             ZeroMemory(pOpenFileName, dwOPENFILENAMESize);
  303.  
  304.             TCHAR lpszFilePath[_MAX_PATH] = { 0 };
  305.  
  306.             pOpenFileName->lStructSize = dwOPENFILENAMESize;
  307.             pOpenFileName->hwndOwner = hWnd;
  308.             pOpenFileName->lpstrFilter = _T("Flash movie files (*.swf)\0*.swf\0All files (*.*)\0*.*\0\0");
  309.             pOpenFileName->lpstrFile = lpszFilePath;
  310.             pOpenFileName->nMaxFile = _MAX_PATH + 1;
  311.             pOpenFileName->Flags = OFN_ENABLESIZING;
  312.             pOpenFileName->lpstrDefExt = _T("swf");
  313.  
  314.             if (GetOpenFileName(pOpenFileName))
  315.             {
  316.                 SFPCPutMovie SFPCPutMovie;
  317.  
  318.                 SFPCPutMovie.lpszBuffer = pOpenFileName->lpstrFile;
  319.  
  320.                 ::SendMessage(g_hwndFlashPlayerControl, FPCM_PUT_MOVIE, 0, (LPARAM)&SFPCPutMovie);
  321.             }
  322.  
  323.             delete[] (char*)pOpenFileName;
  324.  
  325.             bHandled = TRUE;
  326.  
  327.             break;
  328.         }
  329.     }
  330.  
  331.     return lResult;
  332. }
  333. //==================================================================================================
  334.  
  335. //==================================================================================================
  336. LRESULT OnCreate(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  337. {
  338.     // Client area
  339.     RECT rc = { 0 };
  340.     GetClientRect(hWnd, &rc);
  341.  
  342.     g_hwndFlashPlayerControl = 
  343.         CreateWindow(WC_FLASH, 
  344.                      NULL, 
  345.                      WS_CHILD | WS_VISIBLE, 
  346.                      rc.left, 
  347.                      rc.top, 
  348.                      rc.right - rc.left, 
  349.                      rc.bottom - rc.top, 
  350.                      hWnd, 
  351.                      NULL, 
  352.                      g_hInstance, 
  353.                      NULL);
  354.  
  355.     // Loading movie from the resource
  356.     LPVOID lpMovieData = NULL;
  357.     DWORD dwMovieSize = 0;
  358.  
  359.     LoadResourceHelper(_T("MOVIE1"), _T("MOVIE"), lpMovieData, dwMovieSize);
  360.  
  361.     SFPCPutMovieFromMemory SFPCPutMovieFromMemory = { 0 };
  362.  
  363.     SFPCPutMovieFromMemory.dwSize = dwMovieSize;
  364.     SFPCPutMovieFromMemory.lpData = lpMovieData;
  365.  
  366.     ::SendMessage(g_hwndFlashPlayerControl, FPCM_PUTMOVIEFROMMEMORY, 0, (LPARAM)&SFPCPutMovieFromMemory);
  367.  
  368.     bHandled = TRUE;
  369.  
  370.     return 0;
  371. }
  372. //==================================================================================================
  373.  
  374. //==================================================================================================
  375. LRESULT OnDestroy(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  376. {
  377.     PostQuitMessage(0);
  378.  
  379.     bHandled = TRUE;
  380.  
  381.     return 0;
  382. }
  383. //==================================================================================================
  384.  
  385. //==================================================================================================
  386. LRESULT OnSize(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  387. {
  388.     if (NULL != g_hwndFlashPlayerControl)
  389.     {
  390.         RECT rc;
  391.         GetClientRect(hWnd, &rc);
  392.  
  393.         MoveWindow(g_hwndFlashPlayerControl, 0, 0, rc.right, rc.bottom, TRUE);
  394.     }
  395.  
  396.     bHandled = TRUE;
  397.  
  398.     return 0;
  399. }
  400. //==================================================================================================
  401.  
  402. //==================================================================================================
  403. LRESULT OnFSCommand(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  404. {
  405.     SFPCFSCommandInfoStruct* pInfo = (SFPCFSCommandInfoStruct*)lParam;
  406.     tstring strText = _T("command: \"");
  407.     strText += pInfo->command;
  408.     strText += _T("\"");
  409.     strText += _T("\nargs: \"");
  410.     strText += pInfo->args;
  411.     strText += _T("\"");
  412.  
  413.     MessageBox(hWnd, strText.c_str(), _T("FSCommand()"), MB_OK | MB_ICONINFORMATION);
  414.  
  415.     bHandled = TRUE;
  416.  
  417.     return 0;
  418. }
  419. //==================================================================================================
  420.  
  421. //==================================================================================================
  422. LRESULT OnProgress(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  423. {
  424.     SFPCOnProgressInfoStruct* pInfo = (SFPCOnProgressInfoStruct*)lParam;
  425.  
  426.     TCHAR lpszBuffer[1024];
  427.     _sntprintf(lpszBuffer, sizeof(lpszBuffer) - 1, _T("FPCN_ONPROGRESS, percentDone: %d\n"), pInfo->percentDone);
  428.  
  429. //    MessageBox(hWnd, lpszBuffer, _T("OnProgress()"), MB_OK | MB_ICONINFORMATION);
  430.     OutputDebugString(lpszBuffer);
  431.  
  432.     bHandled = TRUE;
  433.  
  434.     return 0;
  435. }
  436. //==================================================================================================
  437.  
  438. //==================================================================================================
  439. LRESULT OnReadyStateChange(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  440. {
  441.     SFPCOnReadyStateChangeInfoStruct* pInfo = (SFPCOnReadyStateChangeInfoStruct*)lParam;
  442.  
  443.     TCHAR lpszBuffer[1024];
  444.     _sntprintf(lpszBuffer, sizeof(lpszBuffer) - 1, _T("FPCN_ONREADYSTATECHANGE, newState: %d\n"), pInfo->newState);
  445.  
  446. //    MessageBox(hWnd, lpszBuffer, _T("OnReadyStateChange()"), MB_OK | MB_ICONINFORMATION);
  447.     OutputDebugString(lpszBuffer);
  448.  
  449.     bHandled = TRUE;
  450.  
  451.     return 0;
  452. }
  453. //==================================================================================================
  454.  
  455. //==================================================================================================
  456. LRESULT OnLoadExternalResource(HWND hWnd, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  457. {
  458.     LPVOID lpResourceData = NULL;
  459.     DWORD dwResourceSize = 0;
  460.  
  461.     SFPCLoadExternalResource* pInfo = (SFPCLoadExternalResource*)lParam;
  462.  
  463.     if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/embedded_image1.jpg")))
  464.     {
  465.         LoadResourceHelper(_T("IMAGE1"), _T("IMAGE"), lpResourceData, dwResourceSize);
  466.  
  467.         ULONG ulWritten;
  468.         pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  469.     }
  470.     else if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/embedded_image2.jpg")))
  471.     {
  472.         LoadResourceHelper(_T("IMAGE2"), _T("IMAGE"), lpResourceData, dwResourceSize);
  473.  
  474.         ULONG ulWritten;
  475.         pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  476.     }
  477.     else if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/embedded_image3.jpg")))
  478.     {
  479.         LoadResourceHelper(_T("IMAGE3"), _T("IMAGE"), lpResourceData, dwResourceSize);
  480.  
  481.         ULONG ulWritten;
  482.         pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  483.     }
  484.     else if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/embedded_image4.jpg")))
  485.     {
  486.         LoadResourceHelper(_T("IMAGE4"), _T("IMAGE"), lpResourceData, dwResourceSize);
  487.  
  488.         ULONG ulWritten;
  489.         pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  490.     }
  491.     else if (0 == lstrcmpi(pInfo->lpszRelativePath, _T("/images/embedded_image5.jpg")))
  492.     {
  493.         LoadResourceHelper(_T("IMAGE5"), _T("IMAGE"), lpResourceData, dwResourceSize);
  494.  
  495.         ULONG ulWritten;
  496.         pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  497.     }
  498.     else
  499.     {
  500.         DWORD dwOPENFILENAMESize;
  501.  
  502.     #if (defined(WINVER) && (_WIN32_WINNT >= 0x0500))
  503.         OSVERSIONINFO vi;
  504.         ZeroMemory(&vi, sizeof(OSVERSIONINFO));
  505.         vi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  506.         ::GetVersionEx(&vi);
  507.         // if running under NT and version is >= 5
  508.         if (vi.dwPlatformId == VER_PLATFORM_WIN32_NT && vi.dwMajorVersion >= 5)
  509.             dwOPENFILENAMESize = sizeof(OPENFILENAME);
  510.         else
  511.             dwOPENFILENAMESize = OPENFILENAME_SIZE_VERSION_400;
  512.     #else
  513.             dwOPENFILENAMESize = sizeof(OPENFILENAME);
  514.     #endif // defined(WINVER) && (_WIN32_WINNT >= 0x0500)
  515.  
  516.         OPENFILENAME* pOpenFileName = (OPENFILENAME*)new char[dwOPENFILENAMESize];
  517.         ZeroMemory(pOpenFileName, dwOPENFILENAMESize);
  518.  
  519.         TCHAR lpszFilePath[_MAX_PATH] = { 0 };
  520.  
  521.         pOpenFileName->lStructSize = dwOPENFILENAMESize;
  522.         pOpenFileName->hwndOwner = hWnd;
  523.         pOpenFileName->lpstrFilter = _T("JPEG (*.jpg, *.jpeg)\0*.jpg;*.jpeg\0All files (*.*)\0*.*\0\0");
  524.         pOpenFileName->lpstrFile = lpszFilePath;
  525.         pOpenFileName->nMaxFile = _MAX_PATH + 1;
  526.         pOpenFileName->Flags = OFN_ENABLESIZING;
  527.         pOpenFileName->lpstrDefExt = _T("jpg");
  528.  
  529.         if (GetOpenFileName(pOpenFileName))
  530.         {
  531.             HANDLE hFile = 
  532.                 CreateFile(pOpenFileName->lpstrFile, 
  533.                            GENERIC_READ, 
  534.                            FILE_SHARE_READ, 
  535.                            NULL, 
  536.                            OPEN_EXISTING, 
  537.                            0, 
  538.                            NULL);
  539.  
  540.             if (INVALID_HANDLE_VALUE != hFile)
  541.             {
  542.                 HANDLE hFileMapping = 
  543.                     CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
  544.  
  545.                 lpResourceData = 
  546.                     MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0);
  547.                 dwResourceSize = 
  548.                     GetFileSize(hFile, NULL);
  549.  
  550.                 ULONG ulWritten;
  551.                 pInfo->lpStream->Write(lpResourceData, dwResourceSize, &ulWritten);
  552.  
  553.                 UnmapViewOfFile(lpResourceData);
  554.  
  555.                 CloseHandle(hFileMapping);
  556.             }
  557.  
  558.             CloseHandle(hFile);
  559.         }
  560.  
  561.         delete[] (char*)pOpenFileName;
  562.     }
  563.  
  564.     bHandled = TRUE;
  565.  
  566.     return 0;
  567. }
  568. //==================================================================================================
  569.