]> cvs.zerfleddert.de Git - linexec-j720/blobdiff - tester1.cpp
multi-language search-paths
[linexec-j720] / tester1.cpp
index fe629ba82bb4c7e1595f664882799e4027edc2e3..25571b5039229edabd6ab72683d408041382f3c0 100644 (file)
@@ -22,7 +22,7 @@ LRESULT CALLBACK      WndProc                 (HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK       About                   (HWND, UINT, WPARAM, LPARAM);
 HWND                           CreateRpCommandBar(HWND);
 
 LRESULT CALLBACK       About                   (HWND, UINT, WPARAM, LPARAM);
 HWND                           CreateRpCommandBar(HWND);
 
-\r
+
 #pragma warning(disable: 4100 4710 4189; error: 4701)
 /* who cares?! 
        4100: whining about parameters not being used.
 #pragma warning(disable: 4100 4710 4189; error: 4701)
 /* who cares?! 
        4100: whining about parameters not being used.
@@ -30,7 +30,7 @@ HWND                          CreateRpCommandBar(HWND);
        4189: initialized but not used. make that an error: later.
        4701: usage w/o initialization.
        */
        4189: initialized but not used. make that an error: later.
        4701: usage w/o initialization.
        */
-\r
+
 int WINAPI WinMain(    HINSTANCE hInstance,
                                        HINSTANCE hPrevInstance,
                                        LPTSTR    lpCmdLine,
 int WINAPI WinMain(    HINSTANCE hInstance,
                                        HINSTANCE hPrevInstance,
                                        LPTSTR    lpCmdLine,
@@ -87,42 +87,42 @@ ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
 
        return RegisterClass(&wc);
 }
 
        return RegisterClass(&wc);
 }
-\r
-HANDLE OpenCOM1() {\r
-\r
-       static HANDLE COM1handle = INVALID_HANDLE_VALUE;\r
-       const char msg[] = "\r\n--------linexec--------\r\n";\r
-       unsigned long wrote;\r
-       int speed = CBR_115200;\r
-       HANDLE h;\r
-\r
-       if (COM1handle != INVALID_HANDLE_VALUE)\r
-               return (COM1handle);\r
-\r
-       h = CreateFile(TEXT("COM1:"),\r
-           GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,\r
-           NULL);\r
-       if (h == INVALID_HANDLE_VALUE)\r
-               return (h);\r
-\r
-       DCB dcb;\r
-       if (!GetCommState(h, &dcb))\r
-               goto bad;\r
-\r
-       dcb.BaudRate = speed;\r
-       if (!SetCommState(h, &dcb))\r
-               goto bad;\r
-\r
-       // Print banner on serial console.\r
-       WriteFile(h, msg, sizeof msg, &wrote, 0);\r
-\r
-       COM1handle = h;\r
-\r
-       return (h);\r
- bad:\r
-       CloseHandle(h);\r
-       return (INVALID_HANDLE_VALUE);\r
-}\r
+
+HANDLE OpenCOM1() {
+
+       static HANDLE COM1handle = INVALID_HANDLE_VALUE;
+       const char msg[] = "\r\n--------linexec--------\r\n";
+       unsigned long wrote;
+       int speed = CBR_115200;
+       HANDLE h;
+
+       if (COM1handle != INVALID_HANDLE_VALUE)
+               return (COM1handle);
+
+       h = CreateFile(TEXT("COM1:"),
+           GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0,
+           NULL);
+       if (h == INVALID_HANDLE_VALUE)
+               return (h);
+
+       DCB dcb;
+       if (!GetCommState(h, &dcb))
+               goto bad;
+
+       dcb.BaudRate = speed;
+       if (!SetCommState(h, &dcb))
+               goto bad;
+
+       // Print banner on serial console.
+       WriteFile(h, msg, sizeof msg, &wrote, 0);
+
+       COM1handle = h;
+
+       return (h);
+ bad:
+       CloseHandle(h);
+       return (INVALID_HANDLE_VALUE);
+}
 
 //
 //  FUNCTION: InitInstance(HANDLE, int)
 
 //
 //  FUNCTION: InitInstance(HANDLE, int)
@@ -137,15 +137,15 @@ HANDLE OpenCOM1() {
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
 
 BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 {
-       HWND    hWnd = NULL;\r
-       TCHAR   szTitle[MAX_LOADSTRING];                        // The title bar text\r
+       HWND    hWnd = NULL;
+       TCHAR   szTitle[MAX_LOADSTRING];                        // The title bar text
        TCHAR   szWindowClass[MAX_LOADSTRING];          // The window class name
        TCHAR   szWindowClass[MAX_LOADSTRING];          // The window class name
-\r
-       hInst = hInstance;              // Store instance handle in our global variable\r
-       // Initialize global string\r
-       LoadString(hInstance, IDC_TESTER1, szWindowClass, MAX_LOADSTRING);\r
+
+       hInst = hInstance;              // Store instance handle in our global variable
+       // Initialize global string
+       LoadString(hInstance, IDC_TESTER1, szWindowClass, MAX_LOADSTRING);
        LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
        LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
-\r
+
        //If it is already running, then focus on the window
        hWnd = FindWindow(szWindowClass, szTitle);      
        if (hWnd) 
        //If it is already running, then focus on the window
        hWnd = FindWindow(szWindowClass, szTitle);      
        if (hWnd) 
@@ -158,11 +158,14 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
        
        RECT    rect;
        GetClientRect(hWnd, &rect);
        
        RECT    rect;
        GetClientRect(hWnd, &rect);
-\r
+
        OpenCOM1();
        load_boot("\\My Documents\\params.txt");
        load_boot("\\Storage Card\\params.txt");
        OpenCOM1();
        load_boot("\\My Documents\\params.txt");
        load_boot("\\Storage Card\\params.txt");
-       load_boot("\\ÒÓØ ¶°ÄÞ\\params.txt");\r
+       load_boot("\\Speicherkarte\\params.txt");
+       load_boot("\\Carte de stockage\\params.txt");
+       load_boot("\\Mes documents\\params.txt");
+       load_boot("\\ÒÓØ ¶°ÄÞ\\params.txt");
 
        hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
 
        hWnd = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
                CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
@@ -203,187 +206,187 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 //
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
 //
 LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
-\r
+
        HDC hdc;
        HDC hdc;
-\r
+
        int wmId, wmEvent;
        int wmId, wmEvent;
-\r
+
        PAINTSTRUCT ps;
        PAINTSTRUCT ps;
-\r
+
        TCHAR szHello[MAX_LOADSTRING];
        TCHAR szHello[MAX_LOADSTRING];
-\r
 
 
-\r
+
+
        switch (message) 
        switch (message) 
-\r
+
        {
        {
-\r
+
                case WM_COMMAND:
                case WM_COMMAND:
-\r
+
                        wmId    = LOWORD(wParam); 
                        wmId    = LOWORD(wParam); 
-\r
+
                        wmEvent = HIWORD(wParam); 
                        wmEvent = HIWORD(wParam); 
-\r
+
                        // Parse the menu selections:
                        // Parse the menu selections:
-\r
+
                        switch (wmId)
                        switch (wmId)
-\r
+
                        {       
                        {       
-\r
+
                                case IDM_HELP_ABOUT:
                                case IDM_HELP_ABOUT:
-\r
+
                                        DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
                                        DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
-\r
+
                                    break;
                                    break;
-\r
+
                                case IDOK:
                                case IDOK:
-\r
+
                                        SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
                                        SendMessage(hWnd, WM_ACTIVATE, MAKEWPARAM(WA_INACTIVE, 0), (LPARAM)hWnd);
-\r
+
                                        SendMessage (hWnd, WM_CLOSE, 0, 0);
                                        SendMessage (hWnd, WM_CLOSE, 0, 0);
-\r
+
                                        break;
                                        break;
-\r
+
                                default:
                                default:
-\r
+
                                   return DefWindowProc(hWnd, message, wParam, lParam);
                                   return DefWindowProc(hWnd, message, wParam, lParam);
-\r
+
                        }
                        }
-\r
+
                        break;
                        break;
-\r
+
                case WM_CREATE:
                case WM_CREATE:
-\r
+
                        hwndCB = CreateRpCommandBar(hWnd);
                        hwndCB = CreateRpCommandBar(hWnd);
-\r
+
                        break;
                        break;
-\r
+
                case WM_PAINT:
                case WM_PAINT:
-\r
+
                        RECT rt;
                        RECT rt;
-\r
+
                        hdc = BeginPaint(hWnd, &ps);
                        hdc = BeginPaint(hWnd, &ps);
-\r
+
                        GetClientRect(hWnd, &rt);
                        GetClientRect(hWnd, &rt);
-\r
+
                        LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
                        LoadString(hInst, IDS_HELLO, szHello, MAX_LOADSTRING);
-\r
+
                        DrawText(hdc, szHello, _tcslen(szHello), &rt, 
                        DrawText(hdc, szHello, _tcslen(szHello), &rt, 
-\r
+
                                DT_SINGLELINE | DT_VCENTER | DT_CENTER);
                                DT_SINGLELINE | DT_VCENTER | DT_CENTER);
-\r
+
                        EndPaint(hWnd, &ps);
                        EndPaint(hWnd, &ps);
-\r
+
                        break; 
                        break; 
-\r
+
                case WM_DESTROY:
                case WM_DESTROY:
-\r
+
                        CommandBar_Destroy(hwndCB);
                        CommandBar_Destroy(hwndCB);
-\r
+
                        PostQuitMessage(0);
                        PostQuitMessage(0);
-\r
+
                        break;
                        break;
-\r
+
                case WM_SETTINGCHANGE:
                case WM_SETTINGCHANGE:
-\r
+
 //                     SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
 //                     SHHandleWMSettingChange(hWnd, wParam, lParam, &s_sai);
-\r
+
                break;
                break;
-\r
+
                default:
                default:
-\r
+
                        return DefWindowProc(hWnd, message, wParam, lParam);
                        return DefWindowProc(hWnd, message, wParam, lParam);
-\r
+
    }
    }
-\r
+
    return 0;
    return 0;
-\r
+
 }
 }
-\r
 
 
-\r
+
+
 HWND CreateRpCommandBar(HWND hwnd)
 HWND CreateRpCommandBar(HWND hwnd)
-\r
+
 {
 {
-/*\r
+/*
        SHMENUBARINFO mbi;
        SHMENUBARINFO mbi;
-\r
 
 
-\r
+
+
        memset(&mbi, 0, sizeof(SHMENUBARINFO));
        memset(&mbi, 0, sizeof(SHMENUBARINFO));
-\r
+
        mbi.cbSize     = sizeof(SHMENUBARINFO);
        mbi.cbSize     = sizeof(SHMENUBARINFO);
-\r
+
        mbi.hwndParent = hwnd;
        mbi.hwndParent = hwnd;
-\r
+
        mbi.nToolBarId = IDM_MENU;
        mbi.nToolBarId = IDM_MENU;
-\r
+
        mbi.hInstRes   = hInst;
        mbi.hInstRes   = hInst;
-\r
+
        mbi.nBmpId     = 0;
        mbi.nBmpId     = 0;
-\r
+
        mbi.cBmpImages = 0;
        mbi.cBmpImages = 0;
-\r
 
 
-\r
+
+
        if (!SHCreateMenuBar(&mbi)) 
        if (!SHCreateMenuBar(&mbi)) 
-\r
+
                return NULL;
                return NULL;
-\r
 
 
-\r
+
+
        return mbi.hwndMB;
        return mbi.hwndMB;
-*/\r
-       return NULL;\r
+*/
+       return NULL;
 }
 }
-\r
 
 
-\r
+
+
 // Mesage handler for the About box.
 // Mesage handler for the About box.
-\r
+
 LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
-\r
+
 {
 {
-\r
+
 //     SHINITDLGINFO shidi;
 //     SHINITDLGINFO shidi;
-\r
 
 
-\r
+
+
        switch (message)
        switch (message)
-\r
+
        {
        {
-\r
+
                case WM_INITDIALOG:
                case WM_INITDIALOG:
-\r
+
                        // Create a Done button and size it.  
                        // Create a Done button and size it.  
-\r
+
 //                     shidi.dwMask = SHIDIM_FLAGS;
 //                     shidi.dwMask = SHIDIM_FLAGS;
-\r
+
 //                      shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
 //                      shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFULLSCREEN;
-\r
+
 //                     shidi.hDlg = hDlg;
 //                     shidi.hDlg = hDlg;
-\r
+
 //                     SHInitDialog(&shidi);
 //                     SHInitDialog(&shidi);
-\r
+
                        return TRUE; 
                        return TRUE; 
-\r
 
 
-\r
+
+
                case WM_COMMAND:
                case WM_COMMAND:
-\r
+
                        if (LOWORD(wParam) == IDOK) {
                        if (LOWORD(wParam) == IDOK) {
-\r
+
                                EndDialog(hDlg, LOWORD(wParam));
                                EndDialog(hDlg, LOWORD(wParam));
-\r
+
                                return TRUE;
                                return TRUE;
-\r
+
                        }
                        }
-\r
+
                        break;
                        break;
-\r
+
        }
        }
-\r
+
     return FALSE;
     return FALSE;
-\r
+
 }
 }
-\r
+
Impressum, Datenschutz