Je souhaiterai fixer des limites Minimum et Maximum au "Bloc-notes" de Windows MIN_W, MIN_H, MAX_W, MAX_H: (160, 120, 640, 480) .
J'ai pensé à _GUI_RESIZE_SET_MIN_MAX($iPID, 160, 120, 640, 480) mais je n'arrive pas à injecter la fonction au "Bloc-notes"
Avez-vous une idée les amis.
Merci
$hGUI = GUICreate("Test", 320, 200, -1, -1, 0x00040000)
GUISetState()
Local $iPID = Run("notepad.exe", "")
Local $Handle = WinWaitActive("[CLASS:Notepad]")
ConsoleWrite($Handle &" "&$iPID& @CRLF)
_GUI_RESIZE_SET_MIN_MAX(160, 120, 640, 480) ; Je souhaiterai envoyer la fonction sur "notepad.exe" par: _GUI_RESIZE_SET_MIN_MAX($iPID, 160, 120, 640, 480)
While 1
Switch GUIGetMsg()
Case -3
Exit
EndSwitch
WEnd
Func _GUI_RESIZE_SET_MIN_MAX( $MIN_W, $MIN_H, $MAX_W, $MAX_H)
Global $GUI_MIN_W = $MIN_W
Global $GUI_MIN_H = $MIN_H
Global $GUI_MAX_W = $MAX_W
Global $GUI_MAX_H = $MAX_H
GUIRegisterMsg(0x0024, "_WM_GETMINMAXINFO")
EndFunc
Func _WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam)
$tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
DllStructSetData($tagMaxinfo, 7, $GUI_MIN_W) ; min X
DllStructSetData($tagMaxinfo, 8, $GUI_MIN_H) ; min Y
DllStructSetData($tagMaxinfo, 9, $GUI_MAX_W ); max X
DllStructSetData($tagMaxinfo, 10, $GUI_MAX_H ) ; max Y
Return 0
EndFunc ;==>WM_GETMINMAXINFO
;~ ConsoleWrite($WinGetHandle &" "&$iPID&" "&$hGUI &" "& $hwnd &" "& $Msg &" "& $wParam &" "& $lParam & @CRLF)
GUISetState()
Local $iPID = Run("notepad.exe", "")
Local $Handle = WinWaitActive("[CLASS:Notepad]")
ConsoleWrite($Handle &" "&$iPID& @CRLF)
_GUI_RESIZE_SET_MIN_MAX(160, 120, 640, 480) ; Je souhaiterai envoyer la fonction sur "notepad.exe" par: _GUI_RESIZE_SET_MIN_MAX($iPID, 160, 120, 640, 480)
While 1
Switch GUIGetMsg()
Case -3
Exit
EndSwitch
WEnd
Func _GUI_RESIZE_SET_MIN_MAX( $MIN_W, $MIN_H, $MAX_W, $MAX_H)
Global $GUI_MIN_W = $MIN_W
Global $GUI_MIN_H = $MIN_H
Global $GUI_MAX_W = $MAX_W
Global $GUI_MAX_H = $MAX_H
GUIRegisterMsg(0x0024, "_WM_GETMINMAXINFO")
EndFunc
Func _WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam)
$tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam)
DllStructSetData($tagMaxinfo, 7, $GUI_MIN_W) ; min X
DllStructSetData($tagMaxinfo, 8, $GUI_MIN_H) ; min Y
DllStructSetData($tagMaxinfo, 9, $GUI_MAX_W ); max X
DllStructSetData($tagMaxinfo, 10, $GUI_MAX_H ) ; max Y
Return 0
EndFunc ;==>WM_GETMINMAXINFO
;~ ConsoleWrite($WinGetHandle &" "&$iPID&" "&$hGUI &" "& $hwnd &" "& $Msg &" "& $wParam &" "& $lParam & @CRLF)