-
Posts
398 -
Joined
-
Last visited
Recent Profile Visitors
556 profile views
dabus's Achievements
Universalist (7/7)
0
Reputation
-
Use Eval and strip the $ from the key of your ini-section. Eval=Return the value of the variable defined by an string. GUICtrlSetTip(Eval($arrTemp[$i][0]),$arrTemp[$i][1]) And your script does not work since $Button1 is a variable and not a fixed string. Since you read out ini-sections as a sting, autoit cannot handle this. With eval, you translate that sting into the current value of the variable, which is the ControlID that is returned by GuiCtrlCreateXYZ here.
-
Hi folks. Haven't been around asking much in the past time since there were no issues or at least none that couldn't be fixed with the help of previous topics, but I didn't find any for this one: Test 1: If I create a listview and use _GUICtrlListView_BeginUpdate, everything is ok. Test 2: If I use a tab, the screen still flickers. Test 3: If I prevent to repaint, the flickering goes away but progress gets lost I mean, sure it does. I just wanted to show that I know that one, but that's not working 100% . I just moved the progress-bar into a child-window in my real project that overlays the window, so there is a workaround and no need to rush anything. But I still thought I post it as something to chew on. (I also tested the beta) So why does the tab cause this problem? And is there a way to keep the window from flickering without moving into a child-window? #include <GuiListView.au3> Test(1) Test(2) Test(3) Func Test($Run) $g_UI=GUICreate('Sample:'&$Run, 200, 200) $g_UI_Interact1=GUICtrlCreateProgress(0, 0, 200, 20) If $Run <> 1 Then GUICtrlCreateTab(10, 10, 180, 180) $tab0 = GUICtrlCreateTabItem("tab0") EndIf $g_UI_Interact2=GUICtrlCreateListView('1|2|3|4', 10, 20, 180, 180) $g_UI_Handle=GUICtrlGetHandle($g_UI_Interact2) If $Run <> 1 Then GUICtrlCreateTabItem("") GUISetState() Sleep(2000) _GUICtrlListView_BeginUpdate($g_UI_Handle) If $Run=3 Then GUISetState(@SW_LOCK) For $s=1 to 3000 GUICtrlSetData($g_UI_Interact1, $s*100/3000); set the progress GUICtrlCreateListViewItem('1|2|3|4', $g_UI_Interact2) Next If $Run=3 Then GUISetState(@SW_UnLOCK) _GUICtrlListView_EndUpdate($g_UI_Handle) Sleep(2000) GUIDelete($g_UI) EndFunc
-
Hey, the guru is here. Ok, just used the option on $hRequest and it worked. Damn.
-
Uh, yes, it's not a support forum. But I'll post my question here hoping someone can give me a helping hand. The tcp-solution gives me more info then the one using winhttp. What parameters should I set to get these? It seems im blindfolded. Edit: Uh, the 302 output is a redirect, so I need to enable that... Maybe you can tell me how I should adjust the call. So, here is the code: ; ========================================== ; TCP-solution (done by MrCreatoR) ; ========================================== Global $g_HTTPUserAgent = 'AutoIt3/'&@AutoItVersion, $g_Limit_TimeOut = 5000 Global $g_HTTP_TCP_Def_Port = 80, $g_HTTP_TCP_Port = $g_HTTP_TCP_Def_Port, $g_LAST_SOCKET = -1 $Site = 'kerzenburg.baldurs-gate.eu' $Page = 'downloads.php?do=downloadlatest&id=3' MsgBox ( 0, 'Header', __HTTPGetResponse($Site, '/'&$Page, "HEAD")) Func __HTTPClose($Socket = -1) TCPCloseSocket($Socket) TCPShutdown() Return 1 EndFunc ;==>__HTTPClose Func __HTTPConnect($Host) TCPStartup() Local $Name_To_IP = TCPNameToIP($Host) Local $Socket = TCPConnect($Name_To_IP, $g_HTTP_TCP_Port) If $Socket = -1 Then TCPCloseSocket($Socket) Return SetError(1, 0, "") EndIf $g_LAST_SOCKET = $Socket Return $Socket EndFunc ;==>__HTTPConnect Func __HTTPGet($Host, $Page, $Socket, $sRequest = "GET", $sReferrer = "") Local $Command = $sRequest & " " & $Page & " HTTP/1.1" & @CRLF $Command &= "Host: " & $Host & @CRLF $Command &= "User-Agent: " & $g_HTTPUserAgent & @CRLF $Command &= "Referer: " & $sReferrer & @CRLF $Command &= "Connection: close" & @CRLF & @CRLF Local $BytesSent = TCPSend($Socket, $Command) If $BytesSent = 0 Then Return SetError(1, @error, 0) Return $BytesSent EndFunc ;==>__HTTPGet Func __HTTPGetResponse($Host, $Page, $sRequest = "GET", $sReferrer = "") Local $Socket = __HTTPConnect($Host) If @error Then Return SetError(1, 0, "") __HTTPGet($Host, $Page, $Socket, $sRequest, $sReferrer) If @error Then __HTTPClose($Socket) Return SetError(2, 0, "") EndIf Local $Recv = "", $CurrentRecv Local $iTimer = TimerInit() While 1 $CurrentRecv = TCPRecv($Socket, 100) If @error <> 0 Then ExitLoop If $CurrentRecv <> "" Then $Recv &= $CurrentRecv If TimerDiff($iTimer) >= $g_Limit_TimeOut Then $g_Limit_TimeOutOver = True ExitLoop EndIf WEnd __HTTPClose($Socket) Return $Recv EndFunc ;==>__HTTPGetResponse ; ========================================== ; WinHTTP-solution (done by trancexx) ; ========================================== #include 'winhttp.au3' $Site = 'kerzenburg.baldurs-gate.eu' $Page = 'downloads.php?do=downloadlatest&id=3' $hOpen = _WinHttpOpen() _WinHttpSetOption($hOpen, $WINHTTP_OPTION_ENABLE_FEATURE, $WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS) $hConnect = _WinHttpConnect($hOpen, $Site) $hRequest = _WinHttpOpenRequest($hConnect, "GET", $Page) _WinHttpSendRequest($hRequest) _WinHttpReceiveResponse($hRequest) If _WinHttpQueryDataAvailable($hRequest) Then MsgBox(0, 'Header', _WinHttpQueryHeaders($hRequest)) _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen)
-
I first have to say that I really like the udf and use it in one project. It uses different colored boxes for different types of information. So I just thought I'd add a few own images. My mac-like checkboxes are these: At first, it was successful. I used SetItemState($hWnd, $hItem, $nState) with $nState = image-number. But after adding 4 colored groups of 3 new images, the next one just starts from the beginning. So my pink and ongoing images are not used. Example: If you edit the udf, line 99-101, it should show the pink images... but it does not. Replace 14 with 11 and you see yellow boxes. (I know that this is not good, just for a quick "proof".) SetItemState($hWnd, $hItem, $nState+14) CheckChildItems($hWnd, $hItem, $nState+14) CheckParents($hWnd, $hItem, $nState+14) I tried change the grow-parameter, but it had no visible effect. So, is there a limit, or am I wrong? Is it my fault? Do I need to tweak something? I really would like to add these. Edit: Reduced them, but I'm curious what would be the cause. Edit: Ok, a friendly guy found it. So I really hit a limit here.
-
Is it possible to reset OnEvent Mode...
dabus replied to dabus's topic in AutoIt GUI Help and Support
Ah, ok, I get it. You "shorten" the functions to setting variables and use them to call the real (bigger) ones. Although this "stretches" the code a little bit compared to a simple GuiGetMsg-Loop. Hmm, I think I'll give it a try, if it's not working, I'll switch back to loops again. Thanks for your support. Edit: After some thinking, I edited your example to ; mainloop While 1 Sleep(1000) If $ExecuteNow <> '' Then Call($ExecuteNow) WEnd ; trigger Func Stop() If $ExecuteNow = '' Then $ExecuteNow = 'RealStop' EndFunc ;==>Stop ; real called function Func RealStop() $ExecuteNow='' While $Keep = 0 Sleep(10) WEnd EndFunc ;==>RealStop I think that's a good solution that I will use for my script. -
Is it possible to reset OnEvent Mode...
dabus replied to dabus's topic in AutoIt GUI Help and Support
Could you give an example? Here's what I mean. This does not work, since the continue-button does not responde: AutoItSetOption('GUIOnEventMode', 1) Global $Keep=1 GUICreate('sample', 200, 100) $Open=GUICtrlCreateButton('Stop', 10, 10, 100, 20) GUICtrlSetOnEvent(-1, 'Stop') $Close=GUICtrlCreateButton('Continue', 10, 50, 100, 20) GUICtrlSetOnEvent(-1, 'Continue') GUISetState() while 1 Sleep(1000) ConsoleWrite($Keep & @CRLF) WEnd Func Stop() While $Keep Sleep(10) WEnd EndFunc Func Continue() $Keep = 0 EndFuncoÝ÷ Ù8b±Ú³ +»¶¶ßÛ,Â+)àmëpyéíè.Ê'qêm³ù¨uëºÚ"µÍ]]Ò]Ù]Ü[Û ÌÎNÑÕRSÛ][[ÙIÌÎNËJBÛØ[ ÌÍÒÙYLBÕRPÜX]J ÌÎNÜØ[IÌÎNËL BÌÍÓÜ[QÕRPÝÜX]P]Û ÌÎNÔÝÜ ÌÎNËLLL BÕRPÝÙ]Û][ LK ÌÎNÔÝÜ ÌÎNÊBÌÍÐÛÜÙOQÕRPÝÜX]P]Û ÌÎNÐÛÛ[YIÌÎNËL LL BÕRPÝÙ]Û][ LK ÌÎNÐÛÛ[YIÌÎNÊBÕRTÙ]Ý]J BÚ[HBTÛY L BPÛÛÛÛUÜ]J ÌÍÒÙY [ÈÔBÑ[B[ÈÝÜ BP]]Ò]Ù]Ü[Û ÌÎNÑÕRSÛ][[ÙIÌÎNË BUÚ[H ÌÍÒÙYBIÌÍÓÙÏQÕRQÙ]ÙÊ BBRY ÌÍÓÙÈH ÌÍÐÛÜÙH[ ÌÍÒÙYHBTÛY L BUÑ[B[[ÂB[ÈÛÛ[YJ BIÌÍÒÙYH[[ -
Hi there, I must admit that I did not use OnEvent mode that much. I obviously use it in a script that does something to catch events during that time. Since I thought I might switch everything to OnEvent, I was in the process of changing the whole script, adding new tabs, changing here and there and stumbled about the fact that new events are "ignored" until a function that was triggered by another event is done. Because I need to keep the OnEvent on the "doing something"-part, I wonder if it would be possible to reset the OnEvent-Mode so that it is free/available for new events... I tried to switch it off and on again, but that did not work. Best regards dabus
-
How to get a ControlID from a treeviewitems HWND?
dabus replied to dabus's topic in AutoIt GUI Help and Support
smashly: That's exactly what I was searching for. rasim: If you look at my example, you can see that I want to display a hint that is diffrent from the text. So I put these stuff into an array. Since the ControlID is a number, the corresponding values are found directly without a search. I currently store 12 values in this array. I don't want them to be displayed in the text of the TreeViewItem, but I need them for popups and other purposes later. So basicly, I just use the ID to find the items text, setup, type, ... to this item. KaFu: This does not seem to work on TreeViewItems. Thank you all for your time you spend to help me. -
How to get a ControlID from a treeviewitems HWND?
dabus replied to dabus's topic in AutoIt GUI Help and Support
I don't create them with _GUICtrlTreeView_* but with internal functions. ; creation $trees[$s][0] = GUICtrlCreateTreeViewItem($Setup[$s][1], $streeview) ; putting stuff into an array $MsgTrans[$trees[$s][0]][0] = $Setup[$s][0]; current setup $MsgTrans[$trees[$s][0]][1] = $TAG; tag $MsgTrans[$trees[$s][0]][2] = '-'; tag as no component ;... and so on ; later I get a click and I know what's going on $sMsg=GuiReadMsg() ConsoleWrite('Setup ' & $MsgTrans[$sMsg][0] & ' was seleced' & @CRLF) So there is a direct connection between the ControlID and the related informations in the $MsgTrans array. If I hover over an item, I currently only know a way to get the handle. That's why I store HWNDs in MsgTrans and loop through to find the information. If it would be possible to convert them, the app would run faster since no search was needed. Well in this case, getting the ControlID somehow would be enough. -
Yeah, this sounds a little strange. The reason is that I am creating a bigger script. The main area consists of a treeview. Some items have additional informations. These are stored in an array that is build at the startup of the application. It looks like this: ID Text Info HWND 1...A................0x1234 2...B................0x1235 3...C...... FOO...0x1236 So when I am above the the first two items, nothing happens. When I am above the third treeviewitem, it is selected and a popup shows FOO. I currently do this by an idea that Siao came up with: Func _TreeItemFromPoint($a) Local $tMPos = _WinAPI_GetMousePos(True, $a) Return _GUICtrlTreeView_HitTestItem($a, DllStructGetData($tMPos, 1), DllStructGetData($tMPos, 2)) EndFunc ;==>_TreeItemFromPoint This gives me the handle. To get the info, I loop through the stored HWNDs in the array. If Info is not "" then the popup appears. This works,but I would like to know if there is a better way to do this. (I'm sure there is ) I only want to switch the selection when a new info is shown to have a hint/connection that this info belongs to the selected/focused item. So Focusing and doing GUICtrlRead on the treeview is out. Any thoughts? Thx in advance.
-
I just managed to do it by myself. All I needed to do was to use another global var and I'm set. .. If $WinResized Then $WinResized=False $Pos = WinGetPos($sGui) If $Pos[2]< 750 Then _GuiMove($sGui, "", $Pos[0], $Pos[1], 750, $Pos[3]) EndIf Func _GuiMove($a, $b, $c, $d, $e, $f) WinMove($a, $b, $c, $d, $e, $f) $WinResized = True EndFunc Func _WM_ON_SIZE() ConsoleWrite('-'&$WinResized&@CRLF) $WinResized=True Return $GUI_RUNDEFMSG EndFunc -- Edit -- @Zedna: Thank you. That's much better.
-
Hi there, I got a similar problem: In the main part of the script, I place some pics on the GUI to have a light theme. This works as expected. After some thoughts, I got rid of the fixed windowsize and use GuiCtrlSetResize to move the pics as desired. Cool and slick. I also wanted to avoid my gui to be to small or too big. So I used the great example Siao gave and added some WinMove-functions. This works for itself, but the movement seems not to be recogniced by GuiCtrlSetResize. Is it possible to give GuiCtrlSetResize a signal to start updating the theme? Or will I have to have a list of pics and move them around "manually"? Any ideas? .. GuiCreate('Bla', 200, 200) GuiCtrlCreatePic('SomePic.bmp', 180, 0, 20, 20, $WS_DISABLED); upper right corner GUICtrlSetResizing(-1, 4+32+256+512) .. .. Func _WM_ON_SIZE() $Pos = WinGetPos($sGui) If $Pos[2]< 750 Then WinMove($sGui, "", $Pos[0], $Pos[1], 750, $Pos[3]) If $ExtGui And $Pos[3]< 450 Then WinMove($sGui, "", $Pos[0], $Pos[1], $Pos[2], 450) If Not $ExtGui And $Pos[3]< 175 Then WinMove($sGui, "", $Pos[0], $Pos[1], $Pos[2], 175) If $Pos[2]> 1600 Then WinMove($sGui, "", $Pos[0], $Pos[1], 1600, $Pos[3]) If $Pos[3]> 1200 Then WinMove($sGui, "", $Pos[0], $Pos[1], $Pos[2], 1200) Return $GUI_RUNDEFMSG EndFunc
-
STDOutRead / Logging: Missing some stuff occasionally
dabus replied to dabus's topic in AutoIt General Help and Support
Thank you. -
STDOutRead / Logging: Missing some stuff occasionally
dabus replied to dabus's topic in AutoIt General Help and Support
Bump. Nobody with simillar problems?!?