Leaderboard
Popular Content
Showing content with the highest reputation on 10/30/2019 in all areas
-
You can use a child gui too: #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> Global $hGui = GUICreate("MainForm") _GuiCtrlCreateRoundedLabel($hGui, "Round Label", 10, 10, 100, 30, 0x201) GUICtrlSetBkColor(-1, 0xabcdef) _GuiCtrlCreateRoundedLabel($hGui, "Red Label", 10, 50, 100, 30, 0x201) GUICtrlSetBkColor(-1, 0xFF0000) GUISetState() Do Until GUIGetMsg() = -3 Func _GuiCtrlCreateRoundedLabel($hParent, $sText, $iX, $iY, $iW, $iH, $iStyle = $GUI_SS_DEFAULT_LABEL, $iExStyle = 0) Local $hChild = GUICreate($sText, $iW, $iH, $iX, $iY, $WS_CHILD, 0, $hParent) _Gui_RoundCorners($hChild, 0, 0, 10, 10) Local $nLabel = GUICtrlCreateLabel($sText, 0, 0, $iW, $iH, $iStyle, $iExStyle) GUISetState() GUISwitch($hParent) Return $nLabel EndFunc ;==>_GuiCtrlCreateRoundedLabel Func _Gui_RoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Local $XS_pos, $XS_ret, $XS_ret2 $XS_pos = WinGetPos($h_win) $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3) If $XS_ret[0] Then $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1) EndIf EndFunc ;==>_Gui_RoundCorners Edit: Sorry, forgot about the border! #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <WinAPI.au3> #include <GUIConstantsEx.au3> Global $hGui = GUICreate("MainForm") _GuiCtrlCreateRoundedLabel($hGui, "Round Label", 10, 10, 100, 30, 0xABCDEF, 0x201) _GuiCtrlCreateRoundedLabel($hGui, "Red Label", 10, 50, 100, 30, 0XFF0000, 0x201) GUISetState() Do Until GUIGetMsg() = -3 Func _GuiCtrlCreateRoundedLabel($hParent, $sText, $iX, $iY, $iW, $iH, $iColor, $iStyle = $GUI_SS_DEFAULT_LABEL, $iExStyle = 0) Local $hChild = GUICreate($sText, $iW, $iH, $iX, $iY, $WS_CHILD, 0, $hParent) GUISetBkColor($iColor) _Gui_RoundCorners($hChild, 0, 0, $iW - 1, $iH - 1) GUICtrlCreateGraphic(0, 0, $iW, $iH, 0) GUICtrlSetGraphic(-1, $GUI_GR_PENSIZE, 3) GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 0, 0, $iW - 1, $iH - 1) Local $nLabel = GUICtrlCreateLabel($sText, 0, 0, $iW, $iH, $iStyle, $iExStyle) GUICtrlSetBkColor(-1, -2) GUISetState() GUISwitch($hParent) Return $nLabel EndFunc ;==>_GuiCtrlCreateRoundedLabel Func _Gui_RoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Local $XS_pos, $XS_ret, $XS_ret2 $XS_pos = WinGetPos($h_win) $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3) If $XS_ret[0] Then $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1) EndIf EndFunc ;==>_Gui_RoundCorners2 points
-
mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples1 point
-
@Chimp maybe https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem.actions ? all the properties are listed under it...1 point
-
The following script (quick and dirty with near-to-no documentation) splits your example workbook into multiple pieces: #include <Excel.au3> Global $sPrevious = "", $iRowCount = 0, $iStartExcelRow = 2, $iBlockStartExcelRow = $iStartExcelRow, $iStartColumn = 0, $iEndColumn = 7 Global $sInputPath = @ScriptDir & "\test.xlsx", $sSavePath = @ScriptDir Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, $sInputPath) Global $aUsedRange = _Excel_RangeRead($oWorkbook) _ArraySort($aUsedRange, 0, 1) ; Sort ascending on column 0 (first column), ignores header line _ArrayDisplay($aUsedRange) For $iRow = 1 To UBound($aUsedRange, 1) - 1 ; Column A has changed. Add processing of the previous block here If $sPrevious <> $aUsedRange[$iRow][0] And $sPrevious <> "" Then _Excel_RangeDelete($oWorkbook.Worksheets(1), $iRow + 1 & ":99999") ; Delete all rows after the current block If $iBlockStartExcelRow > $iStartExcelRow Then _Excel_RangeDelete($oWorkbook.Worksheets(1), $iStartExcelRow & ":" & $iBlockStartExcelRow) ; Delete all rows before the current block EndIf _Excel_BookSaveAs($oWorkbook, $sSavePath & "\" & $aUsedRange[$iBlockStartExcelRow][0], Default, True) ; Overwrite If @error Then Exit MsgBox($MB_ICONERROR, "Test-Script", "@error = " & @error & ", @extended = " & @extended & " when saving the workbook!") _Excel_BookClose($oWorkbook) $oWorkbook = _Excel_BookOpen($oExcel, $sInputPath) If MsgBox($MB_OKCANCEL, "Test-Script", "Column A changed from '" & $sPrevious & "' to '" & $aUsedRange[$iRow][0] & "'. " & $iRowCount & " rows processed." & @CRLF & _ "Data has been copied to '" & $sPrevious & ".xlsx'. Please press 'OK' to continue or 'Cancel' to end the script.") = $IDCANCEL Then Exit $iRowCount = 0 $iBlockStartExcelRow = $iRow EndIf $sPrevious = $aUsedRange[$iRow][0] $iRowCount = $iRowCount + 1 Next ; End of table reached. Add processing of the last block here If $iBlockStartExcelRow > $iStartExcelRow Then _Excel_RangeDelete($oWorkbook.Worksheets(1), $iStartExcelRow & ":" & $iBlockStartExcelRow) ; Delete all rows before the current block EndIf _Excel_BookSaveAs($oWorkbook, $sSavePath & "\" & $aUsedRange[$iBlockStartExcelRow][0], Default, True) ; Overwrite If @error Then Exit MsgBox($MB_ICONERROR, "Test-Script", "@error = " & @error & ", @extended = " & @extended & " when saving the workbook!") _Excel_BookClose($oWorkbook) _Excel_Close($oExcel) MsgBox($MB_OKCANCEL, "Test-Script", "End of table reached. " & $iRowCount & " rows processed." & @CRLF & _ "Data has been copied to '" & $sPrevious & ".xlsx'.")1 point
-
Besides this little misreading, the issue of "SQL table order" is extremely common. People new to SQL more than often think of an SQL table as an Excel sheet (formulas apart). There is a huge difference between both: an Excel sheet is a list while an SQL table is a set. In a mathematical set you can't have twice the same value, which is possible in a list. And while the order of a list is important and must be conserved until explicitely changed (think of the steps of a recipe or build process or composition of rotations in 3D space [they aren't commutative]), there is no order in the set of ingredients of a recipe, nor in the set of tools needed to build something. The best way to get rid of this mental biais is to remember that a SELECT without an explicit ORDER BY clause needs to be regarded as if it had an implied ORDER BY random() clause and think of your tables this orderless way. @Vitaliy4us apply the above rule to your request and see that is doesn't have any meaning unless more discreminating information is available.1 point
-
Back to innocence example #include <string.au3> MsgBox(0, '', _ARLeadingZeros(-00066, True) & @CRLF & _ARLeadingZeros(-00066, False, 3)) Func _ARLeadingZeros($n, $bRemove = False, $length = 6) If $bRemove Or StringLen(Abs($n)) >= $length Then Return $n Local $nP = 1 & _StringRepeat(0, $length), $nN = "-" & StringTrimLeft($nP - $n, 1) Return $nN = $n ? $nN : StringTrimLeft($nP + $n, 1) EndFunc ;==>_AddRemoveLeadingZeros1 point
-
_IEAttach No Match Found.
ComradVlad reacted to Gianni for a topic
you're not the only one ... there's even worse... https://abovethelaw.com/2018/01/the-most-embarrassing-typo-in-a-lawyer-letter-ever/?rf=1 https://www.amazon.com/Just-My-Typo-Sinning-Untied/dp/0385346603#reader_03853466031 point -
Java app will only be possible with jab bridge1 point
-
Window Style Tool
ioa747 reacted to boomingranny for a topic
A simple tool I made to help me pick the right window style combination. select the style(s) you want for your new window gui and see them live in the preview window to the right, then copy the resulting text out of the preview window, in to your guicreate line... #include <EditConstants.au3> #include <StructureConstants.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> #include <TreeViewConstants.au3> #include <GUIConstantsEx.au3> #include <Array.au3> #include <String.au3> opt("GUIOnEventMode",1) global $Win,$Win2 global $styles[1], $extStyles[1] global $TVStyles, $TVExtStyles global $tvStyleItems[1], $tvExtStyleItems[1] global $oldpos[4] global $CreatingWindow global $inTitle,$text,$styletext,$extStyleText global $heightOffset, $widthOffset global $TreeviewItem_Clicked global $lblStyle,$lblExtStyle global $width=300, $height = 300 global $TimerCreateWindow ;prevents recreating window too many times at once - as it can lag the program out ;missing extended window const const $WS_EX_NOREDIRECTIONBITMAP = 0x00200000 addstyles() addExtStyles() main() func main() redim $tvStyleItems[UBound($styles)] redim $tvExtStyleItems[UBound($Extstyles)] $win = GUICreate("Windows Styles",500,590,-1,-1,BitOR($WS_THICKFRAME,$WS_MINIMIZEBOX )) GUISetOnEvent($GUI_EVENT_CLOSE,"_exit") GUICtrlCreateLabel("Title:",4,10) GUICtrlSetResizing(-1,BitOR($GUI_DOCKTOP,$GUI_DOCKHEIGHT)) $inTitle = GUICtrlCreateInput("",30,5,250,22) GUICtrlSetResizing(-1,BitOR($GUI_DOCKTOP,$GUI_DOCKHEIGHT)) GUICtrlSetOnEvent(-1,"titlechange") $btnSetTitle = GUICtrlCreateButton("Set",280,4,40,24) GUICtrlSetResizing(-1,BitOR($GUI_DOCKTOP,$GUI_DOCKHEIGHT)) GUICtrlSetOnEvent(-1,"titlechange") $lblStyle = GUICtrlCreateLabel("Style: 00000000000000000000000000000000",4,30,400) GUICtrlSetFont(-1,9,500,0,"Courier New") GUICtrlSetResizing(-1,BitOR($GUI_DOCKTOP,$GUI_DOCKHEIGHT)) $lblExtStyle = GUICtrlCreateLabel("Extended Style: 00000000000000000000000000000000",4,50,400) GUICtrlSetFont(-1,9,500,0,"Courier New") GUICtrlSetResizing(-1,BitOR($GUI_DOCKTOP,$GUI_DOCKHEIGHT)) $TVStyles = GUICtrlCreateTreeView(0,70,247,495,$TVS_CHECKBOXES) GUICtrlSetResizing(-1,BitOR($GUI_DOCKLEFT,$GUI_DOCKTOP,$GUI_DOCKBOTTOM)) for $i = 1 to UBound($Styles)-1 $tvStyleItems[$i] = GUICtrlCreateTreeViewItem($styles[$i],$tvStyles) GUICtrlSetOnEvent(-1,"TreeviewItem_Click") Next $TVExtStyles = GUICtrlCreateTreeView(250,70,247,495,$TVS_CHECKBOXES) GUICtrlSetResizing(-1,BitOR($GUI_DOCKRIGHT,$GUI_DOCKTOP,$GUI_DOCKBOTTOM)) for $i = 1 to UBound($ExtStyles)-1 $tvExtStyleItems[$i] = GUICtrlCreateTreeViewItem($extStyles[$i],$TVExtStyles) GUICtrlSetOnEvent(-1,"TreeviewItem_Click") Next GUISetState() ;this function creates the initial preview gui on the right ($win2) CreatePreviewGUI() $oldMouseX = -1 $oldMouseY = -1 While 1 setWinPos() sleep(50) $mouseX = MouseGetPos(0) $mouseY = MouseGetPos(1) if $mouseX <> $oldMouseX or $mouseY <> $oldMouseY then SetTip() $oldMouseX = $mouseX $oldMouseY = $mouseY endif WEnd EndFunc func setWinPos() if not IsHWnd($win) then return if not IsHWnd($win2) then return $pos = WinGetPos($win) $bUpdateText = false ;if window has moved if $oldpos[0] <> $pos[0] or $oldpos[1] <> $pos[1] or $oldpos[2] <> $pos[2] or $oldpos[3] <> $pos[3] then $top = $pos[1] $left = $pos[0]+$pos[2] winmove($win2,"",$left,$top,Default,Default) $oldpos = $pos UpdateText() endif EndFunc func TreeviewItem_Click() CreatePreviewGUI() EndFunc func CreatePreviewGUI() if $CreatingWindow or TimerDiff($TimerCreateWindow) < 500 then $CreatingWindow = false AdlibRegister("CreatePreviewGUI",1000) return endif AdlibUnRegister("CreatePreviewGUI") $TimerCreateWindow = TimerInit() $CreatingWindow = true Local $SelectedStyleCount Local $SelectedExtStyleCount $styletext = "" $ExtStyleText = "" local $style = 0, $extStyle = 0 $SelectedStyleCount = 0 for $i = 1 to UBound($styles)-1 if _GUICtrlTreeView_GetChecked($TVStyles,$tvStyleItems[$i]) then $SelectedStyleCount += 1 $style = bitor($style,Execute($Styles[$i])) $styletext &= $Styles[$i] &" , " endif Next $styletext = StringTrimRight($styletext,3) ;remove the " , " on the end $SelectedExtStyleCount = 0 for $i = 1 to UBound($extStyles)-1 if _GUICtrlTreeView_GetChecked($TVExtStyles,$tvExtStyleItems[$i]) then $SelectedExtStyleCount += 1 $Extstyle = bitor($extStyle,Execute($ExtStyles[$i])) $ExtStyleText &= $ExtStyles[$i] &" , " endif Next $extstyletext = StringTrimRight($extStyletext,3) ;remove the " , " on the end $pos = WinGetPos($win) if IsHWnd($win2) then GUIDelete($win2) $left = $pos[0]+$pos[2] $top = $pos[1] $win2 = GUICreate(GUICtrlRead($inTitle),$width,$height ,$left,$top,$style,$extStyle,$win) GUISetOnEvent($GUI_EVENT_CLOSE,"_deleteWin2") $timer = TimerInit() while not IsHWnd($win2) sleep(5) if TimerDiff($timer) > 1000 then $CreatingWindow = false ;failed to create window Return endif WEnd If $SelectedStyleCount > 1 Then $styletext = "BitOr ("&$styletext&")" If $SelectedExtStyleCount > 1 Then $extstyletext = "BitOr ("&$extstyletext&")" If $styletext = "" Then $styletext = 0 If $extstyletext = "" Then $extstyletext = 0 GUICtrlSetData($lblStyle, " Style: "&NumberToBinary($style)) GUICtrlSetData($lblExtStyle,"Extended Style: "&NumberToBinary($extstyle)) $size = WinGetClientSize ($win2) $text = GUICtrlCreateEdit("",-2,-2,$size[0]+4,$size[1]+4,BitOR($ES_READONLY,$ES_MULTILINE )) UpdateText() GUICtrlSetResizing($text,$GUI_DOCKBORDERS) GUICtrlSetBkColor($text,$GUI_BKCOLOR_TRANSPARENT ) GUISetState() WinActivate($win) $CreatingWindow = false EndFunc func addstyle($style) _ArrayAdd($Styles,$style) EndFunc func addextstyle($style) _arrayadd($extStyles,$style) EndFunc ;GUISetStyle($style,$extstyle) func addstyles() addstyle("$WS_MAXIMIZEBOX") addstyle("$WS_MINIMIZEBOX") addstyle("$WS_SIZEBOX") addstyle("$WS_SYSMENU") addstyle("$WS_HSCROLL") addstyle("$WS_VSCROLL") addstyle("$WS_DLGFRAME") addstyle("$WS_BORDER") addstyle("$WS_MAXIMIZE") addstyle("$WS_CLIPCHILDREN") addstyle("$WS_CLIPSIBLINGS") addstyle("$WS_DISABLED") addstyle("$WS_VISIBLE") addstyle("$WS_MINIMIZE") addstyle("$WS_CHILD") addstyle("$WS_POPUP") addstyle("$WS_OVERLAPPED") addstyle("$WS_TILED") addstyle("$WS_TABSTOP") addstyle("$WS_GROUP") addstyle("$WS_THICKFRAME") addstyle("$WS_CAPTION") addstyle("$WS_OVERLAPPEDWINDOW") addstyle("$WS_TILEDWINDOW") addstyle("$WS_ICONIC") addstyle("$WS_CHILDWINDOW") addstyle("$WS_POPUPWINDOW") EndFunc func _exit() exit EndFunc func addExtStyles() addExtStyle("$WS_EX_TOOLWINDOW") addExtStyle("$WS_EX_TOPMOST") addExtStyle("$WS_EX_LAYOUTRTL") addExtStyle("$WS_EX_ACCEPTFILES") addExtStyle("$WS_EX_APPWINDOW") addExtStyle("$WS_EX_COMPOSITED") addExtStyle("$WS_EX_CONTROLPARENT") addExtStyle("$WS_EX_CLIENTEDGE") addExtStyle("$WS_EX_CONTEXTHELP") addExtStyle("$WS_EX_DLGMODALFRAME") addExtStyle("$WS_EX_LAYERED") addExtStyle("$WS_EX_LEFT") addExtStyle("$WS_EX_LEFTSCROLLBAR") addExtStyle("$WS_EX_LTRREADING") addExtStyle("$WS_EX_MDICHILD") addExtStyle("$WS_EX_NOACTIVATE") addExtStyle("$WS_EX_NOINHERITLAYOUT") addExtStyle("$WS_EX_NOPARENTNOTIFY") addExtStyle("$WS_EX_RIGHT") addExtStyle("$WS_EX_RIGHTSCROLLBAR") addExtStyle("$WS_EX_RTLREADING") addExtStyle("$WS_EX_STATICEDGE") addExtStyle("$WS_EX_TRANSPARENT") addExtStyle("$WS_EX_WINDOWEDGE") addExtStyle("$WS_EX_NOREDIRECTIONBITMAP") EndFunc ; ============================================================================================== ; Func NumberToBinary($iNumber) ; ; Converts a 32-bit signed or unsigned # to a binary bit string. (32-bit is AutoIT limit) ; NOTE: range for 32-bit values is -2147483648 to 4294967295 ; Anything outside the range will return an empty string! ; ; $iNumber = # to convert, obviously ; ; Returns: ; Success: Binary bit string ; Failure: "" and @error set ; ; Author: Ascend4nt, with help from picaxe (Changing 'If BitAND/Else' to just one line) ; See it @ http://www.autoitscript.com/forum/index.php?showtopic=90056 ; ============================================================================================== Func NumberToBinary($iNumber) Local $iTopBit,$sBinString = "" ; Maximum 32-bit # range is -2147483648 to 4294967295 If $iNumber<-2147483648 Or $iNumber>4294967295 Then Return SetError(1,0,"") ; Any number <0 or >2147483647 will have the 32nd (top) bit set If $iNumber>2147483647 Or $iNumber<0 Then $iTopBit=1 Else $iTopBit=0 EndIf ; Remove topbit, otherwise the function will enter an endless loop Local $iUnsignedNumber=BitAND($iNumber,0x7FFFFFFF) ; Cycle through each bit, shifting to the right until 0 Do $sBinString = BitAND($iUnsignedNumber, 1) & $sBinString $iUnsignedNumber = BitShift($iUnsignedNumber, 1) Until Not $iUnsignedNumber ; PAD to 32-bits (or alternatively see below for #'s that don't need it) Return $iTopBit & StringRight("000000000000000000000000000000" & $sBinString,31) ; If you prefer not to pad numbers that don't need it (anything >0 and <2147483647): #cs If $iTopBit Then Return $iTopBit & StringRight("000000000000000000000000000000" & $sBinString,31) Return $sBinString #ce EndFunc ;==>_NumberToBinary func titleChange() WinSetTitle($win2,"",GUICtrlRead($inTitle)) UpdateText() EndFunc func UpdateText() GUICtrlSetData($text , "GUICreate("""&GUICtrlRead($inTitle)&""", Width, Height, Left, Top, "&$styletext &", "&$extStyleText&")") EndFunc Func SetTip() $aHwnd = DllCall("user32.dll", "hwnd", "WindowFromPoint", "uint", MouseGetPos(0), "uint", MouseGetPos(1)) Switch $aHwnd[0] Case GUICtrlGetHandle($tvStyles), GUICtrlGetHandle($TVExtStyles) $tMPos = _WinAPI_GetMousePos(True, $aHwnd[0]) $hItem = _GUICtrlTreeView_HitTestItem($aHwnd[0], DllStructGetData($tMPos, 1), DllStructGetData($tMPos, 2)) If $hItem = 0 Then ToolTip("") Else ToolTip(StyleHelp(_GUICtrlTreeView_GetText($aHwnd[0], $hItem)),Default,Default,Default,1,4) EndIf case Else ToolTip("") EndSwitch EndFunc func StyleHelp($styleName) switch $styleName case "$WS_BORDER" return "The window has a thin-line border." case "$WS_CAPTION" Return "The window has a title bar ($WS_BORDER | $WS_DIALOGFRAME)." case "$WS_CHILD" return "The window is a child window. A window with this style cannot have a menu bar. This style cannot be used with the $WS_POPUP style." case "$WS_CHILDWINDOW" return "Same as the $WS_CHILD style." case "$WS_CLIPCHILDREN" return "Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window." case "$WS_CLIPSIBLINGS" return "Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the $WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If $WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window." case "$WS_DISABLED" return "The window is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use the EnableWindow function." case "$WS_DLGFRAME" return "The window has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar." case "$WS_GROUP" return "(BUGGED: same value as $WS_MINIMIZEBOX) The window is the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the $WS_GROUP style. The first control in each group usually has the $WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function." case "$WS_HSCROLL" return "The window has a horizontal scroll bar." case "$WS_ICONIC" return "The window is initially minimized. Same as the $WS_MINIMIZE style." case "$WS_MAXIMIZE" return "The window is initially maximized." case "$WS_MAXIMIZEBOX" return "The window has a maximize button. Cannot be combined with the $WS_EX_CONTEXTHELP style. The $WS_SYSMENU style must also be specified." case "$WS_MINIMIZE" return "The window is initially minimized. Same as the $WS_ICONIC style." case "$WS_MINIMIZEBOX" return "The window has a minimize button. Cannot be combined with the $WS_EX_CONTEXTHELP style. The $WS_SYSMENU style must also be specified." case "$WS_OVERLAPPED" return "VALUE IS 0) The window is an overlapped window. An overlapped window has a title bar and a border. Same as the $WS_TILED style." case "$WS_OVERLAPPEDWINDOW" return "The window is an overlapped window. Same as the $WS_TILEDWINDOW style. ($WS_OVERLAPPED | $WS_CAPTION | $WS_SYSMENU | $WS_THICKFRAME | $WS_MINIMIZEBOX | $WS_MAXIMIZEBOX)" case "$WS_POPUP" return "The windows is a pop-up window. This style cannot be used with the $WS_CHILD style." case "$WS_POPUPWINDOW" return "The window is a pop-up window. The $WS_CAPTION and $WS_POPUPWINDOW styles must be combined to make the window menu visible. ($WS_POPUP | $WS_BORDER | $WS_SYSMENU)" case "$WS_SIZEBOX" return "The window has a sizing border. Same as the $WS_THICKFRAME style." case "$WS_SYSMENU" return "The window has a window menu on its title bar. The $WS_CAPTION style must also be specified." case "$WS_TABSTOP" return "(BUGGED: same value as $WS_MAXIMIZEBOX) The window is a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use the SetWindowLong function. For user-created windows and modeless dialogs to work with tab stops, alter the message loop to call the IsDialogMessage function." case "$WS_THICKFRAME" return "The window has a sizing border. Same as the $WS_SIZEBOX style." case "$WS_TILED" return "(VALUE IS 0) The window is an overlapped window. An overlapped window has a title bar and a border. Same as the $WS_OVERLAPPED style. " case "$WS_TILEDWINDOW" return "The window is an overlapped window. Same as the $WS_OVERLAPPEDWINDOW style. ($WS_OVERLAPPED | $WS_CAPTION | $WS_SYSMENU | $WS_THICKFRAME | $WS_MINIMIZEBOX | $WS_MAXIMIZEBOX)" case "$WS_VISIBLE" return "The window is initially visible. This style can be turned on and off by using the ShowWindow or SetWindowPos function." case "$WS_VSCROLL" return "The window has a vertical scroll bar." case "$WS_EX_ACCEPTFILES" return "The window accepts drag-drop files." case "$WS_EX_APPWINDOW" return "Forces a top-level window onto the taskbar when the window is visible." case "$WS_EX_CLIENTEDGE" return "The window has a border with a sunken edge." case "$WS_EX_COMPOSITED" return "Paints all descendants of a window in bottom-to-top painting order using double-buffering. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. Windows 2000: This style is not supported." case "$WS_EX_CONTEXTHELP" return "The title bar of the window includes a question mark. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window. $WS_EX_CONTEXTHELP cannot be used with the $WS_MAXIMIZEBOX or $WS_MINIMIZEBOX styles." case "$WS_EX_CONTROLPARENT" return "The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic." case "$WS_EX_DLGMODALFRAME" return "The window has a double border; the window can, optionally, be created with a title bar by specifying the $WS_CAPTION style in the dwStyle parameter." case "$WS_EX_LAYERED" return "The window is a layered window. This style cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. Windows 8: The $WS_EX_LAYERED style is supported for top-level windows and child windows. Previous Windows versions support $WS_EX_LAYERED only for top-level windows." case "$WS_EX_LAYOUTRTL" return "If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the horizontal origin of the window is on the right edge. Increasing horizontal values advance to the left." case "$WS_EX_LEFT" return "The window has generic left-aligned properties. This is the default." case "$WS_EX_LEFTSCROLLBAR" return "If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored." case "$WS_EX_LTRREADING" return "The window text is displayed using left-to-right reading-order properties. This is the default." case "$WS_EX_MDICHILD" return "The window is a MDI child window." case "$WS_EX_NOACTIVATE" return "A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. The window should not be activated through programmatic access or via keyboard navigation by accessible technology, such as Narrator. To activate the window, use the SetActiveWindow or SetForegroundWindow function. The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the $WS_EX_APPWINDOW style." case "$WS_EX_NOINHERITLAYOUT" return "The window does not pass its window layout to its child windows." case "$WS_EX_NOPARENTNOTIFY" return "The child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed." case "$WS_EX_NOREDIRECTIONBITMAP" return "The window does not render to a redirection surface. This is for windows that do not have visible content or that use mechanisms other than surfaces to provide their visual." case "$WS_EX_RIGHT" return "The window has generic ""right-aligned"" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored. Using the $WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles." case "$WS_EX_RIGHTSCROLLBAR" return "The vertical scroll bar (if present) is to the right of the client area. This is the default." case "$WS_EX_RTLREADING" return "If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored." case "$WS_EX_STATICEDGE" return "The window has a three-dimensional border style intended to be used for items that do not accept user input." case "$WS_EX_TOOLWINDOW" return "The window is intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE." case "$WS_EX_TOPMOST" return "The window should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function." case "$WS_EX_TRANSPARENT" return "The window should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted. To achieve transparency without these restrictions, use the SetWindowRgn function." case "$WS_EX_WINDOWEDGE" return "The window has a border with a raised edge." EndSwitch EndFunc func _deleteWin2() GUIDelete($win2) EndFunc1 point -
Thank you, guys. This is what works: #include <SendMessage.au3> #include <WindowsConstants.au3> Run("notepad.exe") $hWnd = WinWait("[CLASS:Notepad]", "", 10) $hControl = ControlGetHandle($hWnd, "", "Edit1") $text = "this is a line" $struct_string = DllStructCreate("char[" & StringLen($text) + 1 & "]") DllStructSetData($struct_string, 1, $text) _SendMessageA($hControl, $WM_SETTEXT, 0, DllStructGetPtr($struct_string))1 point
-
Send virtual key codes
TheXman reacted to Blue_Drache for a topic
Mmm.... spoonfed code is delicious!1 point -
According to the Excel UDF function _ExcelNumberFormat the last example (Range(Cells(1, 1), Cells(5, 10)).Select ) should read: With $oExcel.ActiveSheet .Range(.Cells($sRangeOrRowStart, $iColStart), .Cells($iRowEnd, $iColEnd) ).Select EndWith1 point