Skip to content

Wrong type on RegisterHotkey constants. #836

@CentricStorm

Description

@CentricStorm

The RegisterHotKey function's fsModifiers parameter is a UINT, so these constants should be UINTs as well:

winapi-rs/src/um/winuser.rs

Lines 1949 to 1953 in 7abd241

pub const MOD_ALT: LPARAM = 0x0001;
pub const MOD_CONTROL: LPARAM = 0x0002;
pub const MOD_SHIFT: LPARAM = 0x0004;
pub const MOD_WIN: LPARAM = 0x0008;
pub const MOD_NOREPEAT: LPARAM = 0x4000;

Although these same constants can be used for WM_HOTKEY message LPARAM comparisons, they are only meant to be compared to the LPARAM's low-order word, so UHALF_PTR would be optimal in that scenario, however the RegisterHotKey function should probably be given priority seeing as the constants are declared immediately after it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAny sort of bugwaiting for 0.4This issue will be fixed in 0.4

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions