Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/29/2019 in all areas

  1. DFerrato

    The GuiBuilder Return

    Hello to all.. Returning this project, submitted a new version of the GUIBUILDER. This is an open project and i hope your suggestion and collaboration. Sample of Look and Feel. 1) Motivations: When you return to the development of the guibuilder, i ask to myself because I make a new program when there are already other full already extensive use among programrs as for example ISNT Studio or the K.O.D.A. And I found myself with the necessity that this is easily extensible, independent of the programming language and in a future integrated into a larger suite that includes other components (e.g., automation in the program flows, modeling of data structure, programming by rules, distinction of tasks by users, integration with other applications using standards such as SOAP or REST, etc.). This is so understanding the state of the art of software development today, is no longer useful that the aid is only in GUI development's. 2) Rationalizations: My first impulse to resuming development was to follow the methodology applied up until that time. But to have to speak the message loop to add the editing of properties of the window, I found myself in a quagmire to locate the exact site where to insert the new code. Just at that moment I understood because in Guibuilder Ravamped withdrew all the code that did not belong to the basic structure. This experience led me to adopt a third alternative expressed in the following actions: Convert all pieces of possible codes in functions: to each of these new features, you added a description and document parameters of Estrada, output and global variables used or modified. Organization of code and functions in sections: I understood that it is easier to find, understand and modify a section of code, if this is grouped according to what it does, The separation into Sections also reached to code generated by the GuiBuilder. Use a Database: In reviewing the various codes to modify i found that many of them were very similar, being able to save labor and time, separating the data in the instructions themselves and placing the latter in a local database (see Modifying_db.txt and structure_db.txt) Edition of Properties: While many controls have similar properties, this is not the case for all of them. By this replaced the fields Edit, by a grid, then automated change of each one of them, placed in the Db information on editing mechanism, by default values and classes about which it applies. New main window: It seemed to me that the program should have a separate to the main window of the properties and is remade the menu by placing some of its functions in a toolbar 4) State of the art While the Guibuilder works and generates a correct code, there are many even the facilities that I would like to add to it a full form builder. The functions currently available are: Usable Controls: Button, Checkbox, Radio, Edit, Input, Label, List, combo, Date, TreeView (incomplete), Icon, Pic, Progress Bar, Slider Bar, Group (incomplete) y Choose Color (New). Properties availables: and dependent on the control class chosen, are: Name, Left, Top, Width, BKColor, Color, Image, Style, Tip, Text, State, Cursor, Font (Type, size, color, styles) , Caption, Height, Value Default, Nombre de Clase, Style_ex, Source. Windows Properties: (incomplete) Grid: Enabled / Disabled, automatic alignment, alignment of the current control or all controls. Menu features: with added, enabled, disabled fast (see Menu.txt) Toolbar features: with added, enabled, disabled fast (see Toolbar.txt) Properties: Quick Add (see properties.txt) Debug: In the execution of code compiled or interpreted in a separate window (Open Debugview.exe - included) Debugging Features: display of internal arrays of operation ($MCL[], $Type[], $Grippy[], $CursorInfo[]) Autoit code generation: using loop of messages Generation saved source: code at any time. Possibility to generate codes: in other programming languages In the header of Guibuilder.au3 are the incomplete list and the point’s detected errors not yet corrected. 5) To Next ?. There are many tasks that are still to be carried out, to get to the objective explained in paragraph motivations, even that this form creator is as useful as possible to the developer. I would like to start by modifying the following: Autoit code generation using events. Complete controls disabled Tab, Menu, Context Menu, file etc. Added child windows. Correction of known bugs. Import function of code: after the modifications to it, made by a programer. Complete mass Modification: (Maintenance menu in tools). Shrinking message loop and global variables: the ease of maintenance of the program is inversely proportional to this. Toolbar of Properties: converter of static (actual) to Dynamic. For easy add the new properties. Wanted Beta tester, developers and fresh ideas. Exampe of Independent Debug window. GuiBuilder v1.0.11.zip Regards Daniel
    3 points
  2. Jos

    Gui Popup

    Slow down @zoel, It is impolite to bump your post within 24 hours, so please be patient. Open the helpfile in the meantime and invest the waiting time well to learn yourself. Jos
    2 points
  3. Time ago I wrote a function to extract data from the source HTML code of tables. https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/ Seems that that function fits very well to be used with the webBrowser udf. Just save the _HtmlTable2Array.au3 and #include it in your listing. here a simple example of use (I'm using IE here, but of course you can change settings to let the WebDriver use your preferred browser) ; Open a web page with a table, get a reference to the first table ; on the page (index 0) and read its contents into a 2-D array #include <Array.au3> #include 'wd_helper.au3' #include '_HtmlTable2Array.au3' ; <- get it from blow link ; https://www.autoitscript.com/forum/topic/167679-read-data-from-html-tables-from-raw-html-source/ ; === setup WebDriver for IE =============== $_WD_DEBUG = False Global $sDesiredCapabilities Global $sSession _SetupIE() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) ; ========================================== _Example_TableWriteToArray() Func _Example_TableWriteToArray() ; -- open a web page containing a table (ok also if there are more tables) _WD_Navigate($sSession, "https://www.beginnersguidetohtml.com/guides/html/tables/complex-tables") ; get a 'list' of the tables in the page $aTables = _WD_FindElement($sSession, $_WD_LOCATOR_ByTagName, "table", '', True) ; get the HTML source of the first table (index 0) change index if you need another table $sTable_HTML_source = _WD_ElementAction($sSession, $aTables[0], 'property', 'outerHTML') Local $aMyTable ; ------------------------------------------------------------------------------------ ; the _HtmlTableWriteToArray() function extract the data content from the HTML source ; and save data in a 2d Array. (if second parameter is true it fill cells of the array ; corresponding to the span areas with spanned data (data is spread over the cells) ; ------------------------------------------------------------------------------------ $aMyTable = _HtmlTableWriteToArray($sTable_HTML_source) _ArrayDisplay($aMyTable, "Data without spread") $aMyTable = _HtmlTableWriteToArray($sTable_HTML_source, True) _ArrayDisplay($aMyTable, "Data spreaded") ; ------------------------------------------------------------------------------------ EndFunc ;==>_Example_TableWriteToArray Func _SetupIE() _WD_Option('Driver', 'IEDriverServer.exe') _WD_Option('Port', 5555) _WD_Option('DriverParams', '--log-file=' & @ScriptDir & '\IE.log') $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' EndFunc ;==>_SetupIE
    1 point
  4. You should initially declare $sData as binary and then use _WinHttpReadData() in binary mode ;... $sData = Binary("") ;... $sChunk = _WinHttpReadData($hRequest, 2) ;... ...or use _WinHttpSimpleBinaryConcat() But why not simply: #include "WinHttp.au3" ; Initialize and get session handle $hOpen = _WinHttpOpen() ; Get connection handle $hConnect = _WinHttpConnect($hOpen, "www.mysite.com") ; SimpleSSL-request it... $vReturned = _WinHttpSimpleSSLRequest($hConnect, Default, "/folder/?user=kiki", "http://www.mysite.com/", Default, "Authorization: xxxxxxxxxxxxxxxxxxxx") ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) $hFile = FileOpen(@ScriptDir & "\files.zip", 18) FileWrite($hFile, $vReturned) FileClose($hFile)
    1 point
  5. Suggestion : \w{2,} which means : 2 or more word chars, greedy BTW the help file is your best friend
    1 point
  6. BrewManNH

    My script doesn't open

    Your menu is created before the gui it belongs in, try putting those three after the GUICreate.
    1 point
  7. Jos

    Help - (Moved)

    @SANOGO, This is the last time I ask you to use the forum standard fonts and stop changing them in your posts, as I have done that now too many times. As you know: I have closed the last thread for a reason, so you better start showing some effort and compliance or else you will be banned from these forums. Everybody else: stay out till I have received a satisfactory answer! Jos EDIT: Sorry guys but I have removed the just posted posts as they would interfere with mine.... hope you understand.
    1 point
  8. JLogan3o13

    My script doesn't open

    @zoel you need to start at least trying things for yourself rather than asking forum members to do everything for you. Your While statement has 3 Case clauses that could potentially close your GUI. Start commenting them out one at a time to find the culprit.
    1 point
  9. A new and improved version of his The GuiBuilder Return by DFerrato, has been added to the GUI Creator list in the first post. A new screenshot and download can be found at this post.
    1 point
  10. An alternative way allowing variations $sTextBefore = "Line 1 MF Midget vs NE Midgets" & @CR & _ "Line 2 Midgets -1a vs VYY Stars" & @CR $pat = "(?im)Midget.*?(?=\hvs|$)" Msgbox(0,"", StringRegExpReplace($sTextBefore, $pat, "+++"))
    1 point
  11. Change line 2154 and you should be fine.
    1 point
  12. Zedna

    I don't understand nothing

    For designing GUIs I recommend to use Koda, it's part of Scite4Autoit3 full editor.
    1 point
  13. I modified @Chimp's example. #include <GuiImageList.au3> #include <WinAPI.au3> #include <GDIPlus.au3> ; ---------------------- ; https://www.autoitscript.com/forum/topic/97902-trayseticon-with-handle/ Global Const $tagNOTIFYICONDATAW = _ 'dword cbSize;' & _ 'hwnd hWnd;' & _ 'uint uID;' & _ 'uint uFlags;' & _ 'uint uCallbackMessage;' & _ 'hwnd hIcon;' & _ 'wchar szTip[128];' & _ 'dword dwState;' & _ 'dword dwStateMask;' & _ 'wchar szInfo[256];' & _ 'uint uVersion;' & _ 'wchar szInfoTitle[64];' & _ 'dword dwInfoFlags;' ; & $tagGUID Global $tNID = DllStructCreate($tagNOTIFYICONDATAW), $pNID = DllStructGetPtr($tNID) Global $hWnd = WinGetHandle(AutoItWinGetTitle()), $hIcon DllStructSetData($tNID, 'cbSize', DllStructGetSize($tNID)) DllStructSetData($tNID, 'hWnd', $hWnd) ;HWnd($hGUI)) ; DllStructSetData($tNID, 'uID', 1) DllStructSetData($tNID, 'uFlags', 3) ; ---------------------- Global $hBmp_Anim, $hGfx, $hFrames Opt("GUIOnEventMode", 1) HotKeySet("{ESC}", "Quit") Example() Func Example() _GDIPlus_Startup() ; Load Image Local $hBitmap_l = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Bitmap351.png") Local $iW = _GDIPlus_ImageGetWidth($hBitmap_l), $iH = _GDIPlus_ImageGetHeight($hBitmap_l) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap) ;convert black to transparent color - not really needed here as there are not much opaque background pixels visible Local $aRemapTable[2][2] $aRemapTable[0][0] = 1 $aRemapTable[1][0] = 0xFF000000 ;black $aRemapTable[1][1] = 0 ;transparent Local $hIA = _GDIPlus_ImageAttributesCreate() _GDIPlus_ImageAttributesSetRemapTable($hIA, $aRemapTable) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hBitmap_l, 0, 0, $iW, $iH, 0, 0, $iW, $iH, $hIA) _GDIPlus_ImageDispose($hBitmap_l) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_ImageAttributesDispose($hIA) ; there are 31 images (frames) in strip Local $iFramesInStrip = 31 Local $iFrameWidth = 18 Local $iFrameHeight = 32 $hFrames = _GDIPlus_BitmapCreateFromScan0($iFrameWidth * $iFramesInStrip, $iFrameHeight) $hGfx = _GDIPlus_ImageGetGraphicsContext($hFrames) Local $sx = 0, $dx = 0 For $i = 1 To $iFramesInStrip - 3 _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hBitmap, 20 + $sx, 22, $iFrameWidth, $iFrameHeight, $dx, 0, $iFrameWidth, $iFrameHeight) $sx += 32 $dx += $iFrameWidth Next ;the last 3 images have a different offset $sx -= 8 For $i = $iFramesInStrip - 2 To $iFramesInStrip _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hBitmap, 20 + $sx, 22, $iFrameWidth, $iFrameHeight, $dx, 0, $iFrameWidth, $iFrameHeight) $sx += 32 $dx += $iFrameWidth Next _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BitmapDispose($hBitmap) ; release GDIPlus bitmap because not needed anymore ;_GDIPlus_ImageSaveToFile($hFrames, @ScriptDir & "\TestStripe.png") $hBmp_Anim = _GDIPlus_BitmapCreateFromScan0(16, 16) $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp_Anim) ; Create a little GUI $hGUI = GUICreate("Demo", 150, 80) GUICtrlCreateLabel("see the tray icon...", 10, 10, 140) GUICtrlSetFont(-1, 12) GUICtrlCreateButton("Quit", 40, 40, 80) GUICtrlSetOnEvent(-1, "Quit") GUISetState(@SW_SHOW) $sx = 0 Do For $i = 1 To $iFramesInStrip ; loop all frames _GDIPlus_GraphicsClear($hGfx, 0) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $hFrames, $sx, 0, $iFrameWidth, $iFrameHeight, 2, 0, 12, 16) $sx += $iFrameWidth If $sx > $iFrameWidth * ($iFramesInStrip - 1) Then $sx = 0 $hIcon = _GDIPlus_HICONCreateFromBitmap($hBmp_Anim) DllStructSetData($tNID, 'hIcon', $hIcon) _Shell_NotifyIcon(1, $pNID) ; TraySetIcon() _WinAPI_DestroyIcon($hIcon) Sleep(250) Next Until False EndFunc ;==>Example Func Quit() ; free memory _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_ImageDispose($hBmp_Anim) _GDIPlus_BitmapDispose($hFrames) _GDIPlus_Shutdown() _WinAPI_DestroyIcon($hIcon) GUIDelete() Exit EndFunc ;==>Quit Func _Shell_NotifyIcon($iMessage, $pdata) Local $aRet $aRet = DllCall('shell32.dll', 'int', 'Shell_NotifyIconW', 'dword', $iMessage, 'ptr', $pdata) If @error Then Return SetError(1, 0, 0) Return $aRet[0] EndFunc ;==>_Shell_NotifyIcon The attached image above is in PNG format, anyhow if you have it in BMP format then you should modify the line 40 accordingly, which should also work. Uncomment line 80 to save new created bitmap.
    1 point
  14. MONaH-Rasta, I rarely want to pause my scripts - they are usually designed to work full-time! But there are many ways to pause scripts programmatically - just search the forum and you will find many examples of how to do it. As an aside, I quite often use TrayOnEvent mode for the tray menu, while retaining MessageLoop mode for the main idle loop. That way the tray items get actioned instantly and are not affected by any ongoing functions within the main script. Why is that important? The Interrupting a running function tutorial in the Wiki will explain. M23
    1 point
  15. Here is another example: The following code is based upon one of the old scripts that I used years ago, just retested and it worked fine in Windows 10 x64 after a couple of modifications due to AutoIt changes: All credit Lod3n and Gary Frost #NoTrayIcon #include <GDIPlus.au3> #include <GuiComboBox.au3> #include <GuiConstantsEx.au3> #include <StaticConstants.au3> #include <WinAPISysWin.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 0) Global Const $AC_SRC_ALPHA = 1 Global Const $ULW_ALPHA = 2 ;~ Load PNG file as GDI bitmap _GDIPlus_Startup() Global $g_sBGImage = "C:\Program Files (x86)\AutoIt3\Examples\GUI\Torus.png" Global $g_hBGImage = _GDIPlus_ImageLoadFromFile($g_sBGImage) ;~ Extract image width and height from PNG Global $g_iWidth = _GDIPlus_ImageGetWidth($g_hBGImage) Global $g_iHeight = _GDIPlus_ImageGetHeight($g_hBGImage) ;~ Create Layered Window Global $g_hMainGui = GUICreate("lod3n launcher", $g_iWidth, $g_iHeight, -1, -1, $WS_POPUP, $WS_EX_LAYERED) SetBitmap($g_hMainGui, $g_hBGImage, 255) ;~ Register Notification Messages GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUISetState() WinSetOnTop($g_hMainGui, "", 1) ;~ Create child MDI Gui window to hold controls Global $g_hControlGui = GUICreate("ControlGUI", $g_iWidth, $g_iHeight + 40, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $g_hMainGui) ;~ The following image just needs to be a solid colour ;~ This allows you to drag the window/image GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\Advanced\Images\Blue.bmp", 0, 0, $g_iWidth, $g_iHeight + 40) GUICtrlCreateLabel("Floating Image", 10, $g_iHeight + 10, $g_iWidth - 20, 20, $SS_CENTER) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor(-1, 0x000000) GUICtrlSetFont(-1, 12, 800) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete($g_hControlGui) ;~ Release Resources _WinAPI_DeleteObject($g_hBGImage) _GDIPlus_Shutdown() ; ==================================================================================================== ; Handle the WM_NCHITTEST for the layered window so it can be dragged by clicking anywhere on the image. ; ==================================================================================================== Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) If ($hWnd = $g_hMainGui) And ($iMsg = $WM_NCHITTEST) Then Return $HTCAPTION EndFunc ;==>WM_NCHITTEST ; ==================================================================================================== ; SetBitMap ; ==================================================================================================== Func SetBitmap($hGUI, $g_hBGImage, $iOpacity) Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($g_hBGImage) $hOld = _WinAPI_SelectObject($hMemDC, $hBitmap) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($g_hBGImage)) DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($g_hBGImage)) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hBitmap) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap
    1 point
  16. #include <File.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <WinAPIGdi.au3> #include <ScreenCapture.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <AutoItConstants.au3> #include <WindowsConstants.au3> Global Const $AC_SRC_ALPHA = 1 Global $GUI, $hGraphic, $hGraphic2, $hImage, $hImageR $GUI = GUICreate('IPMA', 100, 100, 300, 300, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) GUISetBkColor(0xABCDEF) GUISetState(@SW_SHOW, $GUI) _GDIPlus_Startup() _WinAPI_SetLayeredWindowAttributes($GUI, 0xABCDEF, 220) ;0xABCDEF 0xFFFFFF 0x000000 _SetGraphics(0, 0) Sleep(3000) Func _SetGraphics($x, $y) $hImage = _GDIPlus_ImageLoadFromFile(@ScriptDir&'\test.png') $hImageR = _GDIPlus_ImageResize($hImage, 100, 100, $GDIP_INTERPOLATIONMODE_HIGHQUALITYBICUBIC) $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND($GUI) _GDIPlus_GraphicsDrawImageRect($hGraphic2, $hImageR, $x, $y, 75, 75) _GDIPlus_ImageDispose($hImage) _GDIPlus_BitmapDispose($hImageR) _GDIPlus_GraphicsDispose($hGraphic2) EndFunc ;==>_SetGraphics Nevermind the includes it was copy paste.
    1 point
  17. The Scintilla Editor checks after each letter whether a macro or a syntax proposal should be edited. Controlsettext is therefore interrupted after the first letter. Whether this is an error or a feature remains an open question. But surely it does not make sense to replace the code with 'Controlsettext ()'. Here is a small example to illustrate the difference between Send (), Controlsend () and Controlsettext (). $iSleep = 2000 ; change here to change display delay $hWnd = WinWait("[CLASS:SciTEWindow]") Send("{down 50}{up 1}") ; Position cursor to the penultimate line Sleep($iSleep) Send("H") ; See the popup of syntax suggestions Sleep($iSleep) Send("E") ; See the popup of syntax suggestions Sleep($iSleep) Send("L") ; No popup since no matching suggestions Sleep($iSleep) Send("^z") ; undo changes Sleep($iSleep) ControlSend($hWnd, "", "[ID:350]", "^a") ; mark all Sleep($iSleep) ControlSend($hWnd, "", "[ID:350]", "HELP") ; send HELP Sleep($iSleep) ControlSend($hWnd, "", "[ID:350]", "^z") ; undo last input HELP becomes H Sleep($iSleep) ControlSend($hWnd, "", "[ID:350]", "^z") ; undo last input changes H to original code Sleep($iSleep) ControlSetText($hWnd, "", "[ID:350]", "HELP") ; clear edit control and send HELP ; On first charater scitilla interupts and shows H Sleep($iSleep) ControlSend($hWnd, "", "[ID:350]", "^z") ; undo change and restore code ;~ Please do not delete this last line.
    1 point
  18. Subz

    How to read this text in IE

    Or #include <IE.au3> Local $oIE = _IECreate("https://www.rightmove.co.uk/house-prices/detail.html?country=england&locationIdentifier=POSTCODE%5E1603593&searchLocation=SW1V+1AA&year=1&referrer=listChangeCriteria") If IsObj($oIE) Then Local $oDivs = _IETagNameGetCollection($oIE, "div") If IsObj($oDivs) Then For $oDiv In $oDivs If $oDiv.ClassName = "soldAddress" Then MsgBox(4096, "Sold Addresss", $oDiv.InnerText) EndIf Next EndIf EndIf
    1 point
  19. If you set the styles of a control with GUICtrlSetStyle() and happen to forget the styles you set, then why not try GUICtrlGetStyle() To get the Hex value e.g. 00100000 then use this little conversion >> Local $aArray = GUICtrlGetStyle($iLabel) _GUICtrlGetStyle_Convert($aArray) _ArrayDisplay($aArray, 'The Style = 0101 & the ExStyle = 00100000'))Function: #include-once #include <WinAPI.au3> ; #FUNCTION# ==================================================================================================================== ; Name ..........: GUICtrlGetStyle ; Description ...: Retrieves the Styles/ExStyles value(s) of a control. ; Syntax ........: GUICtrlGetStyle($hWnd) ; Parameters ....: $hWnd - Control ID/Handle to the control ; Return values .: $aArray[2] = [Style, ExStyle] ; Author ........: guinness ; Example .......: Yes ; =============================================================================================================================== Func GUICtrlGetStyle($hWnd) If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd) EndIf Local $aReturn = [_WinAPI_GetWindowLong($hWnd, $GWL_STYLE), _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)] Return $aReturn EndFunc ;==>GUICtrlGetStyleExample use of Function: #include <Array.au3> ; Required only for _ArrayDisplay(), but not the UDF! #include <GUIConstantsEx.au3> #include 'GUICtrlGetStyle.au3' Example() Func Example() Local $hGUI = GUICreate('GUICtrlGetStyle() Example', 280, 90) ; This label is using 'magic numbers' instead of the constant variables. It's advisable to use $SS_CENTER & $GUI_WS_EX_PARENTDRAG ; instead of 0x0101 & 0x00100000, but this has been done for proof of concept only. See the second _Array display for more details. Local $iLabel = GUICtrlCreateLabel('This is a Label with $SS_CENTER & $GUI_WS_EX_PARENTDRAG set as the Styles.', 10, 10, 270, 45, 0x0101, 0x00100000) ; $SS_CENTER, $GUI_WS_EX_PARENTDRAG Local $iButton = GUICtrlCreateButton('GetStyle Array', 95, 55, 85, 25) GUISetState(@SW_SHOW, $hGUI) Local $aArray = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iButton $aArray = GUICtrlGetStyle($iLabel) _ArrayDisplay($aArray) GUICtrlDelete($iLabel) GUICtrlCreateLabel('This is a NEW Label with $SS_CENTER & $GUI_WS_EX_PARENTDRAG set as the Styles/ExStyles.', 10, 10, 270, 50, $aArray[0], $aArray[1]) ; This is the reason why 'magic numbers' were used, so as to see they match the same values in GUICtrlCreateLabel. $aArray = GUICtrlGetStyle($iLabel) _GUICtrlGetStyle_Convert($aArray) _ArrayDisplay($aArray, 'The Style = 0x0101 & the ExStyle = 0x00100000') EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func _GUICtrlGetStyle_Convert(ByRef $aArray) If UBound($aArray) = 2 Then $aArray[0] = '0x' & Hex($aArray[0], 4) $aArray[1] = '0x' & Hex($aArray[1], 8) EndIf EndFunc ;==>_GUICtrlGetStyle_Convert
    1 point
  20. boomingranny

    Window Style Tool

    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) EndFunc
    1 point
×
×
  • Create New...