117 lines
No EOL
8.6 KiB
XML
117 lines
No EOL
8.6 KiB
XML
<Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' >
|
|
<ScrollViewer>
|
|
<StackPanel Margin = "10">
|
|
<TextBlock FontSize="17" FontWeight="Bold">RegisterHotKey</TextBlock>
|
|
<TextBlock Padding="30,10,0,15" TextWrapping="Wrap">The <Run FontWeight="Bold">RegisterHotKey</Run> function defines a system-wide hot key.</TextBlock>
|
|
|
|
<Border Margin="30,0,0,20" Background="#dddddd" BorderBrush="#999999" BorderThickness="1">
|
|
<StackPanel>
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,5,0,0" FontWeight="Bold">BOOL RegisterHotKey(</TextBlock>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<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>
|
|
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,0,0,10" FontWeight="Bold">};</TextBlock>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<TextBlock FontWeight="Bold">Parameters</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap"><Run FontStyle="Italic">hWnd</Run></TextBlock>
|
|
<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>
|
|
|
|
<TextBlock Padding="30,0,0,0"><Run FontStyle="Italic">id</Run></TextBlock>
|
|
<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>
|
|
|
|
<TextBlock Padding="30,0,0,0"><Run FontStyle="Italic">fsModifiers</Run></TextBlock>
|
|
<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>
|
|
|
|
<Border BorderThickness="1" BorderBrush="#999999" Margin="50,10,70,0" VerticalAlignment="Top">
|
|
<Grid >
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<Border Background="#CCCCCC" BorderBrush="#999999" BorderThickness="1" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4" FontWeight="Bold">Value</TextBlock>
|
|
</Border>
|
|
<Border Background="#CCCCCC" BorderBrush="#999999" BorderThickness="1" Grid.Column = "1">
|
|
<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4" FontWeight="Bold">Meaning</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "1" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_ALT</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "1" Grid.Column = "1" Cursor="Hand">
|
|
<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either ALT key must be held down.</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "2" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_CONTROL</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "2" Grid.Column = "1">
|
|
<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either CTRL key must be held down.</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "3" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_KEYUP</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "3" Grid.Column = "1">
|
|
<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>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "4" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_SHIFT</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "4" Grid.Column = "1">
|
|
<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" HorizontalAlignment="Left" Padding="10,4,4,4">Either SHIFT key must be held down.</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "5" Grid.Column = "0">
|
|
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,4,4,4">MOD_WIN</TextBlock>
|
|
</Border>
|
|
<Border Background="White" BorderBrush="#999999" BorderThickness="1" Grid.Row = "5" Grid.Column = "1">
|
|
<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>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
<TextBlock Padding="30,10,0,0"><Run FontStyle="Italic">vk</Run></TextBlock>
|
|
<TextBlock Padding="50,0,0,10" TextWrapping="Wrap">[in] Specifies the virtual-key code of the hot key.</TextBlock>
|
|
|
|
<TextBlock FontWeight="Bold">Return Values</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap">If the function succeeds, the return value is nonzero.<LineBreak/>
|
|
If the function fails, the return value is zero. To get extended error information, call <Hyperlink>GetLastError</Hyperlink>.
|
|
</TextBlock>
|
|
|
|
<TextBlock Padding="0,10,0,0" FontWeight="Bold">Remarks</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap">When a key is pressed, the system looks for a match against all hot keys.
|
|
Upon finding a match, the system posts the WM_HOTKEY message to the message queue of the thread that registered
|
|
the hot key. This message is posted to the beginning of the queue so it is removed by the next iteration
|
|
of the message loop.
|
|
</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
|
|
<Run FontWeight="Bold">RegisterHotKey</Run> can be used to register hot keys across threads.
|
|
</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
|
|
<Run FontWeight="Bold">RegisterHotKey</Run> fails if the keystrokes specified for the hot key have already been registered by another hot key.
|
|
</TextBlock>
|
|
<TextBlock Padding="30,10,0,0" TextWrapping="Wrap">
|
|
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.
|
|
</TextBlock>
|
|
|
|
<TextBlock Padding="0,10,0,0" FontWeight="Bold"><Hyperlink>Requirements</Hyperlink></TextBlock>
|
|
<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>
|
|
<TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Windows 95/98/Me:</Run> Included in Windows 95 and later.</TextBlock>
|
|
<TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Header:</Run> Declared in Winuser.h; include Windows.h.</TextBlock>
|
|
<TextBlock Padding="30,0,0,0" TextWrapping="Wrap"><Run FontWeight="Bold">Library:</Run> Use User32.lib.</TextBlock>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Page> |