[Herecast-commit] herecast/src/HerecastXP HerecastXP.cpp,1.13,1.14
Status: Beta
Brought to you by:
mdpaciga
|
From: Mark P. <mdp...@us...> - 2005-07-21 20:01:21
|
Update of /cvsroot/herecast/herecast/src/HerecastXP In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19688/src/HerecastXP Modified Files: HerecastXP.cpp Log Message: replaced tabs with spaces so it looks the same in any text editor Index: HerecastXP.cpp =================================================================== RCS file: /cvsroot/herecast/herecast/src/HerecastXP/HerecastXP.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** HerecastXP.cpp 14 Dec 2004 09:29:36 -0000 1.13 --- HerecastXP.cpp 21 Jul 2005 20:01:10 -0000 1.14 *************** *** 18,32 **** // Global Variables: ! HINSTANCE hInst; // current instance ! TCHAR szTitle[MAX_LOADSTRING]; // The title bar text ! TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name Location *g_Location; DWORD g_status; // Forward declarations of functions included in this code module: ! ATOM MyRegisterClass(HINSTANCE hInstance); ! BOOL InitInstance(HINSTANCE, int); ! LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ! LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); VOID doScan(HWND hWnd); --- 18,32 ---- // Global Variables: ! HINSTANCE hInst; // current instance ! TCHAR szTitle[MAX_LOADSTRING]; // The title bar text ! TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name Location *g_Location; DWORD g_status; // Forward declarations of functions included in this code module: ! ATOM MyRegisterClass(HINSTANCE hInstance); ! BOOL InitInstance(HINSTANCE, int); ! LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ! LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); VOID doScan(HWND hWnd); *************** *** 36,67 **** int nCmdShow) { ! // TODO: Place code here. ! MSG msg; ! HACCEL hAccelTable; // Initialize global strings ! LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); ! LoadString(hInstance, IDC_HERECAST, szWindowClass, MAX_LOADSTRING); ! MyRegisterClass(hInstance); ! // Perform application initialization: ! if (!InitInstance (hInstance, nCmdShow)) ! { ! return FALSE; ! } ! hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_HERECAST); ! // Main message loop: ! while (GetMessage(&msg, NULL, 0, 0)) ! { ! if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) ! { ! TranslateMessage(&msg); ! DispatchMessage(&msg); ! } ! } ! return (int) msg.wParam; } --- 36,67 ---- int nCmdShow) { ! // TODO: Place code here. ! MSG msg; ! HACCEL hAccelTable; // Initialize global strings ! LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); ! LoadString(hInstance, IDC_HERECAST, szWindowClass, MAX_LOADSTRING); ! MyRegisterClass(hInstance); ! // Perform application initialization: ! if (!InitInstance (hInstance, nCmdShow)) ! { ! return FALSE; ! } ! hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_HERECAST); ! // Main message loop: ! while (GetMessage(&msg, NULL, 0, 0)) ! { ! if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) ! { ! TranslateMessage(&msg); ! DispatchMessage(&msg); ! } ! } ! return (int) msg.wParam; } *************** *** 83,103 **** ATOM MyRegisterClass(HINSTANCE hInstance) { ! WNDCLASSEX wcex; ! wcex.cbSize = sizeof(WNDCLASSEX); ! wcex.style = CS_HREDRAW | CS_VREDRAW; ! wcex.lpfnWndProc = (WNDPROC)WndProc; ! wcex.cbClsExtra = 0; ! wcex.cbWndExtra = 0; ! wcex.hInstance = hInstance; ! wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_DISPLAYICON); ! wcex.hCursor = LoadCursor(NULL, IDC_ARROW); ! wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); ! wcex.lpszMenuName = 0; //(LPCTSTR)IDM_LOCATION; ! wcex.lpszClassName = szWindowClass; ! wcex.hIconSm = NULL; //it auto-selects the small icon ok ! return RegisterClassEx(&wcex); } --- 83,103 ---- ATOM MyRegisterClass(HINSTANCE hInstance) { ! WNDCLASSEX wcex; ! wcex.cbSize = sizeof(WNDCLASSEX); ! wcex.style = CS_HREDRAW | CS_VREDRAW; ! wcex.lpfnWndProc = (WNDPROC)WndProc; ! wcex.cbClsExtra = 0; ! wcex.cbWndExtra = 0; ! wcex.hInstance = hInstance; ! wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_DISPLAYICON); ! wcex.hCursor = LoadCursor(NULL, IDC_ARROW); ! wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); ! wcex.lpszMenuName = 0; //(LPCTSTR)IDM_LOCATION; ! wcex.lpszClassName = szWindowClass; ! wcex.hIconSm = NULL; //it auto-selects the small icon ok ! return RegisterClassEx(&wcex); } *************** *** 169,178 **** g_Location->scan(); g_Location->checkUploadNeeded(); ! PTCHAR acMessage; BOOL isReliable; acMessage = g_Location->toString(&g_status, &isReliable); ! if (wcscmp(acMessage, acPrevMessage)) { ! wcscpy(acPrevMessage, acMessage); WORD iconId = IDI_SMALLICON; --- 169,178 ---- g_Location->scan(); g_Location->checkUploadNeeded(); ! PTCHAR acMessage; BOOL isReliable; acMessage = g_Location->toString(&g_status, &isReliable); ! if (wcscmp(acMessage, acPrevMessage)) { ! wcscpy(acPrevMessage, acMessage); WORD iconId = IDI_SMALLICON; *************** *** 203,238 **** // PURPOSE: Processes messages for the main window. // ! // WM_COMMAND - process the application menu ! // WM_PAINT - Paint the main window ! // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { ! int wmId, wmEvent; POINT lpClickPoint; HMENU hPopMenu; ! PAINTSTRUCT ps; ! HDC hdc; ! switch (message) ! { case WM_CREATE: SetTimer(hWnd, ID_TIMER_UPDATE, UPDATE_INTERVAL_MS, NULL); break; ! case WM_COMMAND: ! wmId = LOWORD(wParam); ! wmEvent = HIWORD(wParam); ! // Parse the menu selections: ! switch (wmId) ! { ! //case IDM_ABOUT: ! // DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); ! // break; ! case IDM_LOCATION: g_Location->click(); break; ! case IDM_SCANNER: dlgScanner2_create(hInst, SW_SHOW); break; --- 203,238 ---- // PURPOSE: Processes messages for the main window. // ! // WM_COMMAND - process the application menu ! // WM_PAINT - Paint the main window ! // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { ! int wmId, wmEvent; POINT lpClickPoint; HMENU hPopMenu; ! PAINTSTRUCT ps; ! HDC hdc; ! switch (message) ! { case WM_CREATE: SetTimer(hWnd, ID_TIMER_UPDATE, UPDATE_INTERVAL_MS, NULL); break; ! case WM_COMMAND: ! wmId = LOWORD(wParam); ! wmEvent = HIWORD(wParam); ! // Parse the menu selections: ! switch (wmId) ! { ! //case IDM_ABOUT: ! // DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); ! // break; ! case IDM_LOCATION: g_Location->click(); break; ! case IDM_SCANNER: dlgScanner2_create(hInst, SW_SHOW); break; *************** *** 243,249 **** dlgOptions_create(hInst, hWnd); break; ! case IDM_EXIT: ! DestroyWindow(hWnd); ! break; case IDMSG_ADD_SUBSCRIPTION: { SubscriptionAgent *pSA = SubscriptionAgent::instance(); --- 243,249 ---- dlgOptions_create(hInst, hWnd); break; ! case IDM_EXIT: ! DestroyWindow(hWnd); ! break; case IDMSG_ADD_SUBSCRIPTION: { SubscriptionAgent *pSA = SubscriptionAgent::instance(); *************** *** 251,258 **** return TRUE; } ! default: ! return DefWindowProc(hWnd, message, wParam, lParam); ! } ! break; case WM_TIMER: --- 251,258 ---- return TRUE; } ! default: ! return DefWindowProc(hWnd, message, wParam, lParam); ! } ! break; case WM_TIMER: *************** *** 264,270 **** case WM_LBUTTONDOWN: // to open the GUI of the Application g_Location->click(); ! return TRUE; ! case WM_RBUTTONDOWN: WindowsUtils_ResetLastNotificationURL(); GetCursorPos(&lpClickPoint); --- 264,270 ---- case WM_LBUTTONDOWN: // to open the GUI of the Application g_Location->click(); ! return TRUE; ! case WM_RBUTTONDOWN: WindowsUtils_ResetLastNotificationURL(); GetCursorPos(&lpClickPoint); *************** *** 278,283 **** AppendMenu(hPopMenu,MF_SEPARATOR,0,TEXT("")); AppendMenu(hPopMenu,MF_STRING,IDM_EXIT,TEXT("E&xit")); ! ! //workaround for microsoft bug, to hide menu w/o selecting SetForegroundWindow(hWnd); TrackPopupMenu(hPopMenu,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_BOTTOMALIGN,lpClickPoint.x, lpClickPoint.y,0,hWnd,NULL); --- 278,283 ---- AppendMenu(hPopMenu,MF_SEPARATOR,0,TEXT("")); AppendMenu(hPopMenu,MF_STRING,IDM_EXIT,TEXT("E&xit")); ! ! //workaround for microsoft bug, to hide menu w/o selecting SetForegroundWindow(hWnd); TrackPopupMenu(hPopMenu,TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_BOTTOMALIGN,lpClickPoint.x, lpClickPoint.y,0,hWnd,NULL); *************** *** 314,323 **** break; ! case WM_PAINT: ! hdc = BeginPaint(hWnd, &ps); ! EndPaint(hWnd, &ps); ! break; ! case WM_DESTROY: NOTIFYICONDATA nid; nid.cbSize = sizeof(NOTIFYICONDATA); --- 314,323 ---- break; ! case WM_PAINT: ! hdc = BeginPaint(hWnd, &ps); ! EndPaint(hWnd, &ps); ! break; ! case WM_DESTROY: NOTIFYICONDATA nid; nid.cbSize = sizeof(NOTIFYICONDATA); *************** *** 327,337 **** KillTimer(hWnd, ID_TIMER_UPDATE); ! PostQuitMessage(0); ! break; ! default: ! return DefWindowProc(hWnd, message, wParam, lParam); ! } ! return 0; } --- 327,337 ---- KillTimer(hWnd, ID_TIMER_UPDATE); ! PostQuitMessage(0); ! break; ! default: ! return DefWindowProc(hWnd, message, wParam, lParam); ! } ! return 0; } *************** *** 339,355 **** LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { ! switch (message) ! { ! case WM_INITDIALOG: ! return TRUE; ! case WM_COMMAND: ! if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) ! { ! EndDialog(hDlg, LOWORD(wParam)); ! return TRUE; ! } ! break; ! } ! return FALSE; } --- 339,355 ---- LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { ! switch (message) ! { ! case WM_INITDIALOG: ! return TRUE; ! case WM_COMMAND: ! if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) ! { ! EndDialog(hDlg, LOWORD(wParam)); ! return TRUE; ! } ! break; ! } ! return FALSE; } |