Jump to content

Recommended Posts

Posted

Hi all. There is a third-party program, a development environment, it is not implemented very well, since it does not provide for zooming in the workspace, which makes it very difficult to work when the project is too large.
Can anyone tell me if it is possible to somehow intercept the internal area of the program and change the scale of this area.

123.png

Posted (edited)

The working field of the program has its own class CView. Those. can be intercepted. I don't know how to change the scale.

 

67.png

Edited by Nick86
Posted (edited)
#include <WinAPISysWin.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

HotKeySet("{ESC}", "_exit")
HotKeySet("t", "_resize")

While 1
Sleep(100)
WEnd

Func _resize()
Local $hWnd = WinWaitActive("[CLASS:CMainFrame]", "", 10)
Local $hHandl = ControlGetHandle($hWnd,"","[Class:CView]")
$pos = WinGetPos($hHandl)
WinMove($hHandl, '', $pos[0], $pos[1], 800, 600)
EndFunc

Func _exit()
Exit
EndFunc

I tried this and it turned out like this, and I can’t find something else for now.

67.png

Edited by Nick86
Posted
12 minutes ago, Andreik said:

That's a strange request. If the zoom it's not implemented in the software how do you expect to make it work outside the application?

Approximately as I gave an example above. Then I think how to scale this window.

Posted (edited)
7 minutes ago, Andreik said:

But this is not zooming, it's just a window resize. What I am missing? Maybe I didn't understand what do you mean by scaling.

I just need scaling, zooming. I'm thinking of intercepting the inner area and somehow changing the scaling through _WinAPI_, similar to how it is done in the display settings, where you can change the scale of the interface.

Basically, I want to break this shit because the developers of this program don't want to do anything.

Edited by Nick86
Posted

Or maybe this ?

#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <GUIConstants.au3>

HotKeySet("{F1}", Zoom)
HotKeySet("{ESC}", Terminate)

_GDIPlus_Startup()

While Sleep(500)
WEnd

Func Zoom()
  Local Static $bZooming = False
  Local $aPos, $hCapture, $hImage, $hZoom, $hGUI, $hGraphics, $iX = -1, $iY = -1
  $bZooming = Not $bZooming
  While $bZooming
    $aPos = MouseGetPos()
    If $aPos[0] <> $iX Or $aPos[1] <> $iY Then
      If IsHWnd($hGUI) Then
        GUIDelete($hGUI)
        _GDIPlus_ImageDispose($hZoom)
        _GDIPlus_GraphicsDispose($hGraphics)
      EndIf
      $hCapture = _ScreenCapture_Capture("", $aPos[0] - 100, $aPos[1] - 100, $aPos[0] + 100, $aPos[1] + 100, False)
      $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hCapture)
      _WinAPI_DeleteObject($hCapture)
      $hZoom = _GDIPlus_ImageResize($hImage, 400, 400)
      _GDIPlus_ImageDispose($hImage)
      $hGUI = GUICreate("", 400, 400, $aPos[0] - 200, $aPos[1] - 200, $WS_POPUP)
      GUISetState()
      $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
      _GDIPlus_GraphicsDrawImage($hGraphics, $hZoom, 0, 0)
      $iX = $aPos[0]
      $iY = $aPos[1]
    EndIf
    Sleep(100)
  WEnd
  GUIDelete($hGUI)
  _GDIPlus_ImageDispose($hZoom)
  _GDIPlus_GraphicsDispose($hGraphics)
EndFunc

Func Terminate()
  _GDIPlus_Shutdown()
  Exit
EndFunc

 

Posted

Thank you. It works, but it's not what I need. It is necessary to change the area itself to the smaller side, so that more elements fit on the screen.

Posted
6 minutes ago, Nine said:

Or maybe this ?

#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <GUIConstants.au3>

HotKeySet("{F1}", Zoom)
HotKeySet("{ESC}", Terminate)

_GDIPlus_Startup()

While Sleep(500)
WEnd

Func Zoom()
  Local Static $bZooming = False
  Local $aPos, $hCapture, $hImage, $hZoom, $hGUI, $hGraphics, $iX = -1, $iY = -1
  $bZooming = Not $bZooming
  While $bZooming
    $aPos = MouseGetPos()
    If $aPos[0] <> $iX Or $aPos[1] <> $iY Then
      If IsHWnd($hGUI) Then
        GUIDelete($hGUI)
        _GDIPlus_ImageDispose($hZoom)
        _GDIPlus_GraphicsDispose($hGraphics)
      EndIf
      $hCapture = _ScreenCapture_Capture("", $aPos[0] - 100, $aPos[1] - 100, $aPos[0] + 100, $aPos[1] + 100, False)
      $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hCapture)
      _WinAPI_DeleteObject($hCapture)
      $hZoom = _GDIPlus_ImageResize($hImage, 400, 400)
      _GDIPlus_ImageDispose($hImage)
      $hGUI = GUICreate("", 400, 400, $aPos[0] - 200, $aPos[1] - 200, $WS_POPUP)
      GUISetState()
      $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
      _GDIPlus_GraphicsDrawImage($hGraphics, $hZoom, 0, 0)
      $iX = $aPos[0]
      $iY = $aPos[1]
    EndIf
    Sleep(100)
  WEnd
  GUIDelete($hGUI)
  _GDIPlus_ImageDispose($hZoom)
  _GDIPlus_GraphicsDispose($hGraphics)
EndFunc

Func Terminate()
  _GDIPlus_Shutdown()
  Exit
EndFunc

 

Thank you. It works, but it's not what I need. It is necessary to change the area itself to the smaller side, so that more elements fit on the screen.

Posted
14 minutes ago, Nine said:

Ok, didn't catch that.  IDK how to do it.

I'll try different options later, it may turn out that through user32.dll.

Posted (edited)
1 hour ago, UEZ said:

You can use a Magnifier

 

 

for inspiration.

This does not fit. I need to make the workspace itself smaller so that more elements fit on the screen.

This is not a trivial task, if I could get by with a magnifying glass, I would just download a ready-made application.

It seems to me that user32.dll should be involved here.

4566.png

Edited by Nick86
Posted (edited)
14 minutes ago, Andreik said:

You keep talking about user32.dll but I doubt you understand what it is. I am curious how it should be involved?

Something like MoveWindow, but as I understand it, WinMove is MoveWindow.

In general, I don’t know, I’m digging in the direction of the capabilities of Windows itself, its api.

https://learn.microsoft.com/en-us/windows/win32/api/

Edited by Nick86
Posted

There is no such WinAPI. Since the application doesn't implement such functionality probably the best you can get outside the application it's what guys suggested above.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...