DCCD Posted April 16, 2009 Share Posted April 16, 2009 Hey there, is there any idea "WinGetPos" I need to do something, If Resize Notepad My GUI Do the same? HOW?! [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
bo8ster Posted April 16, 2009 Share Posted April 16, 2009 What exactly are you trying to do? Do you have any code? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
DCCD Posted April 16, 2009 Author Share Posted April 16, 2009 (edited) #include <GUIConstants.au3> WinWaitActive("Untitled - Notepad") $size = WinGetPos("Untitled - Notepad") $var = PixelGetColor($size[0]+100,$size[1]+300) ; ; $Form1 = GUICreate ("My GUI",400 ,400,400,400 ,0x80000000, 0x00000080) GUISetBkColor ($var) GUISetState () While 1 if WinActive ("Untitled - Notepad") Then $1=1 Else $1=0 EndIf WinSetOnTop("My GUI", "", $1) $state = WinGetState("Untitled - Notepad", "") If BitAnd($state, 16) Then Exit Else WinMove($Form1,"",$size[0]+10,$size[1]+200) EndIf $size = WinGetPos("Untitled - Notepad") $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Edited April 16, 2009 by DCCD [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
bo8ster Posted April 16, 2009 Share Posted April 16, 2009 Adding "WinMove($Form1,"",$size[0],$size[1], $size[2],$size[3])" does work but there is heaps of flicker. Either way, you want to get the values from the notepad window then apply them to your form. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
MrCreatoR Posted April 16, 2009 Share Posted April 16, 2009 (edited) expandcollapse popup#include <GuiConstantsEx.au3> Run(@WindowsDir & "\Notepad.exe") WinWait("[CLASS:Notepad]") Global $aNotepadWin_Pos = WinGetPos("[CLASS:Notepad]") $hGUI = GUICreate("Test GUI") WinMove($hGUI, "", $aNotepadWin_Pos[0], $aNotepadWin_Pos[1], $aNotepadWin_Pos[2], $aNotepadWin_Pos[3]) WinSetOnTop($hGUI, "", 1) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $aCurrent_NotepadWin_Pos = WinGetPos("[CLASS:Notepad]") If IsArray($aCurrent_NotepadWin_Pos) And Not _ArrayCompare($aNotepadWin_Pos, $aCurrent_NotepadWin_Pos) Then $aNotepadWin_Pos = $aCurrent_NotepadWin_Pos WinMove($hGUI, "", $aNotepadWin_Pos[0], $aNotepadWin_Pos[1], $aNotepadWin_Pos[2], $aNotepadWin_Pos[3]) EndIf WEnd Func _ArrayCompare(ByRef $aArray1, ByRef $aArray2, $iCaseSense=1) Local $iUbound1 = UBound($aArray1) Local $iUbound2 = UBound($aArray2) If $iUbound1 <> $iUbound2 Then Return 0 For $i = 1 To $iUbound1-1 If ($iCaseSense And ($aArray1[$i] == $aArray2[$i]) = False) Or _ (Not $iCaseSense And $aArray1[$i] <> $aArray2[$i]) Then Return 0 Next Return 1 EndFunc Edited April 16, 2009 by MrCreatoR  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
DCCD Posted April 17, 2009 Author Share Posted April 17, 2009 Really Awesome MrCreatoR , Thank you so much Is There Anything Autoit Can't Do? expandcollapse popup#include <GuiConstantsEx.au3> Run(@WindowsDir & "\Notepad.exe") WinWait("[CLASS:Notepad]") Global $aNotepadWin_Pos = WinGetPos("[CLASS:Notepad]") $hGUI = GUICreate("Test GUI") WinMove($hGUI, "", $aNotepadWin_Pos[0], $aNotepadWin_Pos[1], $aNotepadWin_Pos[2], $aNotepadWin_Pos[3]) WinSetOnTop($hGUI, "", 1) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch $aCurrent_NotepadWin_Pos = WinGetPos("[CLASS:Notepad]") If IsArray($aCurrent_NotepadWin_Pos) And Not _ArrayCompare($aNotepadWin_Pos, $aCurrent_NotepadWin_Pos) Then $aNotepadWin_Pos = $aCurrent_NotepadWin_Pos WinMove($hGUI, "", $aNotepadWin_Pos[0], $aNotepadWin_Pos[1], $aNotepadWin_Pos[2], $aNotepadWin_Pos[3]) EndIf WEnd Func _ArrayCompare(ByRef $aArray1, ByRef $aArray2, $iCaseSense=1) Local $iUbound1 = UBound($aArray1) Local $iUbound2 = UBound($aArray2) If $iUbound1 <> $iUbound2 Then Return 0 For $i = 1 To $iUbound1-1 If ($iCaseSense And ($aArray1[$i] == $aArray2[$i]) = False) Or _ (Not $iCaseSense And $aArray1[$i] <> $aArray2[$i]) Then Return 0 Next Return 1 EndFunc [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
bo8ster Posted April 17, 2009 Share Posted April 17, 2009 No - some say it can do everything. I want it to make me some coffee Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
DCCD Posted April 17, 2009 Author Share Posted April 17, 2009 Use My coffee UDF [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now