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

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: WinGetPos problème avec la taille de l'extérieur de la fenêtre

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

Post by jeeswg » 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

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

Post by ScottMeyer » 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:

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

Post by jeeswg » 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")
}

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

Post by ScottMeyer » 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 ?

Top