PowerBASIC Users Meeting Point
gbClientCapture (Discussion) - Printable Version

+- PowerBASIC Users Meeting Point (http://pump.richheimer.de)
+-- Forum: User to User Discussions (http://pump.richheimer.de/forumdisplay.php?fid=3)
+--- Forum: PowerBASIC for Windows (http://pump.richheimer.de/forumdisplay.php?fid=4)
+--- Thread: gbClientCapture (Discussion) (/showthread.php?tid=81)

Pages: 1 2 3


RE: gbClientCapture (Discussion) - Jules Marchildon - 22.09.2025

Gary,
I tested your latest version. I was wondering if you have the problem I described earlier in post #8 ? I can't recover from a restore after a maximized window. The caption area becomes transparent to my mouse but yet I can still see the caption bar. Likewise, I cannot resize the window.


RE: gbClientCapture (Discussion) - Gary Beene - 22.09.2025

Howdy, Jules!

Yes, I see that too.

Playing with it, I noticed that the entire restored dialog is transparent - not just the "hole".

Can we detect when the dialog is restored, then take action?  

This code detects when the app restores so perhaps we can add something there to reset the dialog?

This seems to work - by restarting the app after a restore takes place.  It's a bit of a sledge-hammer approach, but does seem to work. Surely there is a feather-touch solution!

Code:
Do this ...

  Dialog Show Modal hDlg, Call DlgMain
  If Restart Then pID = Shell(Exe.Full$,1)  'restart the app


And this ...

      Case %WM_SysCommand
         Select Case Cb.WParam
            Case %SC_Restore
               Restart = 1
               Dialog End hDlg
         End Select

The message WM_WINDOWPOSCHANGING might be another place where we can detect a restore.


RE: gbClientCapture (Discussion) - Jules Marchildon - 23.09.2025

Ok, thanks for confirming, was wondering if it had anything to do with the outdated PB includes vs Jose's.     

I did make a few attempts last night without success, including an SDK version thinking maybe DDT engine failure but the behavior was the same.  
Code:
CASE %WM_SIZE
            ' Reapply layered attributes for resize (not needed for max/restore as handled in WM_SYSCOMMAND)
            SetWindowLong CB.HNDL, %GWL_EXSTYLE, GetWindowLong(CB.HNDL, %GWL_EXSTYLE) OR %WS_EX_LAYERED
            SetLayeredWindowAttributes CB.HNDL, keyColor, 0, %LWA_COLORKEY
            InvalidateRect CB.HNDL, BYVAL %NULL, %TRUE

        CASE %WM_SYSCOMMAND
            LOCAL cmd AS LONG
            cmd = CB.WPARAM AND &HFFF0
            IF cmd = %SC_MAXIMIZE THEN
                '-disable layered before maximize to see if layered is the culprit
                SetWindowLong CB.HNDL, %GWL_EXSTYLE, GetWindowLong(CB.HNDL, %GWL_EXSTYLE) AND NOT %WS_EX_LAYERED
            END IF
            '-let Windows handle the command
            FUNCTION = DefWindowProc(CB.HNDL, CB.MSG, CB.WPARAM, CB.LPARAM)
            IF cmd = %SC_RESTORE THEN
                '->re-enable layered after restore
                SetWindowLong CB.HNDL, %GWL_EXSTYLE, GetWindowLong(CB.HNDL, %GWL_EXSTYLE) OR %WS_EX_LAYERED
                SetLayeredWindowAttributes CB.HNDL, keyColor, 0, %LWA_COLORKEY
                '-force full redraw including non-client
                SetWindowPos CB.HNDL, 0, 0, 0, 0, 0, %SWP_NOMOVE OR %SWP_NOSIZE OR %SWP_NOZORDER OR %SWP_FRAMECHANGED
                RedrawWindow CB.HNDL, BYVAL %NULL, BYVAL %NULL, %RDW_INVALIDATE OR %RDW_UPDATENOW OR %RDW_ALLCHILDREN OR %RDW_FRAME OR %RDW_ERASE
                InvalidateRect CB.HNDL, BYVAL %NULL, %TRUE
            END IF
            EXIT FUNCTION 


Seems your Thor hammer approach would be the fix.


RE: gbClientCapture (Discussion) - Gary Beene - 23.09.2025

Howdy, Jules!

We'll let it sit in our brains for a day or two and maybe a non-restart method will come to us.

Thanks again for your help with this!

I should have a working version of the 2nd app sometime this evening - something to scroll the merge.bmp file, with adjustable speed and image magnification. So far, it looks like this, with toolbar buttons to magnify and to adjust scrolling. I'm sure some other buttons/features may come to mind.

[Image: gbscroller.jpg]

I don't know enough about music to offer other than variable speed scrolling. Depending on the music, perhaps a particular song would need a specific scrolling speed?  I would think the user will want the currently playing notes to always be visible on the screen, more-or-less centered.


RE: gbClientCapture (Discussion) - Jules Marchildon - 23.09.2025

Maybe, just don't use the maximizebox. I can't see it affecting the purpose of this app. I'm exploring another technique, will let you know if it works. I put my back out this morning 10 minutes before I jumped on the Zoom meeting, can't sit still long enough to concentrate.


RE: gbClientCapture (Discussion) - Gary Beene - 23.09.2025

gbScroller was just posted in the source code library.  It displays/scrolls/magnifies the merged image file that is created by gbClientCapture.

The zip now contains both apps - gbClientCapture and gbScroller.  https://garybeene.com/files/gbclientcapture.zip

Discussion for both should continue here.

Here's an image of the new app, gbScroller ...

[Image: gbscroller.jpg]

Note that gbScroller displays the "merge.bmp" image file from gbClientCapture.

A future change will be to allow the user to select a name in gbClientCapture for the merged image, then pass that name to gbScroller for display.

In gbScroller there are 3 shortcuts:
V - view merge.bmp in the user's default image viewer
L - toggle display of a vertical line between images
S - toggle scrolling of the image

... added ... two changes to the .zip file (gbscroller.bas) ...

1. allow zoom below 1
2. lines correctly display when image is zoomed.


RE: gbClientCapture (Discussion) - Jules Marchildon - 24.09.2025

Thanks Gary for posting the updated version with the scroller. Looks good! Only comment I have is the scrolling is a little jittery for me, maybe because of my older i3 Dell laptop, not sure. I'll take a look at your scrolling code today.


RE: gbClientCapture (Discussion) - Gary Beene - 24.09.2025

Howdy, Jules!

The image movement defaults to 2 px and the timer interval is variable.  Perhaps a 1 px movement would be smoother.  In the INI file, the "XDelta" variable is the thing to change for testing. I'll make a point to add a shortcut that toggles through a range of movement distances.

Howdy, Jules!

v1.2 posted. update to with shortcut to cycle xdelta 1,2,3,4,10,25


RE: gbClientCapture (Discussion) - Jules Marchildon - 24.09.2025

Thanks Gary, 

I got side tracked this morning.  I'll give it a whirl.  Another observation is when I zoomed in a few times the last merged image is cut-off when scrolled fully to right.  Added later, what I mean is the full image was there, but half or less was white space. Doesn't seem to be the case with v1.2 

I do understand if I zoom in too much it fills beyond your control, that is understandable.

added later:  I tried to replicate the my observations, and can't now.  Maybe I hallucinated again.  Confused


RE: gbClientCapture (Discussion) - Gary Beene - 26.09.2025

Howdy, Jules!

I'm out of town until Saturday ... so no rush in what you're doing.