Forum > Win32/64

WM_SYSCOMMAND: things are more complex than suggested in lMessages.pp [solved]

<< < (2/2)

Remy Lebeau:

--- Quote from: PeterX on May 27, 2021, 12:26:58 pm ---I would put up a bug report to change and comment
the CONST definitions in  lMessages.pp

--- End quote ---

The constants are not wrong, they are just declared in decimal format whereas Microsoft documents them in hex format instead.  They are the correct numeric values as far as the compiler is concerned.


--- Quote from: PeterX on May 27, 2021, 12:26:58 pm ---Declaration SC_SIZE for example is in use in 5 lcl units.

--- End quote ---

So?  As long as those units are using the human-readable alias names and not the actual numeric values, then it should not matter whether the values are declared as decimal or hex.

Remy Lebeau:

--- Quote from: PeterX on May 27, 2021, 02:45:50 pm ---Not ready at all, but I found most of the values
I probably need, see attached Example Project.

--- End quote ---

Just nitpicking at this point, but if you are going to drill into the private OS bits, then you should at least be consistent about it.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---case Msg.CmdType and $FFF0 of   SC_SIZE:  // move form ..  SC_MOVE = $F000    begin      case Msg.CmdType of        $F001:  // click on left vertical border        ...      end;    end;  ...end;
Should be


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---case Msg.CmdType and $FFF0 of   SC_SIZE:  // move form ..  SC_MOVE = $F000    begin      case Msg.CmdType and $F of        $1:  // click on left vertical border        ...      end;    end;   ...end;
To match with your other case statements.

Just saying...

PeterX:

--- Quote from: Remy Lebeau on May 27, 2021, 05:20:27 pm ---As long as those units are using the human-readable alias names and not the actual numeric values, then it should not matter whether the values are declared as decimal or hex.

--- End quote ---
My idea was, when right clicking on one of these CONST values,
Lazarus opens lMessages.pp and shows You the declaration in the source code.
And there is no comments about the technical background as You pointed me to.
( => "the four low-order bits of the wParam parameter are used internally by the system" ..)

I am the first time "hacking into" reserved bits of Windows' internal machine.
Without Your Hints (thanks !) it would have taken much more time for me to find out and understand.

So the const values, declared as hexadecimal, look much more logical
and do point directly to such a mechanism like bitweise operation and/or masking.
The decimal declarations look like a "wild zoo of numbers" to me, and they hide things a little bit.

Just my 2 cents ..

PeterX:

--- Quote from: Remy Lebeau on May 27, 2021, 05:30:44 pm ---Just nitpicking at this point, but if you are going to drill into the private OS bits, then you should at least be consistent about it.

--- End quote ---
That's totally okay !

I also don't like inconsistent code, thanks for this hint !

Including these wrong comments ..

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---SC_SIZE:  // move form ..  SC_MOVE = $F000
 %)

Navigation

[0] Message Index

[*] Previous page

Go to full version