Ace08 Posted October 8, 2010 Share Posted October 8, 2010 (edited) hi guys another thing i have this code $OpenPad = "Notepad.exe " & $RepPath Run($OpenPad) WinActivate($RepFile & " - Notepad", "") WinMove($RepFile & " - Notepad", "", 300, 0, 450, 740,1) i was able to open the file with notepad but it keeps poping behind any opened applications(in this case behind notepad++ since im just using a text editor to create this) also i can't resize the notepad using winmove, any comments? Note: $RepPath = "c:\Autoit\Test\RepFile.Rep" $RepFile = "RepFile.Rep" got this one, i just added WinWait ($RepFile, "")before winactivate Edited October 8, 2010 by Ace08 Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
wakillon Posted October 8, 2010 Share Posted October 8, 2010 I have tried like this and winmove works ! $RepPath = "[color=#1C2837][font=arial, verdana, tahoma, sans-serif][size=2]c:\Autoit\Test\RepFile.Rep[/size][/font][/color]" $RepFile = "RepFile.Rep" $OpenPad = "Notepad.exe " & $RepPath Run($OpenPad) WinWait ($RepFile, "") WinActivate($RepFile & " - Notepad", "") WinMove($RepFile & " - Notepad", "", 300, 0, 450, 740,1) AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Ace08 Posted October 8, 2010 Author Share Posted October 8, 2010 i still havn't tried this yet but the notepad opened with that kind of setting? cool, with that i can also adjust the text file settings thanks a lot wakillon Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
anixon Posted October 8, 2010 Share Posted October 8, 2010 I have tried like this and winmove works ! $RepPath = "[color=#1C2837][font=arial, verdana, tahoma, sans-serif][size=2]c:\Autoit\Test\RepFile.Rep[/size][/font][/color]" $RepFile = "RepFile.Rep" $OpenPad = "Notepad.exe " & $RepPath Run($OpenPad) WinWait ($RepFile, "") WinActivate($RepFile & " - Notepad", "") WinMove($RepFile & " - Notepad", "", 300, 0, 450, 740,1) Link to comment Share on other sites More sharing options...
anixon Posted October 8, 2010 Share Posted October 8, 2010 This may give you some clues in respect to managing the Notebook ;// Open Notepad at Correct Size and Position Func _AutoNotepadExe($nPFile, $nPDir, $iLeft, $iTop, $iWidth, $iHeight, $nPTimer) ;//Close all running instances of Notepad If ProcessExists($sNotePadExe) Then $list = ProcessList($sNotePadExe) $s = $list[0][0] For $i = 1 To $list[0][0] ProcessClose($list[$i][1]) Next EndIf ;//Reset Notepad X Y Width and Height settings in Registry [Document Size] RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosX", "REG_DWORD", $iLeft) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosY", "REG_DWORD", $iTop) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosDX", "REG_DWORD", $iWidth) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosDY", "REG_DWORD", $iHeight) ;//Open the Document with the Notepad Text Editor ShellExecute($nPFile, "", $nPDir, "Edit") ;//Set the Unattended Exit Timer $MenuStartCycle = TimerInit() While 1 ;//Process Ceases to Exist [closed by User] Exit If Not ProcessExists($sNotePadExe) Then ExitLoop ;//Calculate Timer Difference $MenuEndCycle = TimerDiff($MenuStartCycle) ;//Process and Unattended Exit [nn Minutes] If $MenuEndCycle >= $nPTimer * $sTextDurationX Then ProcessClose($sNotePadExe) ExitLoop EndIf WEnd ;//;//Reset Notepad X Y Width and Height settings in Registry [Default when sEmailSMS Started] RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosX", "REG_DWORD", $iPosXLeft) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosY", "REG_DWORD", $iPosYTop) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosDX", "REG_DWORD", $iPosDXWidth) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Notepad", "iWindowPosDY", "REG_DWORD", $iPosDYHeight) EndFunc ;==>_AutoNotepadExe 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