Jump to content

iCode

Active Members
  • Posts

    194
  • Joined

  • Last visited

Everything posted by iCode

  1. i knew i was going to be sorry i asked that question it works in my other script because i'm using hex valuse to combine the keys also, just wondering if you considered my >previous post? thanks again Yashied!
  2. i don't know what i'm missing here, but none of the _HotKey_Assign() examples below work when registering key combinations, except for the last one which is only a single key #include <HotKey_vkConstants.au3> #include <HotKey_2.1b.au3> ConsoleWrite(_HotKey_Assign(BitOR(0x11, 0x56), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitOR("0x11", "0x56"), "_testMe") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitOR($VK_CONTROL, $VK_V), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign(BitAND($VK_CONTROL, $VK_V), "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign($VK_CONTROL + $VK_V, "test") & @LF) ; Ctrl+V ;ConsoleWrite(_HotKey_Assign($VK_F1, "test") & @LF) ; Ctrl+V While 1 Sleep(10) WEnd Func test() ConsoleWrite("ok" & @LF) EndFunc funny thing is, i've already implemented this UDF in a script (using multiple keys and BitOR like you're supposed to) and _HotKey_Assign() works fine there win 7 x64 tried autoit x86 and x64, compiled and not compiled
  3. i can do that, but that causes other problem -- 1), there is no way to stop the key from repeating -- BitOR($HK_FLAG_NOREPEAT, $HK_FLAG_NOERROR) doesn't work -- 2), the hotkey to show the gui may or may not work - i noticed this particularly when registering Shift+ one of the arrow keys (Left, Right, etc.) where when you hold the hotkey down, the function is never called -- 3) sometimes using the gui input control to change the hotkey to open the gui does not work on the 1st try (you have to press the key combo twice to get it to display correctly in the input control) also the gui can be shown without a hotkey, so there are 2 ways of showing it -- passing different flags to the UDF functions could be done based on how the GUI is displayed, but i think it would be better if such cases could be handled cleanly, without having to use $HK_FLAG_NOERROR i don't think this is an unusual scenario where you have, for example, a configuration GUI that can be shown with a hotkey and other ways (such as by clicking a button or menu item) and so i think it would be ideal if this limitation could be overcome in the code by dropping the $HK_FLAG_NOERROR flag and, perhaps, adding some code to _HotKey_Release() so that it does not function until hotkeys are released and there is nothing more to do i know that "adding some code" sounds rather dumb and i would like to offer a better fix or some example code, but allot of you guys that write these UDFs are simply working at a level which far exceeds mine, and so it is very difficult for me to follow the code, but if my suggestion is realistic, i think that would be the best and cleanest way to handle these scenarios where hotkeys need to be unregistered from a gui function called by a hotkey
  4. i keep bumping against a limitation where you cannot call _HotKey_Release() from within a function that was called with _HotKey_Assign() and i'm wondering if there is some work-a-round? the logic is like this: 1) register hotkey for func1 2) enter func1 using the hotkey 3) unregister and unhook the hotkey 4) either just before, or just after returning from func1, re-register the hotkey i've tried a few "tricks" to get this to work, but so far have not found a solution unfortunately i am not proficient enough to dig into this UDF to see if this limitation can be overcome, but it would be great if it could in my case i have a gui with the hotkey input controls that needs to be able to be shown with a hotkey, but i need to disable all hotkeys while i'm in the function containing this gui and then re-register all the hotkeys again on the flip side
  5. no need to re-download if my suggestions were the only changes made i would humbly suggest considering bumping the version number though, so others know the UDF was updated thank you!
  6. Yashied - i made some notes here if you want to make HotKey and HotKeyInput UDFs more compatible with au3check with '-d -w 3 -w 4 -w 5' ... Func _HotKey_Assign unused var: $Error = False Func HK_WM_ACTIVATE add: #forceref $hWnd, $iMsg, $lParam Func HK_WM_HOTKEY add: #forceref $iMsg, $wParam Func HK_WM_INPUT add: #forceref $iMsg, $wParam Func _GUICtrlHKI_GetHotKey unused var: Local $Ret = 0 Func __HKI_Event add: #forceref $hEventHook, $iEvent, $hWnd, $iObjectID, $iChildID, $iThreadID, $iEventTime Func __HKI_WinVer add "Local": $tOSVI = DllStructCreate > Local $tOSVI = DllStructCreate add "Local": $Ret = DllCall > Local $Ret = DllCall
  7. thanks Yashied this UDF is a wonderful piece of work
  8. was trying to troubleshoot a problem and noticed that the order in which the UDF's are included can break things this works as expected, where the input strings become "None" when you first run the code... #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_2.1b.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_vkConstants.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKeyInput_1.3.au3" $Form1 = GUICreate("Form1", 619, 445, 628, 210) $HKI1 = _GUICtrlHKI_Create(0, 56, 55, 230, 20) $HKI2 = _GUICtrlHKI_Create(0, 56, 89, 230, 20) GUISetState(@SW_SHOW) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE however this causes the inputs to be empty when you move "HotKey_2.1b.au3" to the bottom... #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_vkConstants.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKeyInput_1.3.au3" #Include "F:\AutoIt\Resources\Funcs\_other\HotKey_Yashid\HotKey_2.1b.au3" $Form1 = GUICreate("Form1", 619, 445, 628, 210) $HKI1 = _GUICtrlHKI_Create(0, 56, 55, 230, 20) $HKI2 = _GUICtrlHKI_Create(0, 56, 89, 230, 20) GUISetState(@SW_SHOW) Do Sleep(10) Until GUIGetMsg() = $GUI_EVENT_CLOSE i was never aware that the order in which includes are added could cause a problem
  9. I see what you mean, but that still seems strange. Maybe i don't understand how HotKeySet works, but it seems to me that the alt key shouldn't focus the context menu on the 2nd window until it is released and pressed again. In other words, if i set a hotkey for a function, it seems like the hotkey should not be able to be used by anything else until it is released and pressed again by itself, or with any other key than "e". No big deal as i can change the keys, and thanks for spotting that the context menu was focused (verified with the space key). I think that sheds light on another intermittent problem i'v been having with hotkeys.
  10. When Alt+e is pressed to show the second GUI, and the "e" key is the last to be released, the first press of Esc will not close the GUI #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("", 100, 100, 100, 100) $Form2 = GUICreate("", 200, 200, 200, 200) GUISetState(@SW_SHOW, $Form1) HotKeySet("!e", "_form2") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _form2() GUISetState(@SW_SHOW, $Form2) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUISetState(@SW_HIDE, $Form2) EndFunc
  11. thank martin! done was it you who i probably scarfed this idea from?
  12. the concept comes from someone else here, though i forget who (if you, let me know and i'll be glad to give credit) rather than toggling line wrapping on and off in an AutoIt multi-line edit control, which apparently is not doable, this function destroys and recreates the control, preserving various aspects of the original it works by creating the new control with or without a horizontal scroll bar ($WS_HSCROLL) i'm no pro, so critique is welcome #include-once #include <WinAPI.au3> #include <GUIEdit.au3> #include <WindowsConstants.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: _EditCtrl_ToggleLineWrap ; Version .......; 1.1 (29-Jan-2014) ; Description ...: toggle line wrapping for an AutoIt multi-line edit control ; Syntax ........: _EditCtrl_ToggleLineWrap($hWnd, $iCtrlID[, $iResize = $GUI_DOCKAUTO[, $iChars = 999999[, $sFont = ""[, $hexColor = 0x000000[, $hexBgColor = 0xFFFFFF]]]]]) ; Parameters ....: $hWnd - handle to parent window ; $iCtrlID - edit control ID ; $iResize - [optional] (integer) edit control resizing value for GUICtrlSetResizing() - def=$GUI_DOCKAUTO ; $iChars - [optional] (integer) edit control max chars - def=999999 ; $sFont - [optional] (string) "|" seperated string 4 of parameters for GUICtrlSetFont() (size, weight, attribute, fontname) - def="" ; $hexColor - [optional] (hex) font color - def=0x000000 (black) ; $hexBgColor - [optional] (hex) edit control background color - def=0xFFFFFF (white) ; Return values .: -1 = Error ; : 0 = Wrapping off ; : 1 = Wrapping on ; Author ........: iCode ; Modified ......: 1-JAN-2014 ; Remarks .......: tested with AutoIt 3.3.10.2 ; : it appears that if the edit control is too close to the GUI border, it can be re-created with entirely wrong dimentions ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _EditCtrl_ToggleLineWrap($hWnd, $iCtrlID, $iResize = 1, $iChars = 999999, $sFont = "", $hexColor = 0x000000, $hexBgColor = 0xFFFFFF) Local $return, $aFont Local $string = GUICtrlRead($iCtrlID) Local $aCtrlPos = ControlGetPos($hWnd, "", $iCtrlID) If @error Or $aCtrlPos[2] < 1 Or $aCtrlPos[3] < 1 Then Return -1 Local $hCtrl = GUICtrlGetHandle($iCtrlID) If $hCtrl = 0 Then Return -1 Local $ctrlStyle = _WinAPI_GetWindowLong($hCtrl, $GWL_STYLE) If @error Then Return -1 Local $ctrlExStyle = _WinAPI_GetWindowLong($hCtrl, $GWL_EXSTYLE) If @error = 10 Then $ctrlExStyle = 0 Local $iMod = _GUICtrlEdit_GetModify($hCtrl) Local $aSel = _GUICtrlEdit_GetSel($hCtrl) Local $iLines = _GUICtrlEdit_GetFirstVisibleLine($hCtrl) GUICtrlDelete($iCtrlID) If BitAND($ctrlStyle, $WS_HSCROLL) Then $iCtrlID = GUICtrlCreateEdit("", $aCtrlPos[0], $aCtrlPos[1], $aCtrlPos[2], $aCtrlPos[3], $ctrlStyle - $WS_HSCROLL, $ctrlExStyle) $return = 1 Else $iCtrlID = GUICtrlCreateEdit("", $aCtrlPos[0], $aCtrlPos[1], $aCtrlPos[2], $aCtrlPos[3], $ctrlStyle + $WS_HSCROLL, $ctrlExStyle) $return = 0 EndIf GUICtrlSetResizing($iCtrlID, $iResize) GUICtrlSetBkColor($iCtrlID, $hexBgColor) GUICtrlSetColor($iCtrlID, $hexColor) If $sFont <> "" Then $aFont = StringSplit($sFont, "|") If $aFont[0] = 4 Then GUICtrlSetFont($iCtrlID, $aFont[1], $aFont[2], $aFont[3], $aFont[4]) EndIf EndIf GUICtrlSetLimit($iCtrlID, $iChars) GUICtrlSetData($iCtrlID, $string) _GUICtrlEdit_LineScroll($iCtrlID, 0, $iLines) _GUICtrlEdit_SetSel($iCtrlID, $aSel[0], $aSel[1]) _GUICtrlEdit_SetModify($iCtrlID, $iMod) Return $return EndFunc CHANGE LOG 29-Jan-2014 * fixed a bug that could cause incorrect extra style to be applied to edit control 1-Jan-2014 * restores the scroll position to the current line number * very minor changes 29-Dec-2013 * swapped the return values - they were backwards 28-Dec-2013 * include Martins suggestion to restore character selection * added check of edit control size to avoid problems if the control is less than 1x1 px
  13. Thanks gentlemen @jchd - I began to suspect it was an anchor problem after reading more of the doc linked to in your sig @mikell - that's not the actual replace expression i'm using, but yes, forgetting about captured groups has nearly bitten me before
  14. Hi mikell I must need a brain enlargement because i don't get it So when the engine comes upon the "OR", are you saying content outside of the group is considered? Essentially it is grouped like... (?<!a)(b|c)(d)*(?=e) So nothing should match if 'b' OR 'c' is preceded by 'a' and 'b' OR 'c' is not followed by 'e' I'm not understanding how changing that to the following changes anything... (?<!a)((b)|(c))(d)*(?=e) This PCRE stuff is hard
  15. Hi jchd! I understand that it must have a fixed length and it does... doesn't it? (?<!href=")(https? If i understand roughly how PCRE works, the 'matching point' is 'h' in the 'htttps?' - from there it should look at the previous 6 chars for 'href="' I got done what i needed to do by adding a look-ahead group at the end and removing the neg. look-behind, but i still don't quite understand why the original failed to work, other than perhaps it has something to do with the anchor/matching point $str = '<a href="http://example.com">link</a>' ; should NOT match ;$str = 'http://example.com' ; should match $str = StringRegExpReplace($str, '(?i)(https?://[a-z0-9][a-z0-9.-]*[a-z0-9]\.[a-z]{2,4}|[a-z0-9][a-z0-9.-]*[a-z0-9]\.(?:biz|com|edu|eu|gov|info|mil|org|net|uk|us))(/\S*)*(?=\s|[[:punct:]]|$)(?!")', _ '<a href="$1$2">$1$2</a>') ConsoleWrite($str & @LF)
  16. In the event you might be looking for a RegEx also, i am also working on >text to html stuff
  17. Why is the negative look behind group failing in this example? $str = '<a href="http://example.com">link</a>' ; should NOT match ;$str = 'http://example.com' ; should match $str = StringRegExpReplace($str, _ '(?i)(?<!href=")(https?://[a-z0-9][a-z0-9.-]*[a-z0-9]\.[a-z]{2,4}|[a-z0-9][a-z0-9.-]*[a-z0-9]\.(?:biz|com|edu|eu|gov|info|mil|org|net|uk|us))(/\S*)*(?=\s|[[:punct:]]|$)', _ '<a href="$1$2">$1$2</a>') ConsoleWrite($str & @LF)
  18. i like it when it all works the first time very nice work Adventurer -- you made it really easy to use psftp
  19. played with this for a while and haven't figured it out with windows 7, and i don;t know what other flavors, you can't move a window past the top of the display - i think aero-snap is pushing it back down i've seen several threads on stackexchange about this, many of which say you can get around the problem with a combination of gui styles, however i could not find a combo that worked what i don't understand in my example, is why the second (Y) element in the WinGetPos() array is returning 0 instead of the actual position when the mouse button is released (watch the end of the longer string in the console) i'm trying to work around aero-snap without disabling it (not an option), but you will see from my example it isn't working try moving this window past the top edge of your display... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> Global Const $frameSz = 128 Global Const $formSz = 500 Global $aPos Global $Form1 = GUICreate("Form1", $formSz, $formSz, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xFFFFFF) Global $Label1 = GUICtrlCreateLabel("", 0, 0, $formSz, $formSz / 2 - $frameSz / 2, -1, $GUI_WS_EX_PARENTDRAG) ; top GUICtrlSetBkColor(-1, 0x000000) Global $Label2 = GUICtrlCreateLabel("", $formSz / 2 + $frameSz / 2, $formSz / 2 - $frameSz / 2, $formSz / 2 - $frameSz / 2, $frameSz, -1, $GUI_WS_EX_PARENTDRAG) ; right GUICtrlSetBkColor(-1, 0x000000) Global $Label3 = GUICtrlCreateLabel("", 0, $formSz / 2 + $frameSz / 2, $formSz, $formSz / 2 + $frameSz / 2, -1, $GUI_WS_EX_PARENTDRAG) ; bottom GUICtrlSetBkColor(-1, 0x000000) Global $Label4 = GUICtrlCreateLabel("", 0, $formSz / 2 - $frameSz / 2, $formSz / 2 - $frameSz / 2, $frameSz, -1, $GUI_WS_EX_PARENTDRAG) ; left GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) _WinAPI_SetLayeredWindowAttributes($Form1, 0xFFFFFF, 150) GUIRegisterMsg($WM_MOVE, "my_func1") GUIRegisterMsg($WM_EXITSIZEMOVE, "my_func2") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func my_func1() $aPos = WinGetPos($Form1) ConsoleWrite($aPos[1] & ".") EndFunc Func my_func2() ConsoleWrite(@LF & $aPos[1] & @LF) WinMove($Form1, "", $aPos[0], $aPos[1], $aPos[2], $aPos[3]) EndFunc update: these changes get what i want, but i'd like to hear from anyone that might have better method ... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> Global Const $frameSz = 128 Global Const $formSz = 500 Global $aPos Global $iLastPos Global $Form1 = GUICreate("Form1", $formSz, $formSz, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xFFFFFF) Global $Label1 = GUICtrlCreateLabel("", 0, 0, $formSz, $formSz / 2 - $frameSz / 2, -1, $GUI_WS_EX_PARENTDRAG) ; top GUICtrlSetBkColor(-1, 0x000000) Global $Label2 = GUICtrlCreateLabel("", $formSz / 2 + $frameSz / 2, $formSz / 2 - $frameSz / 2, $formSz / 2 - $frameSz / 2, $frameSz, -1, $GUI_WS_EX_PARENTDRAG) ; right GUICtrlSetBkColor(-1, 0x000000) Global $Label3 = GUICtrlCreateLabel("", 0, $formSz / 2 + $frameSz / 2, $formSz, $formSz / 2 + $frameSz / 2, -1, $GUI_WS_EX_PARENTDRAG) ; bottom GUICtrlSetBkColor(-1, 0x000000) Global $Label4 = GUICtrlCreateLabel("", 0, $formSz / 2 - $frameSz / 2, $formSz / 2 - $frameSz / 2, $frameSz, -1, $GUI_WS_EX_PARENTDRAG) ; left GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) _WinAPI_SetLayeredWindowAttributes($Form1, 0xFFFFFF, 150) GUIRegisterMsg($WM_MOVE, "my_func1") GUIRegisterMsg($WM_EXITSIZEMOVE, "my_func2") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func my_func1() $aPos = WinGetPos($Form1) If $aPos[1] <> 0 Then $iLastPos = $aPos[1] ConsoleWrite($aPos[1] & ",") EndFunc Func my_func2() ConsoleWrite(@LF & $aPos[1] & @LF) WinMove($Form1, "", $aPos[0], $iLastPos, $aPos[2], $aPos[3]) EndFunc
  20. This function prevents a window from being moved beyond any screen edge, sort of like docking, but there is no 'snap' function. Optionally, you can also prevent another window from overlapping the primary one. This works regardless of the Windows task-bar position/size or auto-hide status. #include-once ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinDock ; Version .......; 1.3.1 ; Description ...: Dock a window at any screen edge and, optionally, prevent another window from overlapping the first ; Syntax ........: _WinDock($hWnd1, [$hWnd2]) ; Parameters ....: $hWnd1 - Handle to primary window ; $hWnd2 - Handle to secondary window (optional) ; Return values .: 1 = No error ; set @error = 1, @extended = -1 : $hWnd1 is not a window handle ; set @error = 1, @extended = -2 : unable to get taskbar position ; set @error = 1, @extended = -3 : unable to get window position of $hWnd1 ; set @error = 1, @extended = -4 : unable to get window position of (optional) $hWnd2 ; Author ........: $iCode ; Modified ......: ; Remarks .......: Works regardless of taskbar position, size and auto-hide status ; Related .......: WinMove ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _WinDock($hWnd1, $hWnd2 = 0) ; handle of primary window, [handle of secondary window] If Not IsHWnd($hWnd1) Then Return SetError(1, -1) Local $aWinPos2 = 0, $iMoveWin2 = 0, $overlap, _ $x1 = Default, $y1 = Default, _ $x2 = Default, $y2 = Default, $w2 = Default, _ $scrW = @DesktopWidth, $scrH = @DesktopHeight, _ $scrLeft = 0, $scrTop = 0 Local $aTskBarPos = WinGetPos("[CLASS:Shell_TrayWnd]") ; X, Y, W, H If @error Then Return SetError(1, -2) Local $aWinPos1 = WinGetPos($hWnd1) If @error Then Return SetError(1, -3) If IsHWnd($hWnd2) Then $aWinPos2 = WinGetPos($hWnd2) If @error Then Return SetError(1, -4) EndIf $iMoveWin2 = 1 EndIf ; set screen coordinates, less windows taskbar If $aTskBarPos[0] <= 0 And $aTskBarPos[3] = $scrH Then ; taskbar on left If $aTskBarPos[0] > 0 Then ; taskbar is visible $scrLeft = $aTskBarPos[2] $scrW -= $aTskBarPos[2] EndIf ElseIf $aTskBarPos[1] <= 0 And $aTskBarPos[2] = $scrW Then ; taskbar on top If $aTskBarPos[1] > 0 Then ; taskbar is visible $scrTop = $aTskBarPos[3] $scrH -= $aTskBarPos[3] EndIf ElseIf $aTskBarPos[1] <= 0 And $aTskBarPos[3] = $scrH Then ; taskbar on right $scrW = $aTskBarPos[0] Else ; taskbar on bottom $scrH = $aTskBarPos[1] EndIf ; positioning on x axis If $aWinPos1[0] <= $scrLeft Then $x1 = $scrLeft If $iMoveWin2 = 1 Then If $aWinPos1[2] + $aWinPos2[2] > $scrW Then ; we need to resize the width of $hWnd2 $x2 = $scrLeft + $aWinPos1[2] $w2 = $scrW - $aWinPos1[2] ElseIf $aWinPos2[0] < $scrLeft + $aWinPos1[2] Then $x2 = $scrLeft + $aWinPos1[2] EndIf EndIf ElseIf $aWinPos1[0] + $aWinPos1[2] >= $scrW Then $x1 = ($scrW + $scrLeft) - $aWinPos1[2] If $iMoveWin2 = 1 Then If $aWinPos1[2] + $aWinPos2[2] > $scrW Then ; we need to resize the width of $hWnd2 $x2 = $scrLeft $w2 = $scrW - $aWinPos1[2] ElseIf $aWinPos2[0] + $aWinPos2[2] > $scrW - $aWinPos1[2] Then $overlap = ($aWinPos2[0] + $aWinPos2[2]) - ($scrW - $aWinPos1[2]) $x2 = $scrLeft + ($aWinPos2[0] - $overlap) EndIf EndIf EndIf ; positioning on y axis If $aWinPos1[1] < $scrTop Then $y1 = $scrTop ElseIf $aWinPos1[1] + $aWinPos1[3] > $scrH + $scrTop Then $y1 = $aWinPos1[1] - (($aWinPos1[1] + $aWinPos1[3]) - ($scrH + $scrTop)) EndIf WinMove($hWnd1, "", $x1, $y1) If $iMoveWin2 = 1 Then WinMove($hWnd2, "", $x2, $y2, $w2) Return 1 EndFunc #cs ### EXAMPLE ### #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 400, 400, @DesktopWidth / 2, @DesktopHeight / 2, -1, BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE)) $Label1 = GUICtrlCreateLabel("", 0, 0, 400, 200, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) GUICtrlSetData(-1, "DRAG ME BEYOND A VERTICAL SCREEN EDGE " & @LF & "AND MOVE OTHER WINDOW") GUICtrlSetCursor (-1, 9) $Label2 = GUICtrlCreateLabel("", 0, 200, 400, 200, $SS_CENTER, $GUI_WS_EX_PARENTDRAG) GUICtrlSetData(-1, "DRAG ME BEYOND A VERTICAL SCREEN EDGE " & @LF & "AND DO NOT MOVE OTHER WINDOW") GUICtrlSetCursor (-1, 9) GUISetState(@SW_SHOW) $Form2 = GUICreate("Form2", @DesktopWidth - 150, @DesktopHeight - 150, 75, 50, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP)) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $Label1 _WinDock($Form1, $Form2) Case $Label2 _WinDock($Form1) EndSwitch WEnd #ce last updated: 24-Mar-2014 v1.3.1 * forgot '#include-once' v1.3 * minor optimizations and some variables renamed * fixed an oversight where docking of primary window would not occur if the secondary window did not exist * dumped Return values and set @extended instead * now sets @error to 1 if something fails v1.2 * re-wrote most of the function, adding ability to compensate for task-bar position and auto-hide status
  21. suggest adding descriptions for Appendix > Windows Message Codes
  22. good point, and because of that disclaimer and lack of support for unicode, i believe that strengthens my argument to incorporate the second type of apostrophe - it already has one and so the second is just another type of the first sorry if i overstepped my bounds, i know this is a dev forum, and so i'll go away now
  23. i need to integrate the functionality in an existing script, but thanks for the links though so far it looks like i'm going to be stuck with backing up and restoring the entire clipboard - i know about the UDF's to do that and i have used them before, but i was hoping for a more efficient alternative
  24. 100,000 - 2,000,000 speakers - doesn't look too "universal", does it that name does ring a bell though
  25. somebody told me that, decades ago, there was talk of a universal language... WHERE THE HELL IS IT!
×
×
  • Create New...