ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2006
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
377 discussions
Start a n
N
ew thread
[janderwald] 21786: halfplemented mouse control panel applet
by janderwald@svn.reactos.org
Author: janderwald Date: Wed May 3 17:45:22 2006 New Revision: 21786 URL:
http://svn.reactos.ru/svn/reactos?rev=21786&view=rev
Log: halfplemented mouse control panel applet Modified: trunk/reactos/dll/cpl/main/main.c trunk/reactos/dll/cpl/main/main.rbuild trunk/reactos/dll/cpl/main/mouse.c Modified: trunk/reactos/dll/cpl/main/main.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/main.c?rev=217…
============================================================================== --- trunk/reactos/dll/cpl/main/main.c (original) +++ trunk/reactos/dll/cpl/main/main.c Wed May 3 17:45:22 2006 @@ -105,12 +105,20 @@ DWORD dwReason, LPVOID lpReserved) { + INITCOMMONCONTROLSEX InitControls; switch(dwReason) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: - hApplet = hinstDLL; - break; + + + + InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitControls.dwICC = ICC_LISTVIEW_CLASSES | ICC_UPDOWN_CLASS | ICC_BAR_CLASSES; + InitCommonControlsEx(&InitControls); + + hApplet = hinstDLL; + break; } return TRUE; Modified: trunk/reactos/dll/cpl/main/main.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/main.rbuild?re…
============================================================================== --- trunk/reactos/dll/cpl/main/main.rbuild (original) +++ trunk/reactos/dll/cpl/main/main.rbuild Wed May 3 17:45:22 2006 @@ -11,6 +11,8 @@ <library>user32</library> <library>comctl32</library> <library>devmgr</library> + <library>comdlg32</library> + <library>gdi32</library> <file>keyboard.c</file> <file>main.c</file> <file>mouse.c</file> Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=21…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c (original) +++ trunk/reactos/dll/cpl/main/mouse.c Wed May 3 17:45:22 2006 @@ -22,16 +22,77 @@ * FILE: lib/cpl/main/mouse.c * PURPOSE: Mouse Control Panel * PROGRAMMER: Eric Kohl + * Johannes Anderwald */ +//TODO: +//detect slider changes - for apply stuff +//implement Double-Click Speed measuring +// cursor icon shows - may need overriden items +// implement Pointer-APPLY +// implement Pointer-Browser +// add missing icons +// Options- pointer precision + #include <windows.h> +#include <winuser.h> #include <devguid.h> #include <commctrl.h> #include <cpl.h> +#include <tchar.h> +#include <math.h> +#include <limits.h> #include "main.h" #include "resource.h" +#define DEFAULT_DOUBLE_CLICK_SPEED 500 +#define DEFAULT_CLICK_LOCK_TIME 2200 +#define DEFAULT_MOUSE_SENSITIVITY 16 +#define DEFAULT_MOUSE_THRESHOLD1 6 +#define DEFAULT_MOUSE_THRESHOLD2 10 +#define MIN_DOUBLE_CLICK_SPEED 200 +#define MAX_DOUBLE_CLICK_SPEED 900 +#define DEFAULT_WHEEL_SCROLL_LINES 3 + +ULONG g_Initialized = 0; + +UINT g_WheelScrollLines = 5; +ULONG g_SwapMouseButtons = 0; +ULONG g_DoubleClickSpeed = DEFAULT_DOUBLE_CLICK_SPEED; +BOOL g_ClickLockEnabled = 0; +BOOL g_DropShadow = 0; + +DWORD g_ClickLockTime = DEFAULT_CLICK_LOCK_TIME; +ULONG g_MouseSensitivity = DEFAULT_MOUSE_SENSITIVITY; +ULONG g_MouseSpeed = 1; +ULONG g_MouseThreshold1 = DEFAULT_MOUSE_THRESHOLD1; +ULONG g_MouseThreshold2 = DEFAULT_MOUSE_THRESHOLD2; +ULONG g_SnapToDefaultButton = 0; +ULONG g_MouseTrails = 0; +ULONG g_ShowPointer = 0; +ULONG g_HidePointer = 0; +ULONG g_ApplyCount = 0; + + +TCHAR g_CurrentScheme[MAX_PATH]; +TCHAR g_szArrow[MAX_PATH]; +TCHAR g_szHelp[MAX_PATH]; +TCHAR g_szAppStarting[MAX_PATH]; +TCHAR g_szWait[MAX_PATH]; +TCHAR g_szCrosshair[MAX_PATH]; +TCHAR g_szIBeam[MAX_PATH]; +TCHAR g_szNWPen[MAX_PATH]; +TCHAR g_szNo[MAX_PATH]; +TCHAR g_szSizeNS[MAX_PATH]; +TCHAR g_szSizeWE[MAX_PATH]; +TCHAR g_szSizeNWSE[MAX_PATH]; +TCHAR g_szSizeNESW[MAX_PATH]; +TCHAR g_szSizeAll[MAX_PATH]; +TCHAR g_szUpArrow[MAX_PATH]; +TCHAR g_szHand[MAX_PATH]; + +TCHAR g_szNewScheme[MAX_PATH]; /* Property page dialog callback */ static INT_PTR CALLBACK @@ -40,14 +101,13 @@ IN WPARAM wParam, IN LPARAM lParam) { + GUID Guids[1]; + Guids[0] = GUID_DEVCLASS_MOUSE; + switch(uMsg) { case WM_INITDIALOG: { - GUID Guids[] = { - GUID_DEVCLASS_MOUSE - }; - /* create the hardware page */ DeviceCreateHardwarePageEx(hwndDlg, Guids, @@ -61,29 +121,1062 @@ } +BOOL InitializeMouse() +{ + /* mouse trails */ + SystemParametersInfo(SPI_GETMOUSETRAILS, 0, &g_MouseTrails, 0); + + /* snap to default button */ + SystemParametersInfo(SPI_GETSNAPTODEFBUTTON, 0, &g_SnapToDefaultButton, 0); + + /* wheel scroll lines */ + SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &g_WheelScrollLines, 0); + +#if (WINVER >= 0x0500) + //FIXME + //pointer precision + // SPI_GETMOUSE? + + /* mouse sensitivity */ + SystemParametersInfo(SPI_GETMOUSESPEED, 0, &g_MouseSensitivity, 0); + + /* hide pointer while typing */ + SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &g_HidePointer, 0); + + /* click lock time */ + SystemParametersInfo(SPI_GETMOUSECLICKLOCK, 0, &g_ClickLockEnabled, 0); + SystemParametersInfo(SPI_GETMOUSECLICKLOCKTIME, 0, &g_ClickLockTime, 0); + + g_DoubleClickSpeed = GetDoubleClickTime(); + g_SwapMouseButtons = GetSystemMetrics(SM_SWAPBUTTON); + + + /* show pointer with Ctrl-Key */ + SystemParametersInfo(SPI_GETMOUSESONAR, 0, &g_ShowPointer, 0); +#endif + + return TRUE; +} + + +static INT_PTR CALLBACK +ClickLockProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + HWND hDlgCtrl; + int pos; + switch(uMsg) + { + case WM_INITDIALOG: + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_CLICK_LOCK); + SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 10)); + pos = (g_ClickLockTime-200) / 200; + SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)pos); + return TRUE; + } + case WM_COMMAND: + { + if (LOWORD(wParam) == IDOK) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_CLICK_LOCK); + g_ClickLockTime = (SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) * 200) + 200; + EndDialog(hwndDlg, TRUE); + } + else if (LOWORD(wParam) == IDCANCEL) + { + EndDialog(hwndDlg, FALSE); + } + } + } + + return FALSE; +} + +static INT_PTR CALLBACK +ButtonProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + HWND hDlgCtrl; + LRESULT lResult; + float pos; + LPPSHNOTIFY lppsn; + + switch(uMsg) + { + case WM_INITDIALOG: + { + if (InitializeMouse()) + { + if (g_SwapMouseButtons) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SWAP_MOUSE_BUTTONS); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + if (g_ClickLockEnabled) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_CLICK_LOCK); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + else + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_CLICK_LOCK); + EnableWindow(hDlgCtrl, FALSE); + } + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_DOUBLE_CLICK_SPEED); + SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 11)); + pos = ((float)g_DoubleClickSpeed / MAX_DOUBLE_CLICK_SPEED); + pos /= (1.0f/11.0f); + SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)(INT)rintf(pos)); + + + } + return TRUE; + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_SWAP_MOUSE_BUTTONS: + { + lResult = SendMessage((HWND)lParam, BM_GETCHECK, (WPARAM)0, (LPARAM)0); + if (lResult == BST_CHECKED) + { + g_SwapMouseButtons = FALSE; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else if (lResult == BST_UNCHECKED) + { + g_SwapMouseButtons = TRUE; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + break; + } + case IDC_CHECK_CLICK_LOCK: + { + lResult = SendMessage((HWND)lParam, BM_GETCHECK, (WPARAM)0, (LPARAM)0); + hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_CLICK_LOCK); + if (lResult == BST_CHECKED) + { + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + g_ClickLockEnabled = FALSE; + EnableWindow(hDlgCtrl, FALSE); + } + else if (lResult == BST_UNCHECKED) + { + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + EnableWindow(hDlgCtrl, TRUE); + g_ClickLockEnabled = TRUE; + } + break; + } + case IDC_BUTTON_CLICK_LOCK: + { + lResult = DialogBox(hApplet, MAKEINTRESOURCE(IDD_CLICK_LOCK), hwndDlg, ClickLockProc); + if ((INT)lResult == FALSE) + return FALSE; // no need to enable apply button + break; + } + } + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + case WM_NOTIFY: + { + lppsn = (LPPSHNOTIFY) lParam; + if (lppsn->hdr.code == PSN_APPLY) + { + SystemParametersInfo(SPI_SETMOUSEBUTTONSWAP, g_SwapMouseButtons, NULL, SPIF_SENDCHANGE); + SystemParametersInfo(SPI_SETDOUBLECLICKTIME, g_DoubleClickSpeed, NULL, SPIF_SENDCHANGE); + +#if (WINVER >= 0x0500) + SystemParametersInfo(SPI_SETMOUSECLICKLOCK, g_ClickLockEnabled, NULL, SPIF_SENDCHANGE); + if (g_ClickLockEnabled) + SystemParametersInfo(SPI_SETMOUSECLICKLOCKTIME, g_ClickLockTime, NULL, SPIF_SENDCHANGE); +#endif + SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + + } + case WM_DRAWITEM: + { + LPDRAWITEMSTRUCT drawItem; + drawItem = (LPDRAWITEMSTRUCT)lParam; + if(drawItem->CtlID == IDC_IMAGE_SWAP_MOUSE) + { + //FIXME + //show mouse with left/right button highlighted + // depending on val g_SwapMouseButtons + return TRUE; + } + else if (drawItem->CtlID == IDC_IMAGE_DOUBLE_CLICK_SPEED) + { + //FIXME + //measure click speed && draw item + } + break; + } + } + return FALSE; +} + +BOOL ReadActiveCursorScheme() +{ + HKEY hCuKey; + HKEY hCuCursorKey; + DWORD dwIndex; + TCHAR szValueName[MAX_PATH]; + DWORD dwValueName; + TCHAR szValueData[2000]; + DWORD dwValueData; + LONG dwResult; + + if (RegOpenCurrentUser(KEY_READ, &hCuKey) != ERROR_SUCCESS) + return FALSE; + + if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors"), 0, KEY_READ, &hCuCursorKey) != ERROR_SUCCESS) + { + RegCloseKey(hCuKey); + return FALSE; + } + + memset(g_szArrow, 0x0, sizeof(g_szArrow)); + memset(g_szHelp, 0x0, sizeof(g_szHelp)); + memset(g_szAppStarting, 0x0, sizeof(g_szAppStarting)); + memset(g_szWait, 0x0, sizeof(g_szWait)); + memset(g_szCrosshair, 0x0, sizeof(g_szCrosshair)); + memset(g_szIBeam, 0x0, sizeof(g_szIBeam)); + memset(g_szNWPen, 0x0, sizeof(g_szNWPen)); + memset(g_szNo, 0x0, sizeof(g_szNo)); + memset(g_szSizeNS, 0x0, sizeof(g_szSizeNS)); + memset(g_szSizeWE, 0x0, sizeof(g_szSizeWE)); + memset(g_szSizeNWSE, 0x0, sizeof(g_szSizeNWSE)); + memset(g_szSizeNESW, 0x0, sizeof(g_szSizeNESW)); + memset(g_szSizeAll, 0x0, sizeof(g_szSizeAll)); + memset(g_szUpArrow, 0x0, sizeof(g_szUpArrow)); + memset(g_szHand, 0x0, sizeof(g_szHand)); + + dwIndex = 0; + do + { + dwValueName = sizeof(szValueName) / sizeof(TCHAR); + dwValueData = sizeof(szValueData) / sizeof(TCHAR); + dwResult = RegEnumValue(hCuCursorKey, dwIndex, szValueName, &dwValueName, NULL, NULL, (LPBYTE)szValueData, &dwValueData); + + if (dwResult == ERROR_NO_MORE_ITEMS) + break; + + if (_tcsicmp(_T("Arrow"), szValueName)) + _tcsncpy(g_szArrow, szValueData, MAX_PATH); + else if (_tcsicmp(_T("Help"), szValueName)) + _tcsncpy(g_szHelp, szValueData, MAX_PATH); + else if (_tcsicmp(_T("AppStarting"), szValueName)) + _tcsncpy(g_szAppStarting, szValueData, MAX_PATH); + else if (_tcsicmp(_T("Wait"), szValueName)) + _tcsncpy(g_szWait, szValueData, MAX_PATH); + else if (_tcsicmp(_T("Crosshair"), szValueName)) + _tcsncpy(g_szCrosshair, szValueData, MAX_PATH); + else if (_tcsicmp(_T("IBeam"), szValueName)) + _tcsncpy(g_szIBeam, szValueData, MAX_PATH); + else if (_tcsicmp(_T("NWPen"), szValueName)) + _tcsncpy(g_szNWPen, szValueData, MAX_PATH); + else if (_tcscmp(_T("No"), szValueName)) + _tcsncpy(g_szNo, szValueData, MAX_PATH); + else if (_tcsicmp(_T("SizeNS"), szValueName)) + _tcsncpy(g_szSizeNS, szValueData, MAX_PATH); + else if (_tcsicmp(_T("SizeWE"), szValueName)) + _tcsncpy(g_szSizeWE, szValueData, MAX_PATH); + else if (_tcsicmp(_T("SizeNWSE"), szValueName)) + _tcsncpy(g_szSizeNWSE, szValueData, MAX_PATH); + else if (_tcsicmp(_T("SizeNESW"), szValueName)) + _tcsncpy(g_szSizeNESW, szValueData, MAX_PATH); + else if (_tcsicmp(_T("SizeAll"), szValueName)) + _tcsncpy(g_szSizeAll, szValueData, MAX_PATH); + else if (_tcsicmp(_T("UpArrow"), szValueName)) + _tcsncpy(g_szUpArrow, szValueData, MAX_PATH); + else if (_tcsicmp(_T("Hand"), szValueName)) + _tcsncpy(g_szHand, szValueData, MAX_PATH); + + dwIndex++; + }while(1); + + RegCloseKey(hCuCursorKey); + RegCloseKey(hCuKey); + + return TRUE; +} + +BOOL EnumerateCursorSchemes(HWND hwndDlg) +{ + HKEY hCuKey; + HKEY hCuCursorKey; + DWORD dwIndex; + TCHAR szValueName[MAX_PATH]; + DWORD dwValueName; + TCHAR szSystemScheme[MAX_PATH]; + TCHAR szValueData[2000]; + DWORD dwValueData; + LONG dwResult; + HWND hDlgCtrl; + LRESULT lResult; + BOOL ProcessedHKLM = FALSE; + + if (RegOpenCurrentUser(KEY_READ, &hCuKey) != ERROR_SUCCESS) + { + return FALSE; + } + if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ, &hCuCursorKey) != ERROR_SUCCESS) + { + RegCloseKey(hCuKey); + return FALSE; + } + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMBO_CURSOR_SCHEME); + SendMessage(hDlgCtrl, CB_RESETCONTENT, 0, 0); + dwIndex = 0; + + do + { + dwValueName = sizeof(szValueName) / sizeof(TCHAR); + dwValueData = sizeof(szValueData) / sizeof(TCHAR); + dwResult = RegEnumValue(hCuCursorKey, dwIndex, szValueName, &dwValueName, NULL, NULL, (LPBYTE)szValueData, &dwValueData); + + if (dwResult == ERROR_NO_MORE_ITEMS) + { + if(!ProcessedHKLM) + { + RegCloseKey(hCuCursorKey); + dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cursors\\Schemes"), + 0, KEY_READ, &hCuCursorKey); + if (dwResult == ERROR_SUCCESS) + { + dwIndex = 0; + ProcessedHKLM = TRUE; + LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); + continue; + } + } + break; + } + if(_tcslen(szValueData) > 0) + { + TCHAR * copy = _tcsdup(szValueData); + if (ProcessedHKLM) + _tcscat(szValueName, szSystemScheme); + lResult = SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szValueName); + SendMessage(hDlgCtrl, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)copy); + } + + dwIndex++; + }while(1); + + RegCloseKey(hCuCursorKey); + RegCloseKey(hCuKey); + + LoadString(hApplet, IDS_NONE, szSystemScheme, MAX_PATH); + SendMessage(hDlgCtrl, CB_ADDSTRING, (WPARAM)0, (LPARAM)szSystemScheme); + SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); + + return TRUE; +} + + +void RefreshCursorList(HWND hwndDlg) +{ + TCHAR szCursorName[MAX_PATH]; + HWND hDlgCtrl; + LV_ITEM listItem; + LV_COLUMN column; + INT index = 0; + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_LISTVIEW_CURSOR); + ListView_DeleteAllItems(hDlgCtrl); + + ZeroMemory(&column, sizeof(LV_COLUMN)); + column.mask = LVCF_SUBITEM | LVCF_WIDTH; + column.iSubItem = 0; + column.cx = 200; + + (void)ListView_InsertColumn(hDlgCtrl, 0, &column); + + + LoadString(hApplet, IDS_ARROW, szCursorName, MAX_PATH); + + ZeroMemory(&listItem, sizeof(LV_ITEM)); + listItem.mask = LVIF_TEXT | LVIF_PARAM | LVIF_STATE | LVIF_IMAGE; + listItem.pszText = szCursorName; + listItem.state = 0; + listItem.iImage = -1; + listItem.iItem = index++; + listItem.lParam = 0; + + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_HELP, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_APPSTARTING, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_WAIT, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_CROSSHAIR, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_IBEAM, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_NWPEN, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_NO, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_SIZENS, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + + LoadString(hApplet, IDS_SIZENWSE, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_SIZENESW, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_SIZEALL, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_UPARROW, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); + + LoadString(hApplet, IDS_HAND, szCursorName, MAX_PATH); + listItem.iItem = index++; + ListView_InsertItem(hDlgCtrl, &listItem); +} + +BOOL DeleteUserCursorScheme(TCHAR * szScheme) +{ + HKEY hCuKey; + HKEY hCuCursorKey; + LONG Result; + if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS) + { + return FALSE; + } + if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS) + { + RegCloseKey(hCuKey); + return FALSE; + } + Result = RegDeleteValue(hCuCursorKey, szScheme); + + RegCloseKey(hCuCursorKey); + RegCloseKey(hCuKey); + return (Result == ERROR_SUCCESS); +} + +static INT_PTR CALLBACK +SaveSchemeProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + HWND hDlgCtrl; + + switch(uMsg) + { + case WM_COMMAND: + { + if (LOWORD(wParam) == IDOK) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_SCHEME_NAME); + SendMessage(hDlgCtrl, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)g_szNewScheme); + EndDialog(hwndDlg, TRUE); + } + else if (LOWORD(wParam) == IDCANCEL) + { + EndDialog(hwndDlg, FALSE); + } + } + } + + return FALSE; +} + +BOOL BrowseCursor(TCHAR * szFileName, HWND hwndDlg) +{ + //FIXME load text resources from string + OPENFILENAME ofn; + static TCHAR szFilter[] = _T("Cursors\0*.ani;*.cur\0Animated Cursors\0*.ani\0Static Cursors\0*.cur\0All Files\0*.*\0\0"); + + ZeroMemory(&ofn, sizeof(OPENFILENAME)); + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hwndDlg; + ofn.lpstrFilter = szFilter; + ofn.nFilterIndex = 1; + ofn.lpstrFile = szFileName; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrInitialDir = _T("%WINDIR%\\Cursors"); + ofn.lpstrTitle = _T("Browse"); + ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST; + + if (GetOpenFileName(&ofn)) + return TRUE; + else + return FALSE; +} + + +static INT_PTR CALLBACK +PointerProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + LPPSHNOTIFY lppsn; + TCHAR buffer[MAX_PATH]; + TCHAR szSystemScheme[MAX_PATH]; + HWND hDlgCtrl; + HDC memDC; + HCURSOR hCursor; + LRESULT lResult; + + switch(uMsg) + { + case WM_INITDIALOG: + { + EnumerateCursorSchemes(hwndDlg); + RefreshCursorList(hwndDlg); +#if (WINVER >= 0x0500) + /* drop shadow */ + SystemParametersInfo(SPI_GETDROPSHADOW, 0, &g_DropShadow, 0); + if (g_DropShadow) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_DROP_SHADOW); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } +#endif + if ((INT)wParam == IDC_LISTVIEW_CURSOR) + return TRUE; + else + return FALSE; + } + case WM_NOTIFY: + { + lppsn = (LPPSHNOTIFY) lParam; + if (lppsn->hdr.code == PSN_APPLY) + { +#if (WINVER >= 0x0500) + SystemParametersInfo(SPI_SETDROPSHADOW, 0, g_DropShadow, SPIF_SENDCHANGE); +#endif + SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + break; + } + case WM_COMMAND: + { + switch(HIWORD(wParam)) + { + case CBN_SELENDOK: + { + BOOL bEnable; + wParam = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0); + if(wParam == CB_ERR) + break; + SendMessage((HWND)lParam, CB_GETLBTEXT, wParam, (LPARAM)buffer); + LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); + if(_tcsstr(buffer, szSystemScheme) || wParam == 0) //avoid the default scheme can be deleted + bEnable = 0; + else + bEnable = 1; + + /* delete button */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_BUTTON_DELETE_SCHEME); + EnableWindow(hDlgCtrl, bEnable); + + break; + } + } + + switch(LOWORD(wParam)) + { + case IDC_BUTTON_SAVEAS_SCHEME: + { + if(DialogBox(hApplet, MAKEINTRESOURCE(IDD_CURSOR_SCHEME_SAVEAS), hwndDlg, SaveSchemeProc)) + { + //FIXME + //save cursor scheme + + } + break; + } + case IDC_BUTTON_USE_DEFAULT_CURSOR: + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_LISTVIEW_CURSOR); + lResult = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0); + if (lResult != CB_ERR) + { + if ((INT)lResult == 0) + memset(g_szArrow, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 1) + memset(g_szHelp, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 2) + memset(g_szAppStarting, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 3) + memset(g_szWait, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 4) + memset(g_szCrosshair, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 5) + memset(g_szIBeam, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 6) + memset(g_szNWPen, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 7) + memset(g_szNo, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 8) + memset(g_szSizeNS, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 9) + memset(g_szSizeWE,0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 10) + memset(g_szSizeNWSE, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 11) + memset(g_szSizeNESW, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 12) + memset(g_szSizeAll, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 13) + memset(g_szUpArrow, 0x0, MAX_PATH * sizeof(TCHAR)); + else if ((INT)lResult == 14) + memset(g_szHand, 0x0, MAX_PATH * sizeof(TCHAR)); + } + break; + } + case IDC_BUTTON_BROWSE_CURSOR: + { + memset(buffer, 0x0, sizeof(buffer)); + hDlgCtrl = GetDlgItem(hwndDlg, IDC_LISTVIEW_CURSOR); + lResult = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0); + if (lResult == CB_ERR) + MessageBox(hwndDlg, _T("CB_ERR"), _T(""),MB_ICONERROR); + if (BrowseCursor(buffer, hwndDlg)) + { + + if ((INT)lResult == 0) + _tcsncpy(g_szArrow, buffer, MAX_PATH); + else if ((INT)lResult == 1) + _tcsncpy(g_szHelp, buffer, MAX_PATH); + else if ((INT)lResult == 2) + _tcsncpy(g_szAppStarting, buffer, MAX_PATH); + else if ((INT)lResult == 3) + _tcsncpy(g_szWait, buffer, MAX_PATH); + else if ((INT)lResult == 4) + _tcsncpy(g_szCrosshair, buffer, MAX_PATH); + else if ((INT)lResult == 5) + _tcsncpy(g_szIBeam, buffer, MAX_PATH); + else if ((INT)lResult == 6) + _tcsncpy(g_szNWPen, buffer, MAX_PATH); + else if ((INT)lResult == 7) + _tcsncpy(g_szNo, buffer, MAX_PATH); + else if ((INT)lResult == 8) + _tcsncpy(g_szSizeNS, buffer, MAX_PATH); + else if ((INT)lResult == 9) + _tcsncpy(g_szSizeWE, buffer, MAX_PATH); + else if ((INT)lResult == 10) + _tcsncpy(g_szSizeNWSE, buffer, MAX_PATH); + else if ((INT)lResult == 11) + _tcsncpy(g_szSizeNESW, buffer, MAX_PATH); + else if ((INT)lResult == 12) + _tcsncpy(g_szSizeAll, buffer, MAX_PATH); + else if ((INT)lResult == 13) + _tcsncpy(g_szUpArrow, buffer, MAX_PATH); + else if ((INT)lResult == 14) + _tcsncpy(g_szHand, buffer, MAX_PATH); + + //FIXME + //clear screen + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_IMAGE_CURRENT_CURSOR); + memDC = GetDC(hDlgCtrl); + hCursor = (HCURSOR) LoadImage(NULL, buffer, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE | LR_SHARED); + if (hCursor) + { + DrawIcon(memDC, 10, 10, (HICON)hCursor); + DestroyCursor(hCursor); + } + ReleaseDC(hDlgCtrl, memDC); + } + break; + } + case IDC_BUTTON_DELETE_SCHEME: + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMBO_CURSOR_SCHEME); + wParam = SendMessage(hDlgCtrl, CB_GETCURSEL, 0, 0); + if(wParam == CB_ERR) + break; + SendMessage(hDlgCtrl, CB_GETLBTEXT, wParam, (LPARAM)buffer); + if (DeleteUserCursorScheme(buffer)) + { + SendMessage(hDlgCtrl, CB_DELETESTRING, wParam, 0); + SendMessage(hDlgCtrl, CB_SETCURSEL, (WPARAM)0, (LPARAM)0); + } + break; + } + case IDC_CHECK_DROP_SHADOW: + { + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_DROP_SHADOW)) + { + g_DropShadow = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + g_DropShadow = 1; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + } + } + break; + } + + } + + return FALSE; +} + +static INT_PTR CALLBACK +OptionProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + HWND hDlgCtrl; + LPPSHNOTIFY lppsn; + LRESULT lResult; + + switch(uMsg) + { + case WM_INITDIALOG: + { + if (InitializeMouse()) + { + /* set mouse sensitivity */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY); + SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 19)); + SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)g_MouseSensitivity-1); + + if (g_MouseSpeed) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_POINTER_PRECISION); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + + if (g_SnapToDefaultButton) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SNAP_TO); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + + /* set mouse trail */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL); + SendMessage(hDlgCtrl, TBM_SETRANGE, (WPARAM)TRUE, (LPARAM)MAKELONG(0, 5)); + if (!g_MouseTrails) + EnableWindow(hDlgCtrl, FALSE); + else + SendMessage(hDlgCtrl, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)g_MouseTrails-2); + + if (g_ShowPointer) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_SHOW_POINTER); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + + if (g_HidePointer) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_HIDE_POINTER); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + + } + + break; + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_CHECK_POINTER_PRECISION: + { + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_PRECISION)) + { + g_MouseSpeed = 0; + g_MouseThreshold1 = 0; + g_MouseThreshold2 = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + g_MouseSpeed = 1; + g_MouseThreshold1 = 6; + g_MouseThreshold2 = 10; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + break; + } + case IDC_CHECK_SNAP_TO: + { + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SNAP_TO)) + { + g_SnapToDefaultButton = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + g_SnapToDefaultButton = 1; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + break; + } + case IDC_CHECK_POINTER_TRAIL: + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL); + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_TRAIL)) + { + g_MouseTrails = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + EnableWindow(hDlgCtrl, FALSE); + } + else + { + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + EnableWindow(hDlgCtrl, TRUE); + g_MouseTrails = SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 2; + } + break; + } + case IDC_CHECK_SHOW_POINTER: + { + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_SHOW_POINTER)) + { + g_ShowPointer = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + g_ShowPointer = 1; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + break; + } + case IDC_CHECK_HIDE_POINTER: + { + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_HIDE_POINTER)) + { + g_HidePointer = 0; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + g_HidePointer = 1; + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + break; + } + } + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + case WM_NOTIFY: + { + lppsn = (LPPSHNOTIFY) lParam; + if (lppsn->hdr.code == PSN_APPLY) + { + /* set snap to default button */ + SystemParametersInfo(SPI_SETSNAPTODEFBUTTON, g_SnapToDefaultButton, 0, SPIF_SENDCHANGE); + + /* set mouse trails */ + if(IsDlgButtonChecked(hwndDlg, IDC_CHECK_POINTER_TRAIL)) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_POINTER_TRAIL); + lResult = SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0); + } + else + lResult = 0; + + SystemParametersInfo(SPI_SETMOUSETRAILS, lResult, 0, SPIF_SENDCHANGE); + +#if (WINVER >= 0x0500) + //FIXME + //pointer precision + //SPI_SETMOUSE? + + /* calc pos and set mouse sensitivity */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_SLIDER_MOUSE_SENSITIVITY); + lResult = SendMessage(hDlgCtrl, TBM_GETPOS, 0, 0) + 1; + SystemParametersInfo(SPI_SETMOUSESPEED, 0, g_MouseSensitivity, SPIF_SENDCHANGE); + + + /* hide pointer while typing */ + SystemParametersInfo(SPI_SETMOUSEVANISH, 0, g_HidePointer, SPIF_SENDCHANGE); + + /* show pointer with Ctrl-Key */ + SystemParametersInfo(SPI_SETMOUSESONAR, 0, g_ShowPointer, SPIF_SENDCHANGE); +#endif + + SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + + } + + } + return FALSE; +} + +static void ShowDialogWheelControls(HWND hwndDlg) +{ + HWND hDlgCtrl; + + if (g_WheelScrollLines != -1) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_LINES); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES); + EnableWindow(hDlgCtrl, TRUE); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_WHEEL_SCROLL_LINES); + EnableWindow(hDlgCtrl, TRUE); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_PAGE); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + } + else + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_LINES); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, (LPARAM)0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES); + EnableWindow(hDlgCtrl, FALSE); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_WHEEL_SCROLL_LINES); + EnableWindow(hDlgCtrl, TRUE); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_WHEEL_SCROLL_PAGE); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, (LPARAM)0); + } + +} + +static INT_PTR CALLBACK +WheelProc(IN HWND hwndDlg, + IN UINT uMsg, + IN WPARAM wParam, + IN LPARAM lParam) +{ + HWND hDlgCtrl; + WCHAR buffer[MAX_PATH]; + LPPSHNOTIFY lppsn; + + switch(uMsg) + { + case WM_INITDIALOG: + { + ShowDialogWheelControls(hwndDlg); + if (g_WheelScrollLines != UINT_MAX) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES); + wsprintf(buffer, _T("%d"), g_WheelScrollLines); + SendMessage(hDlgCtrl, WM_SETTEXT, (WPARAM)0, (LPARAM)buffer); + } + return TRUE; + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + case IDC_RADIO_WHEEL_SCROLL_LINES: + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES); + SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)100, (LPARAM)buffer); + g_WheelScrollLines = _wtoi(buffer); + ShowDialogWheelControls(hwndDlg); + break; + } + case IDC_RADIO_WHEEL_SCROLL_PAGE: + { + g_WheelScrollLines = -1; + ShowDialogWheelControls(hwndDlg); + break; + } + } + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + break; + } + case WM_NOTIFY: + { + lppsn = (LPPSHNOTIFY) lParam; + if (lppsn->hdr.code == PSN_APPLY) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_WHEEL_SCROLL_LINES); + SendMessageW(hDlgCtrl, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)buffer); + g_WheelScrollLines = _wtoi(buffer); + SystemParametersInfo(SPI_SETWHEELSCROLLLINES, g_WheelScrollLines, 0, SPIF_SENDCHANGE); + + SetWindowLong(hwndDlg, DWL_MSGRESULT, PSNRET_NOERROR); + return TRUE; + } + + } + + } + + return FALSE; +} + LONG APIENTRY MouseApplet(HWND hwnd, UINT uMsg, LONG lParam1, LONG lParam2) { - PROPSHEETPAGE psp[1]; - PROPSHEETHEADER psh; - TCHAR Caption[256]; - - LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR)); - - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; - psh.hwndParent = NULL; - psh.hInstance = hApplet; - psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1)); - psh.pszCaption = Caption; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = psp; - - InitPropSheetPage(&psp[0], IDD_HARDWARE, MouseHardwareProc); - - return (LONG)(PropertySheet(&psh) != -1); + PROPSHEETPAGE psp[5]; + PROPSHEETHEADER psh; + TCHAR Caption[256]; + + LoadString(hApplet, IDS_CPLNAME_1, Caption, sizeof(Caption) / sizeof(TCHAR)); + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE; + psh.hwndParent = NULL; + psh.hInstance = hApplet; + psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON_1)); + psh.pszCaption = Caption; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = psp; + + InitPropSheetPage(&psp[0], IDD_PAGE_BUTTON, ButtonProc); + InitPropSheetPage(&psp[1], IDD_PAGE_POINTER, PointerProc); + InitPropSheetPage(&psp[2], IDD_PAGE_OPTION, OptionProc); + InitPropSheetPage(&psp[3], IDD_PAGE_WHEEL, WheelProc); + InitPropSheetPage(&psp[4], IDD_HARDWARE, MouseHardwareProc); + return (LONG)(PropertySheet(&psh) != -1); } /* EOF */
18 years, 7 months
1
0
0
0
[janderwald] 21785: mouse control panel applet resources
by janderwald@svn.reactos.org
Author: janderwald Date: Wed May 3 15:23:57 2006 New Revision: 21785 URL:
http://svn.reactos.ru/svn/reactos?rev=21785&view=rev
Log: mouse control panel applet resources Modified: trunk/reactos/dll/cpl/main/En.rc trunk/reactos/dll/cpl/main/resource.h Modified: trunk/reactos/dll/cpl/main/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/En.rc?rev=2178…
============================================================================== --- trunk/reactos/dll/cpl/main/En.rc (original) +++ trunk/reactos/dll/cpl/main/En.rc Wed May 3 15:23:57 2006 @@ -1,4 +1,4 @@ -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US IDD_KEYBSPEED DIALOGEX 0, 0, 246, 228 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION @@ -15,10 +15,132 @@ BEGIN END +IDD_CLICK_LOCK DIALOGEX 0, 0, 246, 100 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CAPTION | WS_SYSMENU +CAPTION "Click Lock" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Short", -1, 35, 50, 30, 10 + LTEXT "Long", -1, 140, 50, 30, 10 + CONTROL "",IDC_SLIDER_CLICK_LOCK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 65, 50, 70, 17 + PUSHBUTTON "&Ok", IDOK, 120, 75, 50, 15 + PUSHBUTTON "&Cancel", IDCANCEL, 175, 75, 50, 15 + LTEXT "&Adjust how long you need to hold down a mouse or trackball button before your click is locked",-1,60,15,170,30 + ICON -1, IDC_ICON_CLICK_LOCK, 15, 15, 15, 15 +END + +IDD_PAGE_BUTTON DIALOGEX 0, 0, 246, 228 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "Button" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Button configuration", -1, 5, 5, 230, 70 + CHECKBOX "&Switch primary and secondary buttons", IDC_SWAP_MOUSE_BUTTONS, 10, 15, 140, 10 + CONTROL "", IDC_IMAGE_SWAP_MOUSE, "Static", SS_OWNERDRAW, 155, 15, 75, 57, WS_EX_STATICEDGE + LTEXT "Select this checkbox to make the button the right one the one you use for primary functions such as selecting and dragging", -1, 10, 30, 140, 30 + GROUPBOX "Double-click speed", -1, 5, 75, 230, 70 + LTEXT "Double-click the folder to test your settings. If the folder does not open or close, try using a slower setting.", -1, 10, 85, 160, 30 + LTEXT "Spee&d: Slow", -1, 10, 120, 90, 8 + LTEXT "Fast", -1, 140, 120, 30, 8 + CONTROL "",IDC_SLIDER_DOUBLE_CLICK_SPEED, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 60, 120, 70, 17 + CONTROL "", IDC_IMAGE_DOUBLE_CLICK_SPEED, "Static", SS_OWNERDRAW, 165, 85, 65, 57, WS_EX_STATICEDGE + GROUPBOX "ClickLock", -1, 5, 150, 230, 70 + CHECKBOX "&Turn on ClickLock", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 + PUSHBUTTON "&Settings...", IDC_BUTTON_CLICK_LOCK, 170, 160, 50, 10 + LTEXT "Enables you to highlight or drag without holding down the mouse button. To set, briefly press the mouse button. To release, click the mouse button again", -1, 10, 180, 190, 30 +END + +IDD_PAGE_POINTER DIALOGEX 0, 0, 246, 228 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "Pointer" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Scheme", -1, 5, 5, 170, 45 + COMBOBOX IDC_COMBO_CURSOR_SCHEME, 10, 15, 145, 200, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + CONTROL "", IDC_LISTVIEW_CURSOR ,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_NOCOLUMNHEADER | LVS_SHAREIMAGELISTS | WS_BORDER | WS_TABSTOP, 5, 70, 230, 120 + PUSHBUTTON "Sa&ve As...", IDC_BUTTON_SAVEAS_SCHEME, 70, 30, 50, 15 + PUSHBUTTON "&Delete", IDC_BUTTON_DELETE_SCHEME, 125, 30, 40, 15 + CONTROL "", IDC_IMAGE_CURRENT_CURSOR, "Static", SS_OWNERDRAW, 195, 15, 35, 35, WS_EX_STATICEDGE + LTEXT "&Customize", -1, 5, 60, 40, 10 + CHECKBOX "&Enable pointer shadow", IDC_CHECK_DROP_SHADOW, 5, 200, 100, 10 + PUSHBUTTON "Use De&fault", IDC_BUTTON_USE_DEFAULT_CURSOR, 120, 200, 50, 15 + PUSHBUTTON "&Browse", IDC_BUTTON_BROWSE_CURSOR, 175, 200, 50, 15 +END + +IDD_CURSOR_SCHEME_SAVEAS DIALOGEX 0, 0, 200, 75 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CAPTION | WS_SYSMENU +CAPTION "Save Scheme" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Save this cursor scheme as:", -1, 5, 5, 100, 10 + EDITTEXT IDC_EDIT_SCHEME_NAME, 5, 15, 180, 15, WS_CHILD | WS_VISIBLE | WS_GROUP + PUSHBUTTON "&Ok", IDOK, 60, 45, 50, 15 + PUSHBUTTON "&Cancel", IDCANCEL, 115, 45, 50, 15 +END + + +IDD_PAGE_OPTION DIALOGEX 0, 0, 246, 228 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "Pointer Options" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Motion", -1, 5, 5, 230, 60 + LTEXT "Sele&ct a pointer speed:", -1, 60, 15, 110, 10 + LTEXT "Slow", -1, 60, 30, 20, 10 + CONTROL "",IDC_SLIDER_MOUSE_SENSITIVITY, "msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 90, 30, 70, 17 + LTEXT "Fast", -1, 170, 30, 20, 10 + ICON -1, IDC_ICON_MOUSE_SENSITIVITY, 15, 15, 15, 15 + CHECKBOX "&Enhance pointer precision", IDC_CHECK_POINTER_PRECISION, 60, 50, 100, 10 + GROUPBOX "Snap To", -1, 5, 65, 230, 40 + CHECKBOX "", IDC_CHECK_SNAP_TO, 60, 75, 10, 10 + ICON -1, IDC_ICON_SNAP_TO, 15, 75, 15, 15 + LTEXT "A&utomatically move pointer to the default button in a dialog box", -1, 73, 75, 152, 20 + GROUPBOX "Visibility", -1, 5, 105, 230, 90 + CHECKBOX "&Display pointer trails", IDC_CHECK_POINTER_TRAIL, 60, 110, 80, 10 + LTEXT "Short", -1, 60, 130, 30, 10 + LTEXT "Long", -1, 160, 130, 30, 10 + ICON -1, IDC_ICON_POINTER_TRAIL, 15, 115, 15, 15 + CONTROL "", IDC_SLIDER_POINTER_TRAIL ,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP, 80, 130, 70, 17 + CHECKBOX "&Hide pointer while typing", IDC_CHECK_HIDE_POINTER, 60, 150, 90, 10 + ICON -1, IDC_ICON_HIDE_POINTER, 15, 145, 15, 15 + CHECKBOX "&Show location of pointer when I press the CTRL key", IDC_CHECK_SHOW_POINTER, 60, 175, 170, 10 + ICON -1, IDC_ICON_SHOW_POINTER, 15, 170, 15, 15 +END + +IDD_PAGE_WHEEL DIALOGEX 0, 0, 246, 228 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_CAPTION +CAPTION "Wheel" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Scrolling", -1, 5, 5, 230, 80 + LTEXT "Roll the wheel one notch to scroll", -1, 60, 15, 150, 10 + CONTROL "The following &number of lines at a time", IDC_RADIO_WHEEL_SCROLL_LINES, "Button", 0x50010009, 60, 30, 150, 10 + EDITTEXT IDC_EDIT_WHEEL_SCROLL_LINES, 60, 45, 60, 15,ES_RIGHT | WS_GROUP + CONTROL "", IDC_UPDOWN_WHEEL_SCROLL_LINES, UPDOWN_CLASS,UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER | WS_GROUP, 115, 45, 12, 12 + CONTROL "&One screen at a time", IDC_RADIO_WHEEL_SCROLL_PAGE, "Button", 0x50010009, 60, 65, 90, 10 + ICON -1, IDC_ICON_WHEEL, 20, 35, 15, 15 +END + STRINGTABLE BEGIN IDS_CPLNAME_1 "Mouse" IDS_CPLDESCRIPTION_1 "Changes mouse settings." IDS_CPLNAME_2 "Keyboard" IDS_CPLDESCRIPTION_2 "Changes keyboard settings." + IDS_ARROW "Normal Select" + IDS_HELP "Help Select" + IDS_APPSTARTING "Working in Background" + IDS_WAIT "Busy" + IDS_CROSSHAIR "Precision Select" + IDS_IBEAM "Text Select" + IDS_NWPEN "Handwriting" + IDS_NO "Unavailable" + IDS_SIZENS "Vertical Resize" + IDS_SIZENWSE "Diagonal Resize 1" + IDS_SIZENESW "Diagonal Resize 2" + IDS_SIZEALL "Move" + IDS_UPARROW "Alternative Select" + IDS_HAND "Link Select" + IDS_NONE "(None)" + IDS_SYSTEM_SCHEME "(system scheme)" END Modified: trunk/reactos/dll/cpl/main/resource.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/resource.h?rev…
============================================================================== --- trunk/reactos/dll/cpl/main/resource.h (original) +++ trunk/reactos/dll/cpl/main/resource.h Wed May 3 15:23:57 2006 @@ -5,14 +5,71 @@ #define IDC_CPLICON_1 1 #define IDC_CPLICON_2 2 -#define IDD_KEYBSPEED 103 -#define IDD_HARDWARE 104 +#define IDD_PAGE_BUTTON 101 +#define IDD_PAGE_POINTER 102 +#define IDD_PAGE_OPTION 103 +#define IDD_PAGE_WHEEL 104 +#define IDD_PAGE_HARDWARE 105 +#define IDD_HARDWARE 105 +#define IDD_KEYBSPEED 106 +#define IDD_CURSOR_SCHEME_SAVEAS 107 +#define IDD_CLICK_LOCK 108 -#define IDS_CPLNAME_1 1000 +#define IDS_CPLNAME_1 1000 #define IDS_CPLDESCRIPTION_1 1001 -#define IDS_CPLNAME_2 1002 +#define IDS_CPLNAME_2 1002 #define IDS_CPLDESCRIPTION_2 1003 +#define IDC_SWAP_MOUSE_BUTTONS 2000 +#define IDC_SLIDER_DOUBLE_CLICK_SPEED 2001 +#define IDC_CHECK_CLICK_LOCK 2002 +#define IDC_BUTTON_CLICK_LOCK 2003 +#define IDC_RADIO_WHEEL_SCROLL_LINES 2004 +#define IDC_EDIT_WHEEL_SCROLL_LINES 2005 +#define IDC_UPDOWN_WHEEL_SCROLL_LINES 2006 +#define IDC_RADIO_WHEEL_SCROLL_PAGE 2007 +#define IDC_SLIDER_MOUSE_SENSITIVITY 2008 +#define IDC_CHECK_SNAP_TO 2009 +#define IDC_CHECK_SHOW_POINTER 2010 +#define IDC_CHECK_HIDE_POINTER 2011 +#define IDC_CHECK_POINTER_TRAIL 2012 +#define IDC_CHECK_POINTER_PRECISION 2013 +#define IDC_SLIDER_POINTER_TRAIL 2014 +#define IDC_LISTVIEW_CURSOR 2015 +#define IDS_ARROW 2016 +#define IDS_HELP 2017 +#define IDS_APPSTARTING 2018 +#define IDS_WAIT 2019 +#define IDS_CROSSHAIR 2020 +#define IDS_IBEAM 2021 +#define IDS_NWPEN 2022 +#define IDS_NO 2023 +#define IDS_SIZENS 2024 +#define IDS_SIZENWSE 2025 +#define IDS_SIZENESW 2026 +#define IDS_SIZEALL 2027 +#define IDS_UPARROW 2028 +#define IDS_HAND 2029 +#define IDC_COMBO_CURSOR_SCHEME 2030 +#define IDS_NONE 2031 +#define IDS_SYSTEM_SCHEME 2032 +#define IDC_BUTTON_DELETE_SCHEME 2033 +#define IDC_CHECK_DROP_SHADOW 2034 +#define IDC_IMAGE_SWAP_MOUSE 2035 +#define IDC_IMAGE_DOUBLE_CLICK_SPEED 2036 +#define IDC_ICON_MOUSE_SENSITIVITY 2037 +#define IDC_ICON_SNAP_TO 2038 +#define IDC_ICON_POINTER_TRAIL 2039 +#define IDC_ICON_SHOW_POINTER 2040 +#define IDC_ICON_HIDE_POINTER 2041 +#define IDC_BUTTON_USE_DEFAULT_CURSOR 2042 +#define IDC_BUTTON_BROWSE_CURSOR 2043 +#define IDC_BUTTON_SAVEAS_SCHEME 2044 +#define IDC_EDIT_SCHEME_NAME 2045 +#define IDC_ICON_CLICK_LOCK 2046 +#define IDC_SLIDER_CLICK_LOCK 2047 +#define IDC_ICON_WHEEL 2048 +#define IDC_IMAGE_CURRENT_CURSOR 2049 #endif /* __CPL_RESOURCE_H */
18 years, 7 months
1
0
0
0
[janderwald] 21784: small msvc compiling fix
by janderwald@svn.reactos.org
Author: janderwald Date: Wed May 3 15:18:07 2006 New Revision: 21784 URL:
http://svn.reactos.ru/svn/reactos?rev=21784&view=rev
Log: small msvc compiling fix Modified: trunk/reactos/dll/cpl/main/keyboard.c Modified: trunk/reactos/dll/cpl/main/keyboard.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/cpl/main/keyboard.c?rev…
============================================================================== --- trunk/reactos/dll/cpl/main/keyboard.c (original) +++ trunk/reactos/dll/cpl/main/keyboard.c Wed May 3 15:18:07 2006 @@ -58,13 +58,14 @@ IN WPARAM wParam, IN LPARAM lParam) { + GUID Guids[1]; + Guids[0] = GUID_DEVCLASS_KEYBOARD; + switch(uMsg) { case WM_INITDIALOG: { - GUID Guids[] = { - GUID_DEVCLASS_KEYBOARD - }; + /* create the hardware page */ DeviceCreateHardwarePageEx(hwndDlg,
18 years, 7 months
1
0
0
0
[fireball] 21783: [AUDIT] - w3seek says this file is derived from Wine and doesn't contain any possibly unclean code
by fireball@svn.reactos.org
Author: fireball Date: Wed May 3 14:57:26 2006 New Revision: 21783 URL:
http://svn.reactos.ru/svn/reactos?rev=21783&view=rev
Log: [AUDIT] - w3seek says this file is derived from Wine and doesn't contain any possibly unclean code Modified: trunk/reactos/dll/win32/kernel32/string/lstring.c (props changed) Propchange: trunk/reactos/dll/win32/kernel32/string/lstring.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
18 years, 7 months
1
0
0
0
[fireball] 21782: - Bug 1447: Patch by Thomas Weidenmueller "Use SEH for some lstring functions, partly adapted from WINE" WaxDragon tested this patch and confirmed it works fine.
by fireball@svn.reactos.org
Author: fireball Date: Wed May 3 14:55:46 2006 New Revision: 21782 URL:
http://svn.reactos.ru/svn/reactos?rev=21782&view=rev
Log: - Bug 1447: Patch by Thomas Weidenmueller "Use SEH for some lstring functions, partly adapted from WINE" WaxDragon tested this patch and confirmed it works fine. Modified: trunk/reactos/dll/win32/kernel32/string/lstring.c Modified: trunk/reactos/dll/win32/kernel32/string/lstring.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/kernel32/string/l…
============================================================================== --- trunk/reactos/dll/win32/kernel32/string/lstring.c (original) +++ trunk/reactos/dll/win32/kernel32/string/lstring.c Wed May 3 14:55:46 2006 @@ -11,6 +11,15 @@ #include <k32.h> +static _SEH_FILTER(lstr_page_fault) +{ + if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION) + return _SEH_EXECUTE_HANDLER; + else + return _SEH_CONTINUE_SEARCH; +} + + /* * @implemented */ @@ -75,36 +84,29 @@ int iMaxLength ) { - /* Can't use strncpy, because strncpy will fill unused bytes in - lpString1 with NUL bytes while lstrcpynA doesn't. Also lstrcpynA - guarantees NUL termination while strncpy doesn't */ - - if (lpString1 == NULL) - { - return NULL; - } - - if (1 < iMaxLength) - { - char *d = lpString1; - const char *s = lpString2; - - do + LPSTR d = lpString1; + LPCSTR s = lpString2; + UINT count = iMaxLength; + LPSTR Ret = NULL; + + _SEH_TRY + { + while ((count > 1) && *s) { - if ('\0' == *s) - break; - *d++ = *s++; + count--; + *d++ = *s++; } - while(1 != --iMaxLength); - *d = '\0'; - } - else if (1 == iMaxLength) - { - /* Only space for the terminator */ - *lpString1 = '\0'; - } - - return lpString1; + if (count) *d = 0; + + Ret = lpString1; + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError( ERROR_INVALID_PARAMETER ); + } + _SEH_END; + + return Ret; } @@ -118,12 +120,20 @@ LPCSTR lpString2 ) { - if (lpString1 == NULL) - { - return NULL; - } - - return strcpy(lpString1,lpString2); + LPSTR Ret = NULL; + + _SEH_TRY + { + memmove(lpString1, lpString2, strlen(lpString2) + 1); + Ret = lpString1; + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; } @@ -137,12 +147,20 @@ LPCSTR lpString2 ) { - if (lpString1 == NULL) - { - return NULL; - } - - return strcat(lpString1,lpString2); + LPSTR Ret = NULL; + + _SEH_TRY + { + Ret = strcat(lpString1, lpString2); + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; + } @@ -155,7 +173,19 @@ LPCSTR lpString ) { - return strlen(lpString); + INT Ret = 0; + + _SEH_TRY + { + Ret = strlen(lpString); + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; } @@ -222,36 +252,29 @@ int iMaxLength ) { - /* Can't use wcsncpy, because wcsncpy will fill unused bytes in - lpString1 with NUL bytes while lstrcpynW doesn't Also lstrcpynW - guarantees NUL termination while wcsncpy doesn't */ - - if (lpString1 == NULL) - { - return NULL; - } - - if (1 < iMaxLength) - { - WCHAR *d = lpString1; - const WCHAR *s = lpString2; - - do + LPWSTR d = lpString1; + LPCWSTR s = lpString2; + UINT count = iMaxLength; + LPWSTR Ret = NULL; + + _SEH_TRY + { + while ((count > 1) && *s) { - if (L'\0' == *s) - break; - *d++ = *s++; + count--; + *d++ = *s++; } - while(1 != --iMaxLength); - *d = L'\0'; - } - else if (1 == iMaxLength) - { - /* Only space for the terminator */ - *lpString1 = L'\0'; - } - - return lpString1; + if (count) *d = 0; + + Ret = lpString1; + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError( ERROR_INVALID_PARAMETER ); + } + _SEH_END; + + return Ret; } @@ -265,12 +288,19 @@ LPCWSTR lpString2 ) { - if (lpString1 == NULL) - { - return NULL; - } - - return wcscpy(lpString1,lpString2); + LPWSTR Ret = NULL; + + _SEH_TRY + { + Ret = strcpyW(lpString1, lpString2); + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; } @@ -284,12 +314,19 @@ LPCWSTR lpString2 ) { - if (lpString1 == NULL) - { - return NULL; - } - - return wcscat(lpString1,lpString2); + LPWSTR Ret = NULL; + + _SEH_TRY + { + Ret = wcscat(lpString1, lpString2); + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; } @@ -302,5 +339,17 @@ LPCWSTR lpString ) { - return wcslen(lpString); -} + INT Ret = 0; + + _SEH_TRY + { + Ret = wcslen(lpString); + } + _SEH_EXCEPT(lstr_page_fault) + { + SetLastError(ERROR_INVALID_PARAMETER); + } + _SEH_END; + + return Ret; +}
18 years, 7 months
1
0
0
0
[fireball] 21781: - Bug 1450: Patch by Thomas Weidenmueller "Some window class fixes" This patch makes registering the "Abiword" window class succeed. However, Abiword now crashes with a stack overflow recursively delivering the WM_NOTIFYFORMAT message to a subclassed rebar control...
by fireball@svn.reactos.org
Author: fireball Date: Wed May 3 14:48:38 2006 New Revision: 21781 URL:
http://svn.reactos.ru/svn/reactos?rev=21781&view=rev
Log: - Bug 1450: Patch by Thomas Weidenmueller "Some window class fixes" This patch makes registering the "Abiword" window class succeed. However, Abiword now crashes with a stack overflow recursively delivering the WM_NOTIFYFORMAT message to a subclassed rebar control... Modified: trunk/reactos/dll/win32/user32/windows/class.c trunk/reactos/subsystems/win32/win32k/ntuser/class.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/dll/win32/user32/windows/class.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/windows/cl…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/class.c (original) +++ trunk/reactos/dll/win32/user32/windows/class.c Wed May 3 14:48:38 2006 @@ -553,18 +553,22 @@ WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); } - if (lpwcx->lpszMenuName != NULL) - { - if (HIWORD(lpwcx->lpszMenuName)) + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) { - RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName); + if (WndClass.lpszMenuName[0]) + { + RtlCreateUnicodeStringFromAsciiz(&MenuName, WndClass.lpszMenuName); + } } else { MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; } - hMenu = LoadMenuA(WndClass.hInstance, lpwcx->lpszMenuName); + if (MenuName.Buffer != NULL) + hMenu = LoadMenuA(WndClass.hInstance, WndClass.lpszMenuName); } if (IS_ATOM(WndClass.lpszClassName)) @@ -585,7 +589,7 @@ REGISTERCLASS_ANSI, hMenu); - if (!IS_ATOM(WndClass.lpszMenuName)) + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) RtlFreeUnicodeString(&MenuName); if (!IS_ATOM(WndClass.lpszClassName)) RtlFreeUnicodeString(&ClassName); @@ -637,17 +641,22 @@ WndClass.hIconSm = CreateSmallIcon(WndClass.hIcon); } - if (lpwcx->lpszMenuName != NULL) - { - if (HIWORD(lpwcx->lpszMenuName)) + if (WndClass.lpszMenuName != NULL) + { + if (!IS_INTRESOURCE(WndClass.lpszMenuName)) { - RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); + if (WndClass.lpszMenuName[0]) + { + RtlInitUnicodeString(&MenuName, WndClass.lpszMenuName); + } } else { MenuName.Buffer = (LPWSTR)WndClass.lpszMenuName; } - hMenu = LoadMenuW(WndClass.hInstance, lpwcx->lpszMenuName); + + if (MenuName.Buffer != NULL) + hMenu = LoadMenuW(WndClass.hInstance, WndClass.lpszMenuName); } if (IS_ATOM(WndClass.lpszClassName)) Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/class.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c Wed May 3 14:48:38 2006 @@ -1432,6 +1432,8 @@ /* unlink the class */ *Link = Class->Next; + IntDeregisterClassAtom(Class->Atom); + /* finally free the resources */ IntDestroyClass(Class); return TRUE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c Wed May 3 14:48:38 2006 @@ -1491,7 +1491,7 @@ } else { - DPRINT1("Class %wZ not found\n", ClassName); + DPRINT1("Class \"%wZ\" not found\n", ClassName); } SetLastWin32Error(ERROR_CANNOT_FIND_WND_CLASS); @@ -2073,7 +2073,7 @@ RETURN( NULL); } } - else if (! IS_INTRESOURCE(ClassName.Buffer)) + else if (! IS_ATOM(ClassName.Buffer)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return NULL;
18 years, 7 months
1
0
0
0
[fireball] 21780: - Bug 1451: Patch by Thomas Weidenmueller: System controls, such as comboboxes and listboxes are always unicode, even when created with CreateWindowExA. Therefore, ansi messages need to be converted to unicode and vice versa when sent to these windows. This patch fixes some(!) of these issues! Not all control messages are handled!
by fireball@svn.reactos.org
Author: fireball Date: Wed May 3 14:35:11 2006 New Revision: 21780 URL:
http://svn.reactos.ru/svn/reactos?rev=21780&view=rev
Log: - Bug 1451: Patch by Thomas Weidenmueller: System controls, such as comboboxes and listboxes are always unicode, even when created with CreateWindowExA. Therefore, ansi messages need to be converted to unicode and vice versa when sent to these windows. This patch fixes some(!) of these issues! Not all control messages are handled! Modified: trunk/reactos/dll/win32/user32/windows/message.c trunk/reactos/subsystems/win32/win32k/ntuser/message.c Modified: trunk/reactos/dll/win32/user32/windows/message.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/windows/me…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/message.c (original) +++ trunk/reactos/dll/win32/user32/windows/message.c Wed May 3 14:35:11 2006 @@ -414,9 +414,44 @@ case LB_ADDFILE: case EM_REPLACESEL: { - UNICODE_STRING UnicodeString; - RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)AnsiMsg->lParam); - UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer; + goto ConvertLParamString; + } + + case LB_ADDSTRING: + case LB_ADDSTRING_LOWER: + case LB_ADDSTRING_UPPER: + case LB_INSERTSTRING: + case LB_INSERTSTRING_UPPER: + case LB_INSERTSTRING_LOWER: + case LB_FINDSTRING: + case LB_FINDSTRINGEXACT: + case LB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && + (dwStyle & LBS_HASSTRINGS)) + { + goto ConvertLParamString; + } + break; + } + + case CB_ADDSTRING: + case CB_INSERTSTRING: + case CB_FINDSTRING: + case CB_FINDSTRINGEXACT: + case CB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && + (dwStyle & CBS_HASSTRINGS)) + { + UNICODE_STRING UnicodeString; + +ConvertLParamString: + RtlCreateUnicodeStringFromAsciiz(&UnicodeString, (LPSTR)AnsiMsg->lParam); + UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer; + } break; } @@ -501,11 +536,47 @@ case LB_ADDFILE: case EM_REPLACESEL: { - UNICODE_STRING UnicodeString; - RtlInitUnicodeString(&UnicodeString, (PCWSTR)UnicodeMsg->lParam); - RtlFreeUnicodeString(&UnicodeString); - break; + goto FreeLParamString; } + + case LB_ADDSTRING: + case LB_ADDSTRING_LOWER: + case LB_ADDSTRING_UPPER: + case LB_INSERTSTRING: + case LB_INSERTSTRING_UPPER: + case LB_INSERTSTRING_LOWER: + case LB_FINDSTRING: + case LB_FINDSTRINGEXACT: + case LB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && + (dwStyle & LBS_HASSTRINGS)) + { + goto FreeLParamString; + } + break; + } + + case CB_ADDSTRING: + case CB_INSERTSTRING: + case CB_FINDSTRING: + case CB_FINDSTRINGEXACT: + case CB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && + (dwStyle & CBS_HASSTRINGS)) + { + UNICODE_STRING UnicodeString; + +FreeLParamString: + RtlInitUnicodeString(&UnicodeString, (PCWSTR)UnicodeMsg->lParam); + RtlFreeUnicodeString(&UnicodeString); + } + break; + } + case WM_NCCREATE: case WM_CREATE: @@ -640,20 +711,58 @@ break; } case WM_SETTEXT: - { - ANSI_STRING AnsiString; - UNICODE_STRING UnicodeString; - RtlInitUnicodeString(&UnicodeString, (PWSTR) UnicodeMsg->lParam); - if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, - &UnicodeString, - TRUE))) - { - return FALSE; - } - AnsiMsg->lParam = (LPARAM) AnsiString.Buffer; + case CB_DIR: + case LB_DIR: + case LB_ADDFILE: + { + goto ConvertLParamString; + } + + case LB_ADDSTRING: + case LB_ADDSTRING_LOWER: + case LB_ADDSTRING_UPPER: + case LB_INSERTSTRING: + case LB_INSERTSTRING_UPPER: + case LB_INSERTSTRING_LOWER: + case LB_FINDSTRING: + case LB_FINDSTRINGEXACT: + case LB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && + (dwStyle & LBS_HASSTRINGS)) + { + goto ConvertLParamString; + } break; - } - } + } + + case CB_ADDSTRING: + case CB_INSERTSTRING: + case CB_FINDSTRING: + case CB_FINDSTRINGEXACT: + case CB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && + (dwStyle & CBS_HASSTRINGS)) + { + ANSI_STRING AnsiString; + UNICODE_STRING UnicodeString; + +ConvertLParamString: + RtlInitUnicodeString(&UnicodeString, (PWSTR) UnicodeMsg->lParam); + if (! NT_SUCCESS(RtlUnicodeStringToAnsiString(&AnsiString, + &UnicodeString, + TRUE))) + { + return FALSE; + } + AnsiMsg->lParam = (LPARAM) AnsiString.Buffer; + } + break; + } + } return TRUE; } @@ -671,10 +780,7 @@ } case WM_SETTEXT: { - ANSI_STRING AString; - RtlInitAnsiString(&AString, (PSTR) AnsiMsg->lParam); - RtlFreeAnsiString(&AString); - break; + goto FreeLParamString; } case WM_CREATE: case WM_NCCREATE: @@ -693,6 +799,45 @@ RtlFreeHeap(GetProcessHeap(), 0, Cs); break; } + + case LB_ADDSTRING: + case LB_ADDSTRING_LOWER: + case LB_ADDSTRING_UPPER: + case LB_INSERTSTRING: + case LB_INSERTSTRING_UPPER: + case LB_INSERTSTRING_LOWER: + case LB_FINDSTRING: + case LB_FINDSTRINGEXACT: + case LB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) && + (dwStyle & LBS_HASSTRINGS)) + { + goto FreeLParamString; + } + break; + } + + case CB_ADDSTRING: + case CB_INSERTSTRING: + case CB_FINDSTRING: + case CB_FINDSTRINGEXACT: + case CB_SELECTSTRING: + { + DWORD dwStyle = GetWindowLongW(AnsiMsg->hwnd, GWL_STYLE); + if (!(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) && + (dwStyle & CBS_HASSTRINGS)) + { + ANSI_STRING AString; + +FreeLParamString: + RtlInitAnsiString(&AString, (PSTR) AnsiMsg->lParam); + RtlFreeAnsiString(&AString); + } + break; + } + } return TRUE; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/message.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c Wed May 3 14:35:11 2006 @@ -379,11 +379,15 @@ MsgInfo.HandledByKernel = FALSE; Result = 0; - MsgInfo.Ansi = !Window->Unicode; if (Window->IsSystem) - MsgInfo.Proc = (Window->Unicode ? Window->WndProc : Window->WndProcExtra); + { + MsgInfo.Proc = (!MsgInfo.Ansi ? Window->WndProc : Window->WndProcExtra); + } else + { + MsgInfo.Ansi = !Window->Unicode; MsgInfo.Proc = Window->WndProc; + } } } } @@ -1565,11 +1569,15 @@ Info.Ansi = ! Window->Unicode; } - Info.Ansi = !Window->Unicode; if (Window->IsSystem) - Info.Proc = (Window->Unicode ? Window->WndProc : Window->WndProcExtra); + { + Info.Proc = (!Info.Ansi ? Window->WndProc : Window->WndProcExtra); + } else + { + Info.Ansi = !Window->Unicode; Info.Proc = Window->WndProc; + } } else {
18 years, 7 months
1
0
0
0
[amunger] 21779: Move callproc code into own file and reduce unneccessary system calls to dereference them. It doesn't fix any bugs but improves performance a bit. Patch from w3seek, bug 1445.
by amunger@svn.reactos.org
Author: amunger Date: Wed May 3 08:17:50 2006 New Revision: 21779 URL:
http://svn.reactos.ru/svn/reactos?rev=21779&view=rev
Log: Move callproc code into own file and reduce unneccessary system calls to dereference them. It doesn't fix any bugs but improves performance a bit. Patch from w3seek, bug 1445. Added: trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c Modified: trunk/reactos/dll/win32/user32/windows/message.c trunk/reactos/subsystems/win32/win32k/include/class.h trunk/reactos/subsystems/win32/win32k/main/dllmain.c trunk/reactos/subsystems/win32/win32k/ntuser/class.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/win32k.rbuild Modified: trunk/reactos/dll/win32/user32/windows/message.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/user32/windows/me…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/message.c (original) +++ trunk/reactos/dll/win32/user32/windows/message.c Wed May 3 08:17:50 2006 @@ -1001,6 +1001,13 @@ } } +static BOOL __inline +IsCallProcHandle(IN WNDPROC lpWndProc) +{ + /* FIXME - check for 64 bit architectures... */ + return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000; +} + /* * @implemented @@ -1018,7 +1025,8 @@ if (lpPrevWndFunc == NULL) lpPrevWndFunc = (WNDPROC)NtUserGetWindowLong(hWnd, GWLP_WNDPROC, TRUE); - if (!NtUserDereferenceWndProcHandle((HANDLE)lpPrevWndFunc, + if (!IsCallProcHandle(lpPrevWndFunc) || + !NtUserDereferenceWndProcHandle((HANDLE)lpPrevWndFunc, &wpInfo)) { return IntCallWindowProcA(TRUE, lpPrevWndFunc, hWnd, Msg, wParam, lParam); @@ -1047,7 +1055,8 @@ if (lpPrevWndFunc == NULL) lpPrevWndFunc = (WNDPROC)NtUserGetWindowLong(hWnd, GWLP_WNDPROC, FALSE); - if (!NtUserDereferenceWndProcHandle((HANDLE)lpPrevWndFunc, + if (!IsCallProcHandle(lpPrevWndFunc) || + !NtUserDereferenceWndProcHandle((HANDLE)lpPrevWndFunc, &wpInfo)) { return IntCallWindowProcW(FALSE, lpPrevWndFunc, hWnd, Msg, wParam, lParam); Modified: trunk/reactos/subsystems/win32/win32k/include/class.h URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/class.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/class.h Wed May 3 08:17:50 2006 @@ -3,6 +3,9 @@ #define IS_ATOM(x) \ (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000)) + +WNDPROC +GetCallProcHandle(IN PCALLPROC CallProc); VOID DestroyCallProc(IN PDESKTOP Desktop, @@ -17,12 +20,6 @@ IN WNDPROC WndProc, IN BOOL Unicode, IN PW32PROCESSINFO pi); - -NTSTATUS FASTCALL -InitClassImpl(VOID); - -NTSTATUS FASTCALL -CleanupClassImpl(VOID); BOOL UserGetCallProcInfo(IN HANDLE hCallProc, Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/mai…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/main/dllmain.c (original) +++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c Wed May 3 08:17:50 2006 @@ -425,13 +425,6 @@ return STATUS_UNSUCCESSFUL; } - Status = InitClassImpl(); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to initialize window class implementation!\n"); - return STATUS_UNSUCCESSFUL; - } - Status = InitDesktopImpl(); if (!NT_SUCCESS(Status)) { Added: trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c (added) +++ trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c Wed May 3 08:17:50 2006 @@ -1,0 +1,156 @@ +/* + * ReactOS W32 Subsystem + * Copyright (C) 1998 - 2006 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: class.c 21596 2006-04-15 10:41:58Z greatlrd $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: Window classes + * FILE: subsys/win32k/ntuser/class.c + * PROGRAMER: Thomas Weidenmueller <w3seek(a)reactos.com> + * REVISION HISTORY: + * 06-06-2001 CSH Created + */ +/* INCLUDES ******************************************************************/ + +#include <w32k.h> + +#define NDEBUG +#include <debug.h> + +/* CALLPROC ******************************************************************/ + +WNDPROC +GetCallProcHandle(IN PCALLPROC CallProc) +{ + /* FIXME - check for 64 bit architectures... */ + return (WNDPROC)((ULONG_PTR)ObmObjectToHandle(CallProc) | 0xFFFF0000); +} + +VOID +DestroyCallProc(IN PDESKTOP Desktop, + IN OUT PCALLPROC CallProc) +{ + /* FIXME - use new object manager! */ + HANDLE Handle = ObmObjectToHandle(CallProc); + + ObmDeleteObject(Handle, + otCallProc); +} + +PCALLPROC +CloneCallProc(IN PDESKTOP Desktop, + IN PCALLPROC CallProc) +{ + PCALLPROC NewCallProc; + HANDLE Handle; + + /* FIXME - use new object manager! */ + NewCallProc = (PCALLPROC)ObmCreateObject(gHandleTable, + &Handle, + otCallProc, + sizeof(CALLPROC)); + if (NewCallProc != NULL) + { + NewCallProc->pi = CallProc->pi; + NewCallProc->WndProc = CallProc->WndProc; + NewCallProc->Unicode = CallProc->Unicode; + } + + return NewCallProc; +} + +PCALLPROC +CreateCallProc(IN PDESKTOP Desktop, + IN WNDPROC WndProc, + IN BOOL Unicode, + IN PW32PROCESSINFO pi) +{ + PCALLPROC NewCallProc; + HANDLE Handle; + + /* FIXME - use new object manager! */ + NewCallProc = (PCALLPROC)ObmCreateObject(gHandleTable, + &Handle, + otCallProc, + sizeof(CALLPROC)); + if (NewCallProc != NULL) + { + NewCallProc->pi = pi; + NewCallProc->WndProc = WndProc; + NewCallProc->Unicode = Unicode; + } + + return NewCallProc; +} + +BOOL +UserGetCallProcInfo(IN HANDLE hCallProc, + OUT PWNDPROC_INFO wpInfo) +{ + PCALLPROC CallProc; + + /* NOTE: Accessing the WNDPROC_INFO structure may raise an exception! */ + + /* FIXME - use new object manager! */ + CallProc = UserGetObject(gHandleTable, + hCallProc, + otCallProc); + if (CallProc == NULL) + { + return FALSE; + } + + if (CallProc->pi != GetW32ProcessInfo()) + { + return FALSE; + } + + wpInfo->WindowProc = CallProc->WndProc; + wpInfo->IsUnicode = CallProc->Unicode; + + return TRUE; +} + +BOOL NTAPI +NtUserDereferenceWndProcHandle(IN HANDLE wpHandle, + OUT PWNDPROC_INFO wpInfo) +{ + BOOL Ret = FALSE; + + UserEnterShared(); + + _SEH_TRY + { + ProbeForWrite(wpInfo, + sizeof(WNDPROC_INFO), + sizeof(ULONG)); + + Ret = UserGetCallProcInfo(wpHandle, + wpInfo); + } + _SEH_HANDLE + { + SetLastWin32Error(_SEH_GetExceptionCode()); + } + _SEH_END; + + UserLeave(); + + return Ret; +} Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/class.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c Wed May 3 08:17:50 2006 @@ -33,106 +33,7 @@ #define NDEBUG #include <debug.h> -/* CALLPROC ******************************************************************/ - -VOID -DestroyCallProc(IN PDESKTOP Desktop, - IN OUT PCALLPROC CallProc) -{ - /* FIXME - use new object manager! */ - HANDLE Handle = ObmObjectToHandle(CallProc); - - ObmDeleteObject(Handle, - otCallProc); -} - -PCALLPROC -CloneCallProc(IN PDESKTOP Desktop, - IN PCALLPROC CallProc) -{ - PCALLPROC NewCallProc; - HANDLE Handle; - - /* FIXME - use new object manager! */ - NewCallProc = (PCALLPROC)ObmCreateObject(gHandleTable, - &Handle, - otCallProc, - sizeof(CALLPROC)); - if (NewCallProc != NULL) - { - NewCallProc->pi = CallProc->pi; - NewCallProc->WndProc = CallProc->WndProc; - NewCallProc->Unicode = CallProc->Unicode; - } - - return NewCallProc; -} - -PCALLPROC -CreateCallProc(IN PDESKTOP Desktop, - IN WNDPROC WndProc, - IN BOOL Unicode, - IN PW32PROCESSINFO pi) -{ - PCALLPROC NewCallProc; - HANDLE Handle; - - /* FIXME - use new object manager! */ - NewCallProc = (PCALLPROC)ObmCreateObject(gHandleTable, - &Handle, - otCallProc, - sizeof(CALLPROC)); - if (NewCallProc != NULL) - { - NewCallProc->pi = pi; - NewCallProc->WndProc = WndProc; - NewCallProc->Unicode = Unicode; - } - - return NewCallProc; -} - -BOOL -UserGetCallProcInfo(IN HANDLE hCallProc, - OUT PWNDPROC_INFO wpInfo) -{ - PCALLPROC CallProc; - - /* NOTE: Accessing the WNDPROC_INFO structure may raise an exception! */ - - /* FIXME - use new object manager! */ - CallProc = UserGetObject(gHandleTable, - hCallProc, - otCallProc); - if (CallProc == NULL) - { - return FALSE; - } - - if (CallProc->pi != GetW32ProcessInfo()) - { - return FALSE; - } - - wpInfo->WindowProc = CallProc->WndProc; - wpInfo->IsUnicode = CallProc->Unicode; - - return TRUE; -} - /* WINDOWCLASS ***************************************************************/ - -NTSTATUS FASTCALL -InitClassImpl(VOID) -{ - return(STATUS_SUCCESS); -} - -NTSTATUS FASTCALL -CleanupClassImpl(VOID) -{ - return(STATUS_SUCCESS); -} static VOID IntFreeClassMenuName(IN OUT PWINDOWCLASS Class) @@ -345,7 +246,7 @@ if (*CallProcPtr != NULL) { - return (WNDPROC)ObmObjectToHandle(*CallProcPtr); + return GetCallProcHandle(*CallProcPtr); } else { @@ -392,7 +293,7 @@ Class = Class->Next; } - return (WNDPROC)ObmObjectToHandle(NewCallProc); + return GetCallProcHandle(NewCallProc); } } } @@ -2510,33 +2411,4 @@ return(0); } - -BOOL NTAPI -NtUserDereferenceWndProcHandle(IN HANDLE wpHandle, - OUT PWNDPROC_INFO wpInfo) -{ - BOOL Ret = FALSE; - - UserEnterShared(); - - _SEH_TRY - { - ProbeForWrite(wpInfo, - sizeof(WNDPROC_INFO), - sizeof(ULONG)); - - Ret = UserGetCallProcInfo(wpHandle, - wpInfo); - } - _SEH_HANDLE - { - SetLastWin32Error(_SEH_GetExceptionCode()); - } - _SEH_END; - - UserLeave(); - - return Ret; -} - /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c Wed May 3 08:17:50 2006 @@ -509,7 +509,7 @@ { if (Window->CallProc != NULL) { - return (WNDPROC)ObmObjectToHandle(Window->CallProc); + return GetCallProcHandle(Window->CallProc); } else { @@ -536,7 +536,7 @@ NewCallProc); } - return (WNDPROC)ObmObjectToHandle((CallProc == NULL ? NewCallProc : CallProc)); + return GetCallProcHandle((CallProc == NULL ? NewCallProc : CallProc)); } } } @@ -3464,7 +3464,7 @@ } } - Ret = (WNDPROC)ObmObjectToHandle(Window->CallProc2); + Ret = GetCallProcHandle(Window->CallProc2); } } Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/subsystems/win32/win32k/win…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/win32k.rbuild (original) +++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild Wed May 3 08:17:50 2006 @@ -84,6 +84,7 @@ <compilationunit name="ntuser.c"> <file>accelerator.c</file> <file>callback.c</file> + <file>callproc.c</file> <file>caret.c</file> <file>class.c</file> <file>clipboard.c</file>
18 years, 7 months
1
0
0
0
[cwittich] 21778: updated french translation patch by usurp fixes bug 1441
by cwittich@svn.reactos.org
Author: cwittich Date: Wed May 3 02:45:35 2006 New Revision: 21778 URL:
http://svn.reactos.ru/svn/reactos?rev=21778&view=rev
Log: updated french translation patch by usurp fixes bug 1441 Modified: trunk/reactos/base/applications/msconfig/En.rc trunk/reactos/base/applications/msconfig/Fr.rc Modified: trunk/reactos/base/applications/msconfig/En.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/msconfig/…
============================================================================== --- trunk/reactos/base/applications/msconfig/En.rc (original) +++ trunk/reactos/base/applications/msconfig/En.rc Wed May 3 02:45:35 2006 @@ -51,7 +51,7 @@ CONTROL "S&elective Startup", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 70, 10 CHECKBOX "P&rocess SYSTEM.INI File", IDC_CBX_SYSTEM_INI, 30, 80, 95, 10 CHECKBOX "&Load System Services", IDC_CBX_SYSTEM_SERVICE, 30, 95, 90, 10 - CHECKBOX "&L&oad Startup Items", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 + CHECKBOX "L&oad Startup Items", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 END IDD_FREELDR_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 Modified: trunk/reactos/base/applications/msconfig/Fr.rc URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/msconfig/…
============================================================================== --- trunk/reactos/base/applications/msconfig/Fr.rc (original) +++ trunk/reactos/base/applications/msconfig/Fr.rc Wed May 3 02:45:35 2006 @@ -39,6 +39,65 @@ CONTROL "List1",IDC_SERVICES_LIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP,2,1,360,148 PUSHBUTTON "&Activer tout",IDC_BTN_SERVICES_ACTIVATE,223,155,66,14 PUSHBUTTON "&Désactiver tout",IDC_BTN_SERVICES_DEACTIVATE,295,155,66,14 +END + +IDD_GENERAL_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + GROUPBOX "Sélection du Démarrage ", -1, 10, 10, 340, 150,0,WS_EX_TRANSPARENT + CONTROL "Démarrage &Normal - charge tous les drivers et services", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 185, 10 + CONTROL "Démarrage &Diagnostic - charge les périphériques de base et services seulement", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 260, 10 + CONTROL "Démarrage &Sélectif", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 75, 10 + CHECKBOX "T&raiter le fichier SYSTEM.INI", IDC_CBX_SYSTEM_INI, 30, 80, 100, 10 + CHECKBOX "&Charger les Services Système", IDC_CBX_SYSTEM_SERVICE, 30, 95, 105, 10 + CHECKBOX "L&oad Startup Items", IDC_CBX_STARTUP_ITEM, 30, 110, 75, 10 +END + +IDD_FREELDR_PAGE DIALOG DISCARDABLE 0, 0, 362, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CONTROL "", IDC_LIST_BOX, "ListBox", 0x50010141, 10, 10, 340, 50, 0x00000200 + PUSHBUTTON "&Check All Boot Paths", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 + PUSHBUTTON "&Par Défaut", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 + PUSHBUTTON "&Monter", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 + PUSHBUTTON "&Descendre", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 + GROUPBOX "Options de Boot", -1, 10, 80, 250, 90,0,WS_EX_TRANSPARENT + CHECKBOX "/SA&FEBOOT", IDC_CBX_SAFE_BOOT, 15, 90, 50, 10 + CHECKBOX "/&NOGUIBOOT", IDC_CBX_NO_GUI_BOOT, 15, 105, 55, 10 + CHECKBOX "/&BOOTLOG", IDC_CBX_BOOT_LOG, 15, 120, 50, 10 + CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 + CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 + PUSHBUTTON "Options A&vancées...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 + LTEXT "&Délai:", -1, 280, 91, 30, 10 + EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT + LTEXT "sec.", -1, 340, 91, 15, 10 +END + +IDD_FREELDR_ADVANCED_PAGE DIALOG DISCARDABLE 0, 0, 175, 175 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "Tahoma" +BEGIN + CHECKBOX "/&MAXMEM=", IDC_CBX_MAX_MEM, 10, 10, 50, 10 + EDITTEXT IDC_TXT_MAX_MEM, 80, 10, 60, 12 + CONTROL "",IDC_SCR_MAX_MEM, "msctls_updown32", 0x50000000, 140, 10, 11, 11 + CHECKBOX "/&NUMPROC=", IDC_CBX_NUM_PROC, 10, 25, 50, 10 + COMBOBOX IDC_DRP_NUM_PROC, 80, 25, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&PCILOCK", IDC_CBX_PCI_LOCK, 10, 40, 50, 10 + CHECKBOX "/P&ROFILE", IDC_CBX_PROFILE, 10, 55, 50, 10 + CHECKBOX "/&IRQ", IDC_CBX_IRQ, 10, 70, 40, 12 + EDITTEXT IDC_TXT_IRQ, 80, 70, 60, 12, ES_LEFT + CHECKBOX "/&DEBUG", IDC_CBX_DEBUG, 10, 85, 40, 10 + CHECKBOX "/D&EBUGPORT", IDC_CBX_DEBUG_PORT, 20, 100, 60, 10 + COMBOBOX IDC_DRP_DEBUG_PORT, 80, 100, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&BAUDRATE", IDC_CBX_BAUD_RATE, 20, 115, 50, 10 + COMBOBOX IDC_DRP_DRP_BAUD_RATE, 80, 115, 60, 10, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP + CHECKBOX "/&CHANNEL", IDC_CBX_CHANNEL, 20, 130, 50, 10 + EDITTEXT IDC_TXT_CHANNEL, 80, 130, 60, 12, ES_LEFT + CONTROL "",IDC_SCR_CHANNEL, "msctls_updown32", 0x50000000, 140, 130, 11, 11 + PUSHBUTTON "Ok", IDC_OK, 20, 160, 50, 12 + PUSHBUTTON "Annuler", IDC_CANCEL, 100, 160, 50, 12 END STRINGTABLE DISCARDABLE
18 years, 7 months
1
0
0
0
[gedmurphy] 21777: Got carried away ;)
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Wed May 3 01:11:36 2006 New Revision: 21777 URL:
http://svn.reactos.ru/svn/reactos?rev=21777&view=rev
Log: Got carried away ;) Modified: trunk/reactos/base/applications/screensavers/matrix/screensave.c Modified: trunk/reactos/base/applications/screensavers/matrix/screensave.c URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/applications/screensav…
============================================================================== --- trunk/reactos/base/applications/screensavers/matrix/screensave.c (original) +++ trunk/reactos/base/applications/screensavers/matrix/screensave.c Wed May 3 01:11:36 2006 @@ -151,10 +151,10 @@ switch(chOption) { - case _T('s'): return ScreenSaver(NULL); // screen save - case _T('p'): return ScreenSaver(hwndParent); // preview in small window - case _T('a'): return ChangePassword(hwndParent); // ask for password - case _T('c'): return Configure(hwndParent); // configuration dialog + case 's': return ScreenSaver(NULL); // screen save + case 'p': return ScreenSaver(hwndParent); // preview in small window + case 'a': return ChangePassword(hwndParent); // ask for password + case 'c': return Configure(hwndParent); // configuration dialog default: return Configure(hwndParent); // configuration dialog }
18 years, 7 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Results per page:
10
25
50
100
200