Resize Controls on GUI, even procentual
sorry to boring you, but I have a new dll for AHK again :lol:
If you want to resize controls on a GUI, please have a look at the sample.
That is a simple GUI window.
If you want to enter long texts, it's better if the window is bigger. Thus, resize it and look at the result
You can specify, that controls will resize at factor of 1-0.001.
I.e. you can use it, if you have 4 editcontrols side by side and want that each will resize equally.
Use a factor of 0.25 for each control and they will grow equally.
Here's the DLL:
https://ahknet.autoh...sizeSupport.dll
Here's the Script:
https://ahknet.autoh...izeCtrlDemo.ahk
If you have problems to get the dll working, you will need new MS-Dlls (mfc80.dll, msvcr80.dll) please download the 2 Archives, unpack them and start the vcredist_x86.exe. It will install the needed dlls
https://ahknet.autoh...6.sfx.part1.exe
https://ahknet.autoh...6.sfx.part2.rar
There's a uploadlimit of 2 MB, thus I had to split the Archives
Have fun
Micha
CtrlHWnd := GetChildHWND(WinID, "Button1") nRC := DllCall("AHKResizeSupport\AddControl", DWORD, CtrlHWnd, int, 2, int, 1, int, 1, double, 0.5, double, 0.5, "Cdecl Int")
First you have to get the HWND of the Control. You will get it with the snippet of the help (look at the bottom of this message)
AddControl:
CtrlHWND: hwnd of the control
first int:
0 = no resize
1 = don't change the width
2 = dock left and stay there
3= stay left and don't resize
4 = Dock right
5 = dock right and don't resize
6 = dock left and right and change width
second int: Same as first int, but for the height
third int: Try to resize flickerfree. Controls within a static border can't be resized that way, because the bordercontrol would overdraw them. If you have a Static border (groupborder), use 0 as parameter for the border and the controls within
double 1&2: Resize by factor. 0.5 = 50%, 0.25 = 25%
Best tip: Try and fail :wink:
GetChildHWND(ParentHWND, ChildClassNN) { WinGetPos, ParentX, ParentY,,, ahk_id %ParentHWND% if ParentX = return ; Parent window not found (possibly due to DetectHiddenWindows). ControlGetPos, ChildX, ChildY,,, %ChildClassNN%, ahk_id %ParentHWND% if ChildX = return ; Child window not found, so return a blank value. return DllCall("WindowFromPoint", "int", ChildX + ParentX, "int", ChildY + ParentY) }
I tried and failed ^^Best tip: Try and fail :wink:
I can not register the dlls where I have put them in or in system32 of XP. So I always get an error at starting the demo-applikation:
---------------------------
ResizeControlDemo.ahk
---------------------------
error while calling SetDlgParameters Errorlevel: -3
---------------------------
OK
---------------------------
The error-message on registering the dll is only in german available (something with wrong application-data). Also downloading the zip did not help me.
Maybe you could give me some tipps how to use it? Because this would be exactly what I need for a problem of mine with DPI!
Would be great!
Thx,
Thalon
thanks for the info. I've tried to run it on a clean PC and failed with the same error.
The offline test with dependencywalker shows no error but when profiling AHK it says
and it wasn't able to load the MFC-Dlls00:00:00.581: Loaded "c:\dokumente und einstellungen\name\desktop\AHKRESIZESUPPORT.DLL" at address 0x10000000 by thread 1. Successfully hooked module.
00:00:00.591: LDR: LdrpWalkImportDescriptor() failed to probe C:\Dokumente und Einstellungen\Silke\Desktop\AHKResizeSupport.dll for its manifest, ntstatus 0xc0150002
After breakfast I will immediately search the problem
Ciao
Micha
Sorry for any inconvenience.
Ciao
Micha
Doesn't matter that it took a bit longer, I am still @ work
Thalon
I've installed W98 under VMWare. It's working 80% :?
The 2 editcontrols at the bottom aren't resizing at all.
Funny behavior. All other controls on the demoscript are working well.
Is it very important for you to get it work on W98?
(I'm not very enthusiastic to debug a dll remote under VMware :wink: )
Ciao
Micha
Therefore my compi has only w98 it would be great. (Never change a running system.)Is it very important for you to get it work on W98?
Could not test it yesterday. I'll try it today.
It's working perfect!
Esp.: Your sample script works as it should. Thanks!
The only problem I see is: When I'm going to distribute a program with your DLL it's difficult to explain to others that they have to install that 2,6 MB large vcredist_x86.exe first.
The only problem I see is: When I'm going to distribute a program with your DLL it's difficult to explain to others that they have to install that 2,6 MB large vcredist_x86.exe first.
I understand this. Most people have the "old" files already on their system (installed by other software). Thus compiling with an older compiler would help. If the files weren't installed by other software, they have to install the old 2 MB large redistributables from microsoft.
The redistributables are needed whether the old or the new ones.
It's only a matter of time, when almost all will have the new dlls on their system.
Ciao
Micha
toralf
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.
The size of this exe is the only reason why I do not want to use this great feature at the moment..
Thalon
**sigh**
I'll see.
I've deleted > 2GB files to make space for an Image to install VC7 again.
Installed the old compiler and created "old" VCprojs.
The compiled DLL waits for your download there:
https://ahknet.autoh...eSupportVC7.dll
Please rename the dll (*tVC7.dll -> *t.dll) or adjust the callings in your script.
But I will not keep both dlls up2date. All bugfixing and enhancments will only be included in the new dll.
Perhaps from time to time, I will update the old dll, but not as fast as the new one
Hope that helps :-)
Ciao
Micha