The MASM Forum

Miscellaneous => Miscellaneous Projects => Topic started by: jimg on November 03, 2018, 04:46:13 AM

Title: Covers
Post by: jimg on November 03, 2018, 04:46:13 AM
This is a little program I have use for some years for various purposes.  I recently updated it so I thought I'd share it for anyone that had a use.

The purpose is to simply block out portions of the screen as desired.  I primarily use it to block out distracting portions of some games and block out everything except the text when I use the kindle reader pc program.

When you start the program it will present a black window with a fake resizing border (the windows are actually borderless).   To move the window hold down the right mouse button first and then add the left mouse button and drag or ctrl-leftclick and drag.

A context menu is available by right clicking anywhere on the window.   From this menu you may create additional covers (windows) as desired.  Only the currently active window shows a resizing border.

edit:
fixed additional signed comparisons error affecting resizing when window is partially offscreen.

edit2:
fixed window truncation weirdness

edit3: previous downloads=104
Added menu item to set color of covers. 
Now loads file covers.ico if available.  (comes with Felipe's icon) 
Change covers.ico as desired, or delete for default app icon.
Title: Re: Covers
Post by: felipe on November 03, 2018, 08:59:57 AM
 :greenclp: I like it jimg...great job, thanks for sharing it!  :icon14:
Title: Re: Covers
Post by: jimg on November 04, 2018, 10:21:49 AM
Thanks felipe :)

Small update in first post.  Program was misbehaving if window was moved partially off screen.   Changed border check comparison to signed.  Also added menu item to make four covers at a time.
Title: Re: Covers
Post by: jimg on November 11, 2018, 06:23:24 AM
Updated first post to handle truncation weirdness where if you drag the window partially off the top of the screen, windows would shorted the window by that much.

Program is now compatible with windows XP, 7, and 10.

Also add ability to save one layout of windows for future use.
Title: Re: Covers
Post by: felipe on November 12, 2018, 02:04:19 AM
Hi jimg, i want to share here my appreciation of your work with a little (hopefully, for the forum sake) picture of how i can use this great tool.  :t

The screenshot was not edited in any kind apart from making it smaller in size. But i didn't any cut of the image or painted on it. All was cover by Covers.  :icon14:

Nice work!  :greenclp:

Title: Re: Covers
Post by: felipe on January 25, 2019, 08:58:15 AM
jimg i still use covers (really great program!  :t) i was thinking that such good program should have an icon. would you create an icon for it? i mean, when i see this useful program in my desktop around other programs that have icons, i think: "it looks like it's just a toy program, but it's really useful". So i think this program deserves an icon (even if the icon is just a black square)... :idea:
Title: Re: Covers
Post by: jimg on January 26, 2019, 01:09:31 AM
Sorry, never created an icon in my life.   Not my thing.  But feel free to make one and post it here :)
Title: Re: Covers
Post by: felipe on January 26, 2019, 02:32:02 AM
Ok thanks  :icon14:, but please don't offend, my icons are pretty simple  :redface:
Title: Re: Covers
Post by: jimg on January 26, 2019, 04:17:53 AM
Better than mine  :P
Title: Re: Covers
Post by: felipe on January 26, 2019, 08:07:00 AM
Ok what about this one?
Title: Re: Covers
Post by: jimg on January 26, 2019, 08:40:53 AM
looks fine to me.
Title: Re: Covers
Post by: felipe on January 26, 2019, 10:27:04 AM
thanks, so now what? i got your permission to assemble the program with the new icon or you will do it and you will upload a new version?  :idea:
Title: Re: Covers
Post by: jimg on January 26, 2019, 12:55:12 PM
This program is hereby released into the public domain for all purposed public and private.    Go for it.  This is not some proprietary program I jealously guard.  Make any changes you want and upload a version :)
Title: Re: Covers
Post by: felipe on January 27, 2019, 03:04:50 AM
Thanks again jimg  :icon14:
Title: Re: Covers
Post by: felipe on January 27, 2019, 07:11:11 AM
Ok here it is the same program but with an icon. I just added a minor changes which are commented:

include \masm32\include\Windows.inc         ; full relative path.

uselibs macro libs:vararg
    for nlib,<libs>
        include \masm32\include\nlib.inc       ; full relative path.
        includelib \masm32\lib\nlib.lib        ; full relative path.
    endm
endm

And:

    mov wc.hInstance,eax   ; save for later
    inv LoadIcon,eax,600   ; Get the icon.
    mov wc.hIcon,eax


Now can be easier to others to assemble it.  :icon14:
Title: Re: Covers
Post by: jimg on January 28, 2019, 01:40:25 AM
Good job!   I'm glad you're enjoying the program :)
Title: Re: Covers
Post by: jimg on September 22, 2019, 01:26:32 AM
I recently needed some covers in a color other than black, so updated the program to add that capability.
Also added code to load an icon from a file.  This is the icon that will show on the task bar.  Since I don't use resource files any more, I did it using loadimage.  You can change the icon by just copying a different .ico file into the executable's folder and renaming it covers.ico, or delete it to use the default app icon.  It comes with Felipe's icon.  Switch to his method of using loadicon and a resource file if you want the icon to show on the exe file.  Perhaps he will update his version to the new code.
Title: Re: Covers
Post by: sinsi on September 22, 2019, 09:21:57 AM
Nice!

One small thing, moving the window with both mouse buttons only works if you click the right button then the left.

Title: Re: Covers
Post by: jimg on September 22, 2019, 02:59:38 PM
Thanks Sinsi.  I updated the instructions in the first post.
Title: Re: Covers
Post by: felipe on September 23, 2019, 12:10:24 AM
I'm sure is a great update jimg  :thup:. Unfortunately i'll be bussy for awhile  :sad:, but i will return to coding when i get the free time again  :azn:.