golfinhu Posted April 22, 2011 Share Posted April 22, 2011 (edited) how to i add on button equal in the image:I just want to add window in firefox, is this possible?thanks! Edited April 22, 2011 by golfinhu Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2011 Moderators Share Posted April 22, 2011 golfinhu, Just to give you the idea, this adds a button to your SciTE GUI when you run it: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $sMain_Title = "[CLASS:SciTEWindow]" Global $hSciTE_Wnd = WinGetHandle($sMain_Title) Global $hScite_Dir_Wnd = WinGetHandle("DirectorExtension") Global $iSciTE_Last_X, $iSciTE_Last_Y, $hButtonGUI, $hButton _Button_Create() _Button_Follow() While 1 ; Check SciTE is running If ProcessExists("SciTE.exe") Then ; Move button as required _Button_Follow() Else Exit EndIf If GUIGetMsg() = $hButton Then MsgBox(0, "Hi!", "Added button clicked") EndIf WEnd Func _Button_Create() ; Locate SciTE window Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd) Local $iX = $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130 Local $iY = $aSciTE_Pos[1] + 10 ; Create button GUI $hButtonGUI = GUICreate("SciTE Button", 30, 16, $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW, $hSciTE_Wnd) ; Set button GUI in z-order just above SciTE DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hButtonGUI, "hwnd", $hSciTE_Wnd, "int", $iX, "int", $iY, "int", 30, "int", 16, "uint", 0x0010) ; $SWP_NOACTIVATE ; Create button $hButton = GUICtrlCreateButton("+", 0, 0, 30, 16) GUICtrlSetFont(-1, 18) GUISetState(@SW_SHOW, $hButtonGUI) ; Reset SciTE window focus WinActivate($hSciTE_Wnd) EndFunc ;==>_Button_Create Func _Button_Follow() ; Check if SciTE exists Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd) If @error Then Return ; Check SciTE position If $aSciTE_Pos[0] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then $iSciTE_Last_X = $aSciTE_Pos[0] $iSciTE_Last_Y = $aSciTE_Pos[1] ; Move button to follow WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10) EndIf EndFunc ;==>_Button_Follow You may need to adjust the position a bit depending on the style you use for your GUIs. You will see that the button disappears and reappears when SciTE is minimzed and restored and that the script exits when SciTE closes. Please ask if you have any questions. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
martin Posted April 22, 2011 Share Posted April 22, 2011 (edited) That's a good example Melba23. I didn't realize that setting the z order that way kept the relative z order of the 2 windows. Thanks.(Struck out - see post 10)BTW I think you need to haveFunc _Button_Follow() ; Check if SciTE exists Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd) If @error Then Return ; Check SciTE position If $aSciTE_Pos[0] + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then $iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2] $iSciTE_Last_Y = $aSciTE_Pos[1] ; Move button to follow WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10) EndIf EndFunc ;==>_Button_Follow Edited April 23, 2011 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
guinness Posted April 22, 2011 Share Posted April 22, 2011 I agree with Martin. Shame this can't be done with _WinAPI Commands, but all in all a great alternative UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2011 Moderators Share Posted April 22, 2011 (edited) martin, As long as you use the same value for both instances: If $aSciTE_Pos[0] + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then $iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2] I do not think it matters whether you use $aSciTE_Pos[0] or $aSciTE_Pos[0] + $aSciTE_Pos[2] - all you are looking for is a change in the position of a point of the SciTE GUI. You are quite correct - thanks for pointing it out. guinness, I will take that as agreement with the "good example" rather than "BTW I think you need"! M23 Edit: Pretty obvious! Edited April 23, 2011 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
golfinhu Posted April 22, 2011 Author Share Posted April 22, 2011 golfinhu, Just to give you the idea, this adds a button to your SciTE GUI when you run it: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $sMain_Title = "[CLASS:SciTEWindow]" Global $hSciTE_Wnd = WinGetHandle($sMain_Title) Global $hScite_Dir_Wnd = WinGetHandle("DirectorExtension") Global $iSciTE_Last_X, $iSciTE_Last_Y, $hButtonGUI, $hButton _Button_Create() _Button_Follow() While 1 ; Check SciTE is running If ProcessExists("SciTE.exe") Then ; Move button as required _Button_Follow() Else Exit EndIf If GUIGetMsg() = $hButton Then MsgBox(0, "Hi!", "Added button clicked") EndIf WEnd Func _Button_Create() ; Locate SciTE window Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd) Local $iX = $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130 Local $iY = $aSciTE_Pos[1] + 10 ; Create button GUI $hButtonGUI = GUICreate("SciTE Button", 30, 16, $iX, $iY, $WS_POPUP, $WS_EX_TOOLWINDOW, $hSciTE_Wnd) ; Set button GUI in z-order just above SciTE DllCall("user32.dll", "bool", "SetWindowPos", "hwnd", $hButtonGUI, "hwnd", $hSciTE_Wnd, "int", $iX, "int", $iY, "int", 30, "int", 16, "uint", 0x0010) ; $SWP_NOACTIVATE ; Create button $hButton = GUICtrlCreateButton("+", 0, 0, 30, 16) GUICtrlSetFont(-1, 18) GUISetState(@SW_SHOW, $hButtonGUI) ; Reset SciTE window focus WinActivate($hSciTE_Wnd) EndFunc ;==>_Button_Create Func _Button_Follow() ; Check if SciTE exists Local $aSciTE_Pos = WinGetPos($hSciTE_Wnd) If @error Then Return ; Check SciTE position If $aSciTE_Pos[0] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then $iSciTE_Last_X = $aSciTE_Pos[0] $iSciTE_Last_Y = $aSciTE_Pos[1] ; Move button to follow WinMove($hButtonGUI, '', $aSciTE_Pos[0] + $aSciTE_Pos[2] - 130, $aSciTE_Pos[1] + 10) EndIf EndFunc ;==>_Button_Follow You may need to adjust the position a bit depending on the style you use for your GUIs. You will see that the button disappears and reappears when SciTE is minimzed and restored and that the script exits when SciTE closes. Please ask if you have any questions. M23 yeah, good logic, I broke my head too but I could not think of anything! but it worked perfectly! thanks for the code, and thanks for helping me again! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2011 Moderators Share Posted April 22, 2011 golfinhu, Glad I could help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
guinness Posted April 22, 2011 Share Posted April 22, 2011 I will take that as agreement with the "good example" rather than "BTW I think you need"!It did come across as the classic "It's great but.....it good be better" sentence But of course I was being genuine and honest! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
guinness Posted April 23, 2011 Share Posted April 23, 2011 Sorry Melba23! Decided to have a little play around with your code and came up with this alternative >> The button positions are adjusted to work in Windows 7, it will also move relatively according to if the Window is maximised or not. I also made the GUI transparent. I also couldn't work out why you used "SetWindowPos" >> _WinAPI_SetWindowPos(), because the code works without this Function. expandcollapse popup#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #AutoIt3Wrapper_UseX64=N #include <WindowsConstants.au3> #include <WinAPI.au3> Global $Global_ButtonGUI, $Global_Button ; Required. _Main() Func _Main() Local $sTitle = "[CLASS:Notepad]", $sProcess = "Notepad.exe" ; Notepad Window ;~ Local $sTitle = "[CLASS:SciTEWindow]", $sProcess = "SciTE.exe" ; SciTE Window If ProcessExists($sProcess) = 0 Then Run($sProcess) Sleep(100) EndIf _Button_Create($sTitle, "_Button_Create()") While 1 If ProcessExists($sProcess) Then _Button_Follow($sTitle) ; Move Button Else Exit EndIf If GUIGetMsg() = $Global_Button Then MsgBox(0, "_Button_Follow()", "Button Clicked.") EndIf WEnd EndFunc ;==>_Main Func _Button_Create($sTitle, $sText) Local $hHandle = WinGetHandle($sTitle) Local $aWinGetPos = WinGetPos($sTitle) Local $iWidth = 16, $iHeight = 16, $iYOffset If BitAND(WinGetState($hHandle), 32) Then $iYOffset = 10 Else $iYOffset = 5 EndIf Local $iXPos = $aWinGetPos[0] + $aWinGetPos[2] - 140 Local $iYPos = $aWinGetPos[1] + $iYOffset $Global_ButtonGUI = GUICreate($sText, $iWidth, $iHeight, $iXPos, $iYPos, $WS_POPUP, $WS_EX_LAYERED, $hHandle) GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($Global_ButtonGUI, 0xABCDEF) ;~ _WinAPI_SetWindowPos($Global_ButtonGUI, $hHandle, $iXPos, $iYPos, $iWidth, $iHeight, 0x0010) ; <<<<< Couldn't work out what this was needed for?! $Global_Button = GUICtrlCreateButton("+", 0, 0, $iWidth, $iHeight) GUICtrlSetFont(-1, 18) GUISetState(@SW_SHOW, $Global_ButtonGUI) WinActivate($hHandle) _Button_Follow($sTitle) Return $hHandle EndFunc ;==>_Button_Create Func _Button_Follow($sTitle) Local $aWinGetPos = WinGetPos($sTitle), $iYOffset If @error Then Return 0 EndIf If IsDeclared("Global_XPos") = 0 Then Global $Global_XPos EndIf If IsDeclared("Global_YPos") = 0 Then Global $Global_YPos EndIf If BitAND(WinGetState($sTitle), 32) Then $iYOffset = 10 Else $iYOffset = 5 EndIf If $aWinGetPos[0] + $aWinGetPos[2] <> $Global_XPos Or $aWinGetPos[1] <> $Global_YPos Then $Global_XPos = $aWinGetPos[0] + $aWinGetPos[2] $Global_YPos = $aWinGetPos[1] WinMove($Global_ButtonGUI, '', $aWinGetPos[0] + $aWinGetPos[2] - 140, $aWinGetPos[1] + $iYOffset) EndIf EndFunc ;==>_Button_Follow UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
martin Posted April 23, 2011 Share Posted April 23, 2011 (edited) martin, As long as you use the same value for both instances: If $aSciTE_Pos[0] + $aSciTE_Pos[2] <> $iSciTE_Last_X Or $aSciTE_Pos[1] <> $iSciTE_Last_Y Then $iSciTE_Last_X = $aSciTE_Pos[0] + $aSciTE_Pos[2] I do not think it matters whether you use $aSciTE_Pos[0] or $aSciTE_Pos[0] + $aSciTE_Pos[2] - all you are looking for is a change in the position of a point of the SciTE GUI. M23 if you resize the window by making it less wide then the button is left out in space if you don't use the right-hand edge of the scite window so I thought it mattered. EDit: I see I misunderstood how the button kept it's z order. It wasn't the WInSetPos it was because you had made it a child of the Scite window. Silly me. Edited April 23, 2011 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 23, 2011 Moderators Share Posted April 23, 2011 martin,Now you explain it like that I can see that you are quite right - the code from which I developed that script referred to a toolbar linked to the left hand edge of a GUI so I was only interested in the left hand corner.My apologies. guinness,The SetWindowPos line sets the GUI containing the new button immediately above the target GUI in the z-order - so it always appears above the GUI regardless of where the GUI itself is in the z-order. I imagine that the SetLayeredWindowAttributes call places the button within the target GUI and so makes the z-order placement redundant. Perhaps someone with more knowledge of this area can confirm - or more likely give the correct explanation. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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