HelpPageSample.xaml
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:9k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. <Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' >
  2. <ScrollViewer>
  3. <StackPanel Margin = "10">
  4. <TextBlock FontSize="17" FontWeight="Bold">RegisterHotKey</TextBlock>
  5. <TextBlock Padding="30,10,0,15" TextWrapping="Wrap">The <Run FontWeight="Bold">RegisterHotKey</Run> function defines a system-wide hot key.</TextBlock>
  6. <Border Margin="30,0,0,20" Background="#dddddd" BorderBrush="#999999" BorderThickness="1">
  7. <StackPanel>
  8. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,5,0,0" FontWeight="Bold">BOOL RegisterHotKey(</TextBlock>
  9. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="40,0,0,0"><Run FontWeight="Bold">HWND</Run> <Hyperlink><Run FontWeight="Normal" FontStyle="Italic">hWnd</Run></Hyperlink>,</TextBlock>
  10. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="40,0,0,0"><Run FontWeight="Bold">int</Run> <Hyperlink><Run FontWeight="Normal" FontStyle="Italic">id</Run></Hyperlink>,</TextBlock>
  11. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="40,0,0,0"><Run FontWeight="Bold">UINT</Run> <Hyperlink><Run FontWeight="Normal" FontStyle="Italic">fsModifiers</Run></Hyperlink>,</TextBlock>
  12. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="40,0,0,0"><Run FontWeight="Bold">UINT</Run> <Hyperlink><Run FontWeight="Normal" FontStyle="Italic">vk</Run></Hyperlink>,</TextBlock>
  13. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,10" FontWeight="Bold">};</TextBlock>
  14. </StackPanel>
  15. </Border>
  16. <TextBlock FontWeight="Bold">Parameters</TextBlock>
  17. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap"><Run FontStyle="Italic">hWnd</Run></TextBlock>
  18. <TextBlock Padding="50,0,0,10" TextWrapping="Wrap">[in] Handle to the window that will receive <Hyperlink>WM_HOTKEY</Hyperlink> messages generated by the hot key. The value of this parameter should not be NULL.</TextBlock>
  19. <TextBlock Padding="30,0,0,0"><Run FontStyle="Italic">id</Run></TextBlock>
  20. <TextBlock Padding="50,0,0,10" TextWrapping="Wrap">[in] Identifier of the hot key. No other hot key in the calling thread should have the same identifier. An application must specify a value in the range 0x0000 through 0xBFFF. A shared dynamic-link library (DLL) must specify a value in the range 0xC000 through 0xFFFF. </TextBlock>
  21. <TextBlock Padding="30,0,0,0"><Run FontStyle="Italic">fsModifiers</Run></TextBlock>
  22. <TextBlock Padding="50,0,0,0" TextWrapping="Wrap">[in] Specifies keys that must be pressed in combination with the key specified by the nVirtKey parameter in order to generate a WM_HOTKEY message. The fsModifiers parameter can be a combination of the following values.</TextBlock>
  23. <Border BorderThickness="1" BorderBrush="#999999" Margin="50,10,70,0"  VerticalAlignment="Top">
  24. <Grid >
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="Auto"/>
  27. <ColumnDefinition Width="*"/>
  28. </Grid.ColumnDefinitions>
  29. <Grid.RowDefinitions>
  30. <RowDefinition/>
  31. <RowDefinition/>
  32. <RowDefinition/>
  33. <RowDefinition/>
  34. <RowDefinition/>
  35. <RowDefinition/>
  36. </Grid.RowDefinitions>
  37. <Border Background="#CCCCCC" BorderBrush="#999999" BorderThickness="1" Grid.Column = "0">
  38. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4" FontWeight="Bold">Value</TextBlock>
  39. </Border>
  40. <Border Background="#CCCCCC" BorderBrush="#999999" BorderThickness="1" Grid.Column = "1">
  41. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4" FontWeight="Bold">Meaning</TextBlock>
  42. </Border>
  43. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "1" Grid.Column = "0">
  44. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_ALT</TextBlock>
  45. </Border>
  46. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "1" Grid.Column = "1" Cursor="Hand">
  47. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either ALT key must be held down.</TextBlock>
  48. </Border>
  49. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "2" Grid.Column = "0">
  50. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_CONTROL</TextBlock>
  51. </Border>
  52. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "2" Grid.Column = "1">
  53. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either CTRL key must be held down.</TextBlock>
  54. </Border>
  55. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "3" Grid.Column = "0">
  56. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_KEYUP</TextBlock>
  57. </Border>
  58. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "3" Grid.Column = "1">
  59. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Both key up events and key down events generate a WM_HOTKEY message.</TextBlock>
  60. </Border>
  61. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "4" Grid.Column = "0">
  62. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_SHIFT</TextBlock>
  63. </Border>
  64. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "4" Grid.Column = "1">
  65. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either SHIFT key must be held down.</TextBlock>
  66. </Border>
  67. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "5" Grid.Column = "0">
  68. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_WIN</TextBlock>
  69. </Border>
  70. <Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "5" Grid.Column = "1">
  71. <TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either WINDOWS key was held down. These keys are labeled with the Microsoft Windows logo.</TextBlock>
  72. </Border>
  73. </Grid>
  74.     </Border>
  75. <TextBlock Padding="30,10,0,0"><Run FontStyle="Italic">vk</Run></TextBlock>
  76. <TextBlock Padding="50,0,0,10" TextWrapping="Wrap">[in] Specifies the virtual-key code of the hot key.</TextBlock>
  77. <TextBlock FontWeight="Bold">Return Values</TextBlock>
  78. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap">If the function succeeds, the return value is nonzero.<LineBreak/>
  79. If the function fails, the return value is zero. To get extended error information, call <Hyperlink>GetLastError</Hyperlink>.
  80. </TextBlock>
  81. <TextBlock Padding="0,10,0,0" FontWeight="Bold">Remarks</TextBlock>
  82. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap">When a key is pressed, the system looks for a match against all hot keys. 
  83. Upon finding a match, the system posts the WM_HOTKEY message to the message queue of the thread that registered 
  84. the hot key. This message is posted to the beginning of the queue so it is removed by the next iteration 
  85. of the message loop.
  86. </TextBlock>
  87. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
  88. <Run FontWeight="Bold">RegisterHotKey</Run> can be used to register hot keys across threads.
  89. </TextBlock>
  90. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
  91. <Run FontWeight="Bold">RegisterHotKey</Run> fails if the keystrokes specified for the hot key have already been registered by another hot key. 
  92. </TextBlock>
  93. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
  94. If the window identified by the <Run FontStyle="Italic">hWnd</Run> parameter already registered a hot key with the same identifier as that specified by the <Run FontStyle="Italic">id</Run> parameter, the new values for the <Run FontStyle="Italic">fsModifiers</Run> and <Run FontStyle="Italic">vk</Run> parameters replace the previously specified values for these parameters. 
  95. </TextBlock>
  96. <TextBlock Padding="0,10,0,0" FontWeight="Bold"><Hyperlink>Requirements</Hyperlink></TextBlock>
  97. <TextBlock Padding="30,10,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Windows NT/2000/XP:</Run> Included in Windows NT 3.1 and later.</TextBlock>
  98. <TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Windows 95/98/Me:</Run> Included in Windows 95 and later.</TextBlock>
  99. <TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Header:</Run> Declared in Winuser.h; include Windows.h.</TextBlock>
  100. <TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Library:</Run> Use User32.lib.</TextBlock>
  101. </StackPanel>
  102. </ScrollViewer>
  103. </Page>