Recent

Author Topic: $5 task: put the IDE mod into a package  (Read 526 times)

Fibonacci

  • Hero Member
  • *****
  • Posts: 712
  • Internal Error Hunter
$5 task: put the IDE mod into a package
« on: April 22, 2025, 02:19:43 pm »
I will pay the equivalent of $5 USD in LTC for someone to convert this mod into an installable package.

I want the package (its source and files count) to be as simple and small as possible.

Mod source right here:
https://github.com/fibodevy/Lazarus/commit/9eb6c34fa3b193076973ed11b344cb1ffad4e6ae

This modification simply prevents taking a screenshot of the IDE window. With the ON/OFF option. Windows only.

n7800

  • Sr. Member
  • ****
  • Posts: 292
Re: $5 task: put the IDE mod into a package
« Reply #1 on: April 22, 2025, 11:01:39 pm »
It's hard to make a big package for such a task )) Attached to the message. The code is provided as is, without guarantees, authorship, limitations, etc. ...

I tested on Windows 8.1, which uses WDA_MONITOR instead of WDA_EXCLUDEFROMCAPTURE, so only the contents are hidden in the attached screenshot, not the entire window.

Instead of changing the signature "ON"/"OFF", I allowed myself to simply mark the menu command with a check box. It will be displayed instead of the icon.

And just as a joke, I shortened the code of your function to two lines )) Of course, you can return the original or write a new one. Especially since they are not quite equivalent when GetWindowDisplayAffinity returns false.

I will not bother with resource strings, I doubt you really need a translation. It is much more interesting to add a keyboard shortcut, if you want.

No reward required, thank you ))

Fibonacci

  • Hero Member
  • *****
  • Posts: 712
  • Internal Error Hunter
Re: $5 task: put the IDE mod into a package
« Reply #2 on: April 22, 2025, 11:35:03 pm »
Excellent work Sir, thank you.

I simply needed this one as an installable package and it seemed to me that learning how to create them for such a simple task is too much work :D

I tested on Windows 8.1, which uses WDA_MONITOR instead of WDA_EXCLUDEFROMCAPTURE, so only the contents are hidden in the attached screenshot, not the entire window.

Indeed, WDA_EXCLUDEFROMCAPTURE was added in Windows 10 build 2004.

Instead of changing the signature "ON"/"OFF", I allowed myself to simply mark the menu command with a check box. It will be displayed instead of the icon.

Great move Sir. Its something I would have to wonder how to do knowing little to nothing about the internals of the IDE.

And just as a joke, I shortened the code of your function to two lines )) Of course, you can return the original or write a new one. Especially since they are not quite equivalent when GetWindowDisplayAffinity returns false.

Actually, I changed this:
Code: Pascal  [Select][+][-]
  1. itmViewToggleDisplayAffinity.Checked := GetWindowDisplayAffinity(LazarusIDE.GetMainBar.Handle, @lAffinity) and (lAffinity = 0);
  2. SetWindowDisplayAffinity(LazarusIDE.GetMainBar.Handle, IfThen(itmViewToggleDisplayAffinity.Checked, $11, 0));
To this:
Code: Pascal  [Select][+][-]
  1. itmViewToggleDisplayAffinity.Checked := GetWindowDisplayAffinity(LazarusIDE.GetMainBar.Handle, @lAffinity) and SetWindowDisplayAffinity(LazarusIDE.GetMainBar.Handle, IfThen(lAffinity = 0, $11, 0)) and (lAffinity = 0);

To ensure the checkbox is only checked if it really worked, in case the Handle is somehow invalid.

I will not bother with resource strings, I doubt you really need a translation.

Its absolutely fine. I just added it because I was copying the other item from the "View" menu.

It is much more interesting to add a keyboard shortcut, if you want.

If you feel like doing it, go ahead - just as a reference for how to make such cool add-ons like that in the future. I dont need it in this case as theres a risk of accidentally turning the feature off.

No reward required, thank you ))

You sure? I really wanted to make that little Litecoin transfer. You must have had at least one coffee for this :D
« Last Edit: April 23, 2025, 05:55:17 am by Fibonacci »

 

TinyPortal © 2005-2018