-
Posts
680 -
Joined
-
Last visited
Everything posted by PartyPooper
-
Getting program version from a webpage
PartyPooper replied to PartyPooper's topic in AutoIt General Help and Support
Thanks Sahsanu, I wouldn't have believed it could be done in 4 lines -
Getting program version from a webpage
PartyPooper posted a topic in AutoIt General Help and Support
Is it possible to extract the version number from the following webpage? http://forum.rustoxide.com/resources/rustrcon-admin-tool-32-bit.434/ What I'm looking for is a way to consistently extract the version string (currently '2014.3.7.3762'). Sorry, I can't provide a function example because I have no idea on where to begin having never interacted with styled webpages before. I haven't been able to find a UDF in the Help file that finds a particular line in a webpage (at least not yet). I was thinking about putting the entire page into an array after removing all whitespace and simply searching for the array index that contains <h1>RustRCON Admin Tool (32 bit) <span class="muted">, however, I don't know if this is the right (or even correct) method to use. Pointers would be appreciated. -
StringSize - M23 - BugFix version 27 Dec 23
PartyPooper replied to Melba23's topic in AutoIt Example Scripts
Melba23, I have a resizable gui with an edit control inserted into a tab (it's for displaying chat which may go over several lines depending on how wide the GUI is at the time). I was wondering if your stringsize UDF could be used to help me format the chat into columns. Essentially, this is what I am looking for (picture tabs in place of spaces): Time Username Line of chat Time Longer Username Line of chat that user types continuation of line of chat even more chat. Time Username Another line of chat Currently, I have the above working in my edit but the chat is formatted for one particular width of edit box. Unfortunately, if a user resizes the gui, the chat width doesn't change and it begins to look stupid. I was hoping your stringsize UDF would give me an idea as to how many words I could fit on the rest of the line. P.S. forgot to mention, edit box has a vertical scroll bar so I need to account for that as well P.P.S. thought about using _GUICtrlRichEdit which allows coloring and formatting but it doesn't resize in a tab properly using GUICtrlSetResizing Nevermind, going to use RichEdit as I found an easy way to resize the richedit without a lot of maths (it's surrounded by a group control so I will base resize off that). -
GUICtrlRichEdit in Tab control
PartyPooper replied to xtrim's topic in AutoIt General Help and Support
Nevermind, wrong command... should be ControlHide/ControlShow rather than GUISetState. -
GUICtrlRichEdit in Tab control
PartyPooper replied to xtrim's topic in AutoIt General Help and Support
I borrowed the example above and can't seem to understand why is this not working as it should. I followed the instructions in the wiki in regards to hiding UDF controls when used on an internal Tab, but it still bleeds through. #include <GUIConstantsEx.au3> #include <GuiRichEdit.au3> #include <GuiTab.au3> #include <WindowsConstants.au3> #include <GuiStatusBar.au3> #include <GuiEdit.au3> #include <misc.au3> #include <GuiRichEdit.au3> Opt('MustDeclareVars', 1) Example() Func Example() Global $tab, $tab0, $tab0OK, $tab0input Global $tab1, $tab1combo, $tab1OK Global $tab2, $tab2OK, $msg Global $hRichEdit, $hGui $hGui = GUICreate("My GUI Tab", 250, 150); will create a dialog box that when displayed is centered GUISetBkColor(0x00E0FFFF) GUISetFont(9, 300) $tab = GUICtrlCreateTab(10, 10, 200, 100) $tab0 = GUICtrlCreateTabItem("tab0") ; GUICtrlCreateLabel("label0", 30, 80, 50, 20) ; $tab0OK = GUICtrlCreateButton("OK0", 20, 50, 50, 20) ; $tab0input = GUICtrlCreateInput("default", 80, 50, 70, 20) $hRichEdit = _GUICtrlRichEdit_Create($hGui, "ss", 80, 50, 70, 20, BitOR($ES_MULTILINE, $WS_VSCROLL)) $tab1 = GUICtrlCreateTabItem("tab----1") GUICtrlCreateLabel("label1", 30, 80, 50, 20) $tab1combo = GUICtrlCreateCombo("", 20, 50, 60, 120) GUICtrlSetData(-1, "Trids|CyberSlug|Larry|Jon|Tylo", "Jon"); default Jon $tab1OK = GUICtrlCreateButton("OK1", 80, 50, 50, 20) $tab2 = GUICtrlCreateTabItem("tab2") GUICtrlSetState(-1, $GUI_SHOW); will be display first GUICtrlCreateLabel("labeqqqql2", 30, 80, 50, 20) $tab2OK = GUICtrlCreateButton("OK2", 140, 50, 50) GUICtrlCreateTabItem(""); end tabitem definition GUICtrlCreateLabel("Click on tab and see the title", 20, 130, 250, 20) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $tab Then ; display the clicked tab WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab)) If _GUICtrlTab_GetCurSel($tab) = 0 Then GUISetState(@SW_SHOW, $hRichEdit) Else GUISetState(@SW_HIDE, $hRichEdit) EndIf EndIf WEnd EndFunc ;==>Example _GUICtrlRichEdit_Destroy($hRichEdit) -
Covering End Tab on resizing GUI
PartyPooper replied to PartyPooper's topic in AutoIt GUI Help and Support
Thanks AZJIO, you da man :-) I spent hours on this yesterday and got nowhere. I see you have adjusted Opt('GUIResizeMode', 802). The help file is a little vague on this, can you please explain how you arrived at the number 802? -
Covering End Tab on resizing GUI
PartyPooper replied to PartyPooper's topic in AutoIt GUI Help and Support
Doesn't work unfortunately. The red bar locks to end of last tab item, but doesn't resize when I pull edges of gui. -
Can anyone get this red label to position itself correctly on resizing the GUI? #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <GuiTab.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Opt('GUIResizeMode', 1) ; see GUICtrlSetResizing ;GUIRegisterMsg($WM_SIZE, '_WM_RESIZE') ;GUIRegisterMsg($WM_SIZING, '_WM_RESIZE') Global $hTab Global $hCoverLabel Example() Func Example() Local $aRect, $sRect, $hTab ; Create GUI GUICreate("Tab Control Get Display Rect", 400, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU + $WS_MINIMIZEBOX + $WS_MAXIMIZEBOX + $WS_CAPTION + $WS_POPUP) $hTab = GUICtrlCreateTab(10, 10, 380, 280) GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUISetState(@SW_SHOW) ; Add tabs GUICtrlCreateTabItem("Tab 0") GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlCreateTabItem("") GUICtrlCreateTabItem("Tab 1") GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlCreateTabItem("") GUICtrlCreateTabItem("Tab 2") GUICtrlSetResizing(-1, $GUI_DOCKAUTO) GUICtrlCreateTabItem("") ; Get empty tab display rectangle Local $aRect1 = _GUICtrlTab_GetItemRect($hTab, 2); xul, yul, xlr, ylr Local $aRect2 = _GUICtrlTab_GetDisplayRect(GUICtrlGetHandle($hTab)); xul, yul, xlr, ylr ;_ArrayDisplay($aRect1) ;_ArrayDisplay($aRect2) $hCoverLabel = GUICtrlCreateLabel('', $aRect1[2] + 10, 10, ($aRect2[0] + $aRect2[2]) - $aRect1[2], $aRect2[1]) GUICtrlSetBkColor(-1, '0x00ff0000') ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Func _WM_RESIZE($hWnd, $iMsg, $iwParam, $ilParam) ; resizes control when interface resizing Local $aRect1 = _GUICtrlTab_GetItemRect($hTab, 2) Local $aRect2 = _GUICtrlTab_GetDisplayRect(GUICtrlGetHandle($hTab)) GUICtrlSetPos($hCoverLabel, $aRect1[2] + 10, 10, ($aRect2[0] + $aRect2[2]) - $aRect1[2], $aRect2[1]) GUICtrlSetBkColor(-1, 0x00ff0000) Return EndFunc ;==>_WM_RESIZE
-
Thanks BrewManNH but that's not what I'm after. Perhaps, I should have been a little clearer - my bad. I'm aware I can use Switch and Case or GUICtrlSetOnEvent and trap it that way, however, what I'm after is a means to detect the checkbox handle rather than its text using GUIRegisterMsg and the WM_COMMAND. The method I have outlined above works but only if each checkbox has a different text. Currently, I'm trying to find a means of retrieving the unique handle assigned to each control so I don't run into an error situation. It's a learning thing.
- 5 replies
-
- $WM_COMMAND
- checkbox
-
(and 1 more)
Tagged with:
-
Thanks Melba, but I use the OnEvent method for my programming, hence, the need for the WM_COMMAND.
- 5 replies
-
- $WM_COMMAND
- checkbox
-
(and 1 more)
Tagged with:
-
Is there an easier (proper) way of detecting a change in the state of a checkbox other than comparing the checkbox text like I have done below? Is there a way of using and comparing the checkbox handle rather than its text? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Gui = GUICreate("WM_COMMAND", 390, 220) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 10, 40, 90, 17) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 10, 60, 90, 17) GUISetState() GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Do Until GUIGetMsg() = -3 Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $nID = BitAND($wParam, 0x0000FFFF) ; _WinAPI_LoWord Local $nNotifyCode = BitShift($wParam, 16) ; _WinAPI_HiWord If GUICtrlRead($nID, 1) = "Checkbox1" Then MsgBox(0, '', 'Checkbox1 has been modified') ; do some non-blocking code here If GUICtrlRead($nID, 1) = "Checkbox2" Then MsgBox(0, '', 'Checkbox2 has been modified') ; do some non-blocking code here Return $GUI_RUNDEFMSG EndFunc
- 5 replies
-
- $WM_COMMAND
- checkbox
-
(and 1 more)
Tagged with:
-
GUISetOnEvent - why isn't this valid?
PartyPooper replied to PartyPooper's topic in AutoIt GUI Help and Support
Ahh cool, thanks Melba I missed that. It's amazing what a difference slight bolding has on meaning lol -
Just curious, but can someone tell me why this isn't a valid instruction in AutoIt: GUISetOnEvent($GUI_EVENT_CLOSE, Exit) GUICtrlSetOnEvent($hMYBUTTON, Exit) I know they don't work but Exit is a natural AutoIt keyword (internal function), so why shouldn't it work?
-
I was wondering if there was a simple way to increment an array using addition assignment (ie. +=) I know you can use $aArray[$n + 1] but how do I go about using $aArray[$n += 1] without throwing an error? Essentially, I want something like this: $aArray[$n += 1] = "Item 1" $aArray[$n += 1] = "Item 2" $aArray[$n += 1] = "Item 3" ... I guess I could have: $n += 1 $aArray[$n] = "Item 1" $n += 1 $aArray[$n] = "Item 2" $n += 1 $aArray[$n] = "Item 3" ... but that's a little long-winded so I'm wondering if there's some quicker/easier method.
-
ListView without ScrollBar ?
PartyPooper replied to piterek's topic in AutoIt General Help and Support
This seemed to work for me when I wanted to disable the scroll bars for a listview: #include <TreeviewConstants.au3> ... GUICtrlCreateListView("Header", 10, 10, 125, 307, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_NOSORTHEADER, $TVS_NOSCROLL)) -
This is just a quick and nasty proof of concept that I experimented with but unfortunately I haven't really got time to improve so feel free to post up changes. The SplashTextOn options should all work as well (ie. 1 = Thin bordered titleless window etc) and using a while loop gives you flashing text (albeit not exactly regular). That said, it's probably just simpler to create your own GUI. In any case, thought I'd share so those who want to experiment can. #include <WinAPI.au3> #include <WindowsConstants.au3> #include <FontConstants.au3> Global $tRECT, $hFont, $hOldFont, $hDC HotKeySet("{ESC}", "_Exit") $tRECT = DllStructCreate($tagRect) DllStructSetData($tRECT, "Left", -20) DllStructSetData($tRECT, "Top", 0) $iWidth = DllStructSetData($tRECT, "Right", 250) $iHeight = DllStructSetData($tRECT, "Bottom", 50) $sTitle = "AutoIt" $sText = " IT WORKS! " $hDC = _WinAPI_GetDC(SplashTextOn($sTitle,"", $iWidth-20, $iHeight, -1, -1, 16)) $hFont = _WinAPI_CreateFont(50, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _ $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial') $hOldFont = _WinAPI_SelectObject($hDC, $hFont) _WinAPI_SetTextColor($hDC, 0x0000FF) _WinAPI_SetBkColor($hDC, 0x000000) ; comment next line to get black background instead of transparent one ;_WinAPI_SetBkMode($hDC, $TRANSPARENT) ; comment next line and uncomment the one in the while loop to get flashing text (must use a background color to work) _WinAPI_DrawText($hDC, $sText, $tRECT, $DT_CENTER) While 1 ;_WinAPI_DrawText($hDC, $sText, $tRECT, $DT_CENTER) Sleep(500) WEnd Func _Exit() _WinAPI_SelectObject($hDC, $hOldFont) _WinAPI_DeleteObject($hFont) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_InvalidateRect(0, 0) $tRECT = 0 Exit EndFunc ;==>_Exit
-
slider bk color on a tab control (solved)
PartyPooper replied to lasaucisse's topic in AutoIt GUI Help and Support
Yes, that works as it should, thanks. -
slider bk color on a tab control (solved)
PartyPooper replied to lasaucisse's topic in AutoIt GUI Help and Support
Seems to have a little problem when using $WS_EX_CLIENTEDGE with listviews.... Just un-comment the GUICtrlCreateListView line in the for loop to see what I mean. Using $WS_EX_CLIENTEDGE seems to hide the listview until it is clicked on. Not sure if this is a bug or a feature #include <GuiConstantsEx.au3> #include <GuiTab.au3> #include <StaticConstants.au3> #include <GuiListView.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> ; Tab colours Global $aTabColours[4] = [0xFFC0C0, 0xC0FFC0, 0xC0C0FF, 0xC0C0C0] ; Create GUI Global $hGUI = GUICreate ("Test", 400,300) GUISetBkColor (0) ; Create label to cover Tab "tab" Global $hColourTab = GUICtrlCreateLabel("", 0, 0, 1, 1, BitOR($SS_NOTIFY, $SS_CENTER, $SS_SUNKEN)) ; Create tab Global $hTab = GUICtrlCreateTab(5, 5,390, 290) Global $hTab_Handle = GUICtrlGetHandle($hTab) ; Create Tab items and colour them For $i = 0 To 3 GUICtrlCreateTabItem ("Tab item - " & $i) _GUICtrlTab_SetBkColor($hGUI, $hTab, $aTabColours[$i]) ; add listview GUICtrlCreateListView("Col1¦Col2", 20, 50, 200, 200, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_NOSORTHEADER)) ; this works fine ;GUICtrlCreateListView("Col1¦Col2", 20, 50, 200, 200, BitOR($LVS_REPORT, $LVS_SINGLESEL, $LVS_NOSORTHEADER), $WS_EX_CLIENTEDGE) ; this doesn't GUICtrlCreateListViewItem("item2¦item2", -1) GUICtrlSetBkColor(-1, $aTabColours[$i]) Next GUICtrlCreateTabItem ("") _GUICtrlTab_SetCurSel($hTab_Handle,0) _GUICtrlTab_SetCurFocus($hTab_Handle,0) TabEvent() GUISetState () While 1 Switch GUIGetMsg () Case $GUI_EVENT_CLOSE Exit Case $hTab TabEvent() EndSwitch WEnd Func TabEvent() ; Set values Local $iTab_X = 5, $iTab_Y = 5, $iTab_Margin = 1 ; Get index of current tab Local $iTab_Index = GUICtrlRead($hTab) ; Get coordinates of TabItem Local $aTab_Coord = _GUICtrlTab_GetItemRect($hTab_Handle, $iTab_Index) ; Get text of TabItem Local $sTab_Text = _GUICtrlTab_GetItemText($hTab_Handle, $iTab_Index) ; Place label GUICtrlSetPos($hColourTab, $iTab_X + $aTab_Coord[0] + $iTab_Margin, $iTab_Y + $aTab_Coord[1] + $iTab_Margin + 1, $aTab_Coord[2] - $aTab_Coord[0] - ($iTab_Margin * 2), $aTab_Coord[3] - $aTab_Coord[1] - ($iTab_Margin * 2) + 5) ; Set text GUICtrlSetData($hColourTab, $sTab_Text) ; Set colour GUICtrlsetBkColor ($hColourTab,$aTabColours[$iTab_Index] ) ; Set focus _GUICtrlTab_SetCurFocus($hTab_Handle,$iTab_Index) EndFunc Func _GUICtrlTab_SetBkColor($hWnd, $hSysTab32, $sBkColor) ; Get Tab position Local $aTabPos = ControlGetPos($hWnd, "", $hSysTab32) ; Get size of user area Local $aTab_Rect = _GUICtrlTab_GetItemRect($hSysTab32, -1) ; Create label GUICtrlCreateLabel("", $aTabPos[0] + 2, $aTabPos[1] + $aTab_Rect[3] + 4, $aTabPos[2] - 6, $aTabPos[3] - $aTab_Rect[3] - 7) ; colour label GUICtrlSetBkColor(-1, $sBkColor) ; Disable label GUICtrlSetState(-1, $GUI_DISABLE) EndFunc ;==>_GUICtrlTab_SetBkColor -
How do I use #AutoIt3Wrapper_Res_File_Add=
PartyPooper replied to PartyPooper's topic in AutoIt GUI Help and Support
Thanks Zedna, I'll check them out. -
How do I use #AutoIt3Wrapper_Res_File_Add=
PartyPooper posted a topic in AutoIt GUI Help and Support
As the topic title states, how do I use #AutoIt3Wrapper_Res_File_Add= to include an image in my compiled exe and display it using the GUICtrlCreatePic keyword? I don't wish to use FileInstall() because I don't want to have to install the JPG picture on the users disk, nor do I wish to be forced to include Zedna's complicated resource.au3 for something as simple as displaying a JPG on a GUI. I was hoping it would be as simple as the following but it didn't work: #AutoIt3Wrapper_Res_File_Add=..\Pictures\myfantastic.jpg ... GUICtrlCreatePic("", 10, 30) GUICtrlSetImage(-1, @ScriptFullPath, "myfantastic.jpg") -
Annoying Mouseclick and mousemove
PartyPooper replied to Coldfuzz's topic in AutoIt General Help and Support
That's a steaming pile of .... just ask the multitude of WOW boyz who used to write automated keyclick macros to collect gold so they didn't have to be at the computer all the time. What they were doing is exactly what you're asking for - creating an automated keyclick game bot. ALL online games protected by VAC or Punkbuster consider "macro'ing" as cheating and ban/kick for it. -
Unfortunately, since almost all Windows users are able to CTRL-ALT-DEL and kill processes, it would be a PITA to write an un-killable script without turning it into a rootkit type of program, however, you could easily write a hidden script that automatically restarts your keymapping script and alerts the Admin whenever a user deliberately kills it. At least then you would: 1). know who's doing it, and 2). identify those you need to keep an eye on