开发者

Registry Editing: How to calculate DWord Hex Values

开发者 https://www.devze.com 2023-04-09 23:50 出处:网络
I\'m trying to make some registry edits and I\'m not sure I understand how specific dword values are calculated.

I'm trying to make some registry edits and I'm not sure I understand how specific dword values are calculated.

Here are two examples:

 [HKEY_CURRENT_USER\ControlPanel\Volume]
 "Volume"=dword:0xFFFFFFFF ; 0=off, 0xFFFFFFFF=maximum

 "Refresh"=dword:493E0 ; every 5 minutes

For the volume, how would I calculate what the range of options are if 0xFFFFFFFF is the max? And for "Refresh", if 493E0 is every 5 minutes, how do I figure out what every minute, or every day or every hour would be?

This is a Motorola Symbol M开发者_JAVA百科K4000 WinCE 5.0 device.


Volume is splt in 2. The low word is left and the high word is right. 0xffff on a channel corresponds to 100% or "max". 50% is 0x7fff and so on. Remember that is also rarely linear, so 50% volume doesn't mean 50% as loud.

EDIT

To clarify a bit further, the volume is split into two channels. I'll assume that you want the same volume on each.

The general formula is [left value] | ([right value << 16])

Here are examples:

For 100%, a value of 0xFFFF on both channels is what you want.
Value = 0xFFFFFFFF == 0xFFFF | (0xFFFF << 16)

For 50%, a value of 0x7FFF on both channels (0xffff / 2) is what you want.
Value = 0x7FFF7FFF == 0x7FFF | (0x7FFF << 16)

For 25%, a value of 0x3FFF on both channels (0x7fff / 2) is what you want.
Value = 0x3FFF3FFF == 0x3FFF | (0x3FFF << 16)


If you put the windows calculator into scientific mode, you can convert between HEX and regular DECIMAL easily.

http://scripts.sil.org/cms/scripts/page.php?item_id=HextoDecConversion

EDIT: The number 0x493E0 is 300000, which I imagine is the number of MILLISECONDS, divide that by 1000 to get the number of seconds (300), divide that by 60 to get the number of minutes (5).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号