Click here to Skip to main content
15,898,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: registry vs isolated storage Pin
Marc Clifton26-Apr-05 3:20
mvaMarc Clifton26-Apr-05 3:20 
GeneralRe: registry vs isolated storage Pin
balkang26-Apr-05 3:52
balkang26-Apr-05 3:52 
GeneralRe: registry vs isolated storage Pin
Marc Clifton26-Apr-05 4:20
mvaMarc Clifton26-Apr-05 4:20 
GeneralRe: registry vs isolated storage Pin
balkang26-Apr-05 5:55
balkang26-Apr-05 5:55 
GeneralMnemonics in .Net Menu Pin
Member 175862526-Apr-05 2:29
Member 175862526-Apr-05 2:29 
GeneralRe: Mnemonics in .Net Menu Pin
Marc Clifton26-Apr-05 3:21
mvaMarc Clifton26-Apr-05 3:21 
GeneralRe: Mnemonics in .Net Menu Pin
Dave Kreskowiak26-Apr-05 5:05
mveDave Kreskowiak26-Apr-05 5:05 
GeneralRe: Mnemonics in .Net Menu Pin
Heath Stewart26-Apr-05 6:08
protectorHeath Stewart26-Apr-05 6:08 
Mark and Dave are right. You really should honor your users' settings unless you like unhappy users. You could, however, expose the functionality to enable or disable such a feature in an options dialog, menu, etc.

You can P/Invoke SystemParametersInfo and use SPI_SETKEYBOARDCUES to enable or disable the feature:
[DllImport("user32.dll", EntryPoint="SystemParametersInfo", SetLastError=true)]
static extern bool SetSystemParametersInfo(uint uiAction, uint uiParam,
  bool pvParam, uint fWinIni);
 
[DllImport("user32.dll", EntryPoint="SystemParametersInfo", SetLastError=true)]
static extern bool GetSystemParametersInfo(uint uiAction, uint uiParam,
  out bool pvParam, uint fWinIni);
 
const uint SPI_GETKEYBOARDCUES = 0x100a;
const uint SPI_SETKEYBOARDCUES = 0x100b;
const uint SPIF_UPDATEINIFILE  = 0x0001;
const uint SPIF_SENDCHANGE     = 0x0002;
 
public static bool KeyboardCues
{
  get
  {
    bool value = false;
    if (!GetSystemParametersInfo(SPI_GETKEYBOARDCUES, 0, out value,
      SPIF_UPDATEINIFILE | SPIF_SENDCHANGE))
      throw new Win32Exception(); // GetLastError()
 
    return value;
  }
  set
  {
    if (!SetSystemParametersInfo(SPI_SETKEYBOARDCUES, 0, value,
      SPIF_UPDATEINIFILE | SPIF_SENDCHANGE))
      throw new Win32Exception(); // GetLastError()
  }
}


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft

[My Articles] [My Blog]
GeneralHello Pin
codingforlife26-Apr-05 2:15
codingforlife26-Apr-05 2:15 
GeneralRe: Hello Pin
Colin Angus Mackay26-Apr-05 2:40
Colin Angus Mackay26-Apr-05 2:40 
GeneralRe: Hello Pin
mav.northwind26-Apr-05 2:53
mav.northwind26-Apr-05 2:53 
GeneralRe: Hello Pin
Dave Kreskowiak26-Apr-05 5:02
mveDave Kreskowiak26-Apr-05 5:02 
GeneralModeless Help Window... Pin
Anonymous26-Apr-05 2:12
Anonymous26-Apr-05 2:12 
QuestionHow to Dial From One PC to other PC in LAN Pin
voip application26-Apr-05 1:22
voip application26-Apr-05 1:22 
AnswerRe: How to Dial From One PC to other PC in LAN Pin
Colin Angus Mackay26-Apr-05 2:46
Colin Angus Mackay26-Apr-05 2:46 
GeneralProcessBar stops in client window Pin
fracalifa26-Apr-05 1:14
fracalifa26-Apr-05 1:14 
GeneralRe: ProcessBar stops in client window Pin
Marc Clifton26-Apr-05 3:28
mvaMarc Clifton26-Apr-05 3:28 
GeneralRe: ProcessBar stops in client window Pin
fracalifa26-Apr-05 8:27
fracalifa26-Apr-05 8:27 
GeneralRe: ProcessBar stops in client window Pin
fracalifa1-May-05 5:15
fracalifa1-May-05 5:15 
GeneralHTML Editor Pin
Manish Rakheja25-Apr-05 23:52
Manish Rakheja25-Apr-05 23:52 
GeneralRe: HTML Editor Pin
Polis Pilavas26-Apr-05 1:36
Polis Pilavas26-Apr-05 1:36 
Generala problem of collision Pin
harry~25-Apr-05 21:49
harry~25-Apr-05 21:49 
GeneralRe: a problem of collision Pin
mav.northwind25-Apr-05 22:01
mav.northwind25-Apr-05 22:01 
GeneralRe: a problem of collision Pin
harry~25-Apr-05 22:33
harry~25-Apr-05 22:33 
GeneralRe: a problem of collision Pin
Polis Pilavas26-Apr-05 1:41
Polis Pilavas26-Apr-05 1:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.