Sign in to follow this  
Followers 0
anixon

WinTitleMatchMode

3 posts in this topic

When using this:

Opt("WinTitleMatchMode", 1)

That supports this code

;//Compile Current Window Position
Func _StartUpWinPos()
 ;//Capture the Windows Current x y Position
 Local $Handle = WinGetHandle("sEmailSMS", "")
 $StartupPos = WinGetPos($Handle, "")
 If UBound($StartupPos) = 4 Then
  $sUpLeft = $StartupPos[0]
  $sUpTop = $StartupPos[1]
  $sUpWidth = $StartupPos[2]
  $sUpHeight = $StartupPos[3]
 EndIf
EndFunc   ;==>_StartUpWinPos

the Widow Created by:

GUICreate(" " & $StartupTitle, $sUpWidth, $sUpHeight, $sUpLeft, $sUpTop, $WS_SYSMENU)

is the right size and in the correct x y location.

however if you have a reason to use

Opt("WinTitleMatchMode", 2)

the Window created by the same GUICreate:

GUICreate(" " & $StartupTitle, $sUpWidth, $sUpHeight, $sUpLeft, $sUpTop, $WS_SYSMENU)

does not have the same Height expected given the value assigned to variable $sUpHeight.

Whist my need does not require WinTitleMatchMode to process with option 2 I was reluctant to post this issue as a bug given that it might either be known or there was a simple explaination. :) Ant..

Share this post


Link to post
Share on other sites



Can you provide a working script that demonstrates your claim?

I have done some extensive testing and have not been able to repeat the symptom. I have noticed that occasionally an AutoIT function will simply and inexplicably stop working as expected and on those occasions a cold boot of the OS appears to be the remedy. I have been unable with any certainty identify the cause which may simply be related to OS updates published by Microsoft. For example the last Microsoft Update '10 Feb AEDT' changed the program associations for Safari the effect of which was when you tried to launch MobileMe/ Account Tab/ Account Details it simply launched Microsoft Office Word. Resetting the programs associated with Safari resolved that issue.

The follow is the code that I used for testing

;//Include the sEmailSMS Variables
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>


Global $StartupTitle = "Start-up ", $StartupPos, $sUpLeft = -1, $sUpTop = -1, $sUpWidth = 330, $sUpHeight = 135, _
  $sExit

Opt('MustDeclareVars', 1)
Opt("WinTitleMatchMode", 2)


Startup()


; example 1
Func Startup()
 Local $msg
 GUICreate(" " & $StartupTitle, $sUpWidth, $sUpHeight, $sUpLeft, $sUpTop, $WS_SYSMENU)
 GUISetFont(9,600)
 $sExit = GUICtrlCreateButton('X', 292, 73, 30, 18, $BS_FLAT)
 GUICtrlSetBkColor(-1, 0xE76E6E)
 GUICtrlSetColor(-1, 0xffffff)
 GUISetFont(9,400)
 GUISetState() ; will display an empty dialog box
 _StartUpWinPos()
 ; Run the GUI until the dialog is closed
 While 1
  $msg = GUIGetMsg()
  If $msg = $GUI_EVENT_CLOSE Or $msg = $sExit Then ExitLoop
 WEnd
 GUIDelete()
EndFunc   ;==>Example1

;//Compile Current Window Position
Func _StartUpWinPos()
 ;//Capture the Windows Current x y Position
 Local $Handle = WinGetHandle("sEmailSMS", "")
 $StartupPos = WinGetPos($Handle, "")
 If UBound($StartupPos) = 4 Then
  $sUpLeft = $StartupPos[0]
  $sUpTop = $StartupPos[1]
  $sUpWidth = $StartupPos[2]
  $sUpHeight = $StartupPos[3]
  Msgbox(0,"", $sUpWidth & " " & $sUpHeight & " " & $sUpLeft & " " & $sUpTop, 5)
 EndIf
EndFunc   ;==>_StartUpWinPos

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0