WinGetPos problème avec la taille de l'extérieur de la fenêtre Topic is solved

Poser vos questions de programmation en AutoHotkey
User avatar
ScottMeyer
Posts: 33
Joined: 27 Sep 2017, 12:52
Contact:

WinGetPos problème avec la taille de l'extérieur de la fenêtre

24 Oct 2017, 16:58

Salut,

Je suis embête avec WinGetPos

Ma fenêtre est bien de la taille " A " (voir screenshot) mais WinGetPos me retourne " B " que je mets dans +MinSize du coup c'est faux et dés qu'on redimensionne la fenêtre la taille minimal est plus grande ...

Image

Code: Select all

WinGetPos , X , Y , Gui_Largeur_Mini , Gui_hauteur_Mini , GUI REDIMENSIONNABLE 
Gui, 1: +Resize +MinSize%Gui_Largeur_Mini%x%Gui_hauteur_Mini%  
J'ai déjà essayé un peu tout ça, sans succès : :cry:

Code: Select all

CoordMode, Mouse, Screen
CoordMode, Pixel, Window ; Client
CoordMode, Menu , Window  ;Client
CoordMode, Mouse, Client 
CoordMode, Caret, Window  ; Client
Des idées ?
JEE (jeeswg) "Better WinGetPos" : LIEN Forum AHK
AHK Vision Go : LIEN Forum AHK
Simply Backup Script : LIEN Forum AHK
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: WinGetPos problème avec la taille de l'extérieur de la fenêtre

24 Oct 2017, 17:11

Avec espoir, cela va résoudre le problème.

Code: Select all

q:: ;window - get position, client area
WinGet, hWnd, ID, A
;e.g. get position
WinGetPos, vWinX, vWinY, vWinW, vWinH, % "ahk_id " hWnd
;e.g. get position client area
JEE_WinGetPosClient(hWnd, vWinX2, vWinY2, vWinW2, vWinH2)
vCoords1 := Format("x{} y{} w{} h{}", vWinX, vWinY, vWinW, vWinH)
vCoords2 := Format("x{} y{} w{} h{}", vWinX2, vWinY2, vWinW2, vWinH2)
MsgBox, % vCoords1 "`r`n" vCoords2
return

JEE_WinGetPosClient(hWnd, ByRef vWinX, ByRef vWinY, ByRef vWinW, ByRef vWinH)
{
	VarSetCapacity(RECT, 16, 0)
	DllCall("user32\GetClientRect", Ptr,hWnd, Ptr,&RECT)
	DllCall("user32\ClientToScreen", Ptr,hWnd, Ptr,&RECT)
	vWinX := NumGet(&RECT, 0, "Int"), vWinY := NumGet(&RECT, 4, "Int")
	vWinW := NumGet(&RECT, 8, "Int"), vWinH := NumGet(&RECT, 12, "Int")
}
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
ScottMeyer
Posts: 33
Joined: 27 Sep 2017, 12:52
Contact:

Re: WinGetPos problème avec la taille de l'extérieur de la fenêtre  Topic is solved

25 Oct 2017, 04:56

Hi jeeswg !

Perfect you are a genie! It works wonderfully
For my part I add just before "WinActivate, %Name_Windows%" not to find a false information.

Thank you very much :clap:
JEE (jeeswg) "Better WinGetPos" : LIEN Forum AHK
AHK Vision Go : LIEN Forum AHK
Simply Backup Script : LIEN Forum AHK
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: WinGetPos problème avec la taille de l'extérieur de la fenêtre

29 Oct 2017, 09:54

J'ai posté quelques autres fonctions pertinentes ici.
convert coordinates between Client/Screen/Window modes - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=38472
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “J'ai besoin d'aide”

Who is online

Users browsing this forum: No registered users and 23 guests