Jump to content

AMSPeople

Active Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by AMSPeople

  1. Actions: ConsoleWrite(WinGetPos(ControlGetHandle($hGUI, "", $idCatalog))[2] & @CRLF) ConsoleWrite(ControlGetPos($hGUI, '', $idCatalog)[2] & @CRLF) do not get the correct width of idCatalogobject when I maximized the GUI. #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> $hGUI = GUICreate('---', 950, 765, Default, Default, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) $idCatalog = GUICtrlCreateListView("Code|Name|Mnf|Price", 210, 40, 720, 353) GUICtrlSetResizing(-1, 102) _GUICtrlListView_SetColumnWidth($idCatalog, 0, 50) _GUICtrlListView_SetColumnWidth($idCatalog, 1, 495) _GUICtrlListView_SetColumnWidth($idCatalog, 2, 100) _GUICtrlListView_SetColumnWidth($idCatalog, 3, 70) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") ; Monitors resizing of the GUI While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) ; used to limit the minimum size of the GUI #forceref $hWnd, $Msg, $wParam, $lParam If $hWnd = $hGUI Then Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, 964) ; min width DllStructSetData($tagMaxinfo, 8, 800) ; min height ConsoleWrite(WinGetPos(ControlGetHandle($hGUI, "", $idCatalog))[2] & @CRLF) ConsoleWrite(ControlGetPos($hGUI, '', $idCatalog)[2] & @CRLF) _GUICtrlListView_SetColumnWidth($idCatalog, 1, ControlGetPos($hGUI, '', $idCatalog)[2] - 230) Return $GUI_RUNDEFMSG EndIf EndFunc ;==>_WM_GETMINMAXINFO Func MY_WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) _GUICtrlListView_SetColumnWidth($idCatalog, 1, ControlGetPos($hGUI, '', $idCatalog)[2] - 230) Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_SIZE
  2. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> #include <GUICtrlOnHover.au3> #include <WinAPI.au3> #include <GuiListView.au3> #Region ### START Koda GUI section ### Form=c:\users\user\desktop\Автоключ\form1.kxf $hGUI = GUICreate('Электронный заказ. ООО "ИК Автоключ"', 950, 765, Default, Default, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) $idUpdatePrice = GUICtrlCreateLabel("Обновить прайс", 830, 5, 100, Default, $SS_RIGHT) GUICtrlSetFont(-1, Default) _GUICtrl_OnHoverRegister(-1, "_Style_1", "_Style_1_1") GUICtrlSetResizing(-1, 4 + 768) $idTab = GUICtrlCreateTab(10, 10, 930, 700) GUICtrlSetResizing(-1, 102) GUICtrlCreateTabItem("Каталог товаров") GUICtrlCreateLabel('', 20, 40, 180, 180, $SS_BLACKRECT) GUICtrlSetResizing(-1, 802) GUICtrlCreateLabel("Сумма заказа:", 20, 235, 180, Default, $SS_CENTER) GUICtrlSetFont(-1, 10, 700, 0, "Verdana") GUICtrlSetResizing(-1, 802) $idTotal = GUICtrlCreateLabel("250000.00 руб.", 20, 255, 180, Default, $SS_CENTER) GUICtrlSetFont(-1, 14, 700, 0, "Verdana") GUICtrlSetColor(-1, $COLOR_GREEN) GUICtrlSetResizing(-1, 802) $idSaveOrder = GUICtrlCreateLabel("Сохранить заказ", 20, 290, 180, Default, $SS_RIGHT) GUICtrlSetFont(-1, Default) _GUICtrl_OnHoverRegister(-1, "_Style_2", "_Style_2_1") GUICtrlSetResizing(-1, 802) GUICtrlCreateLabel("Фильтр по наименованию / коду:", 20, 350, 180) GUICtrlSetResizing(-1, 768 + 64 + 2) $idSearchText = GUICtrlCreateInput("", 20, 370, 155, 23) GUICtrlSetResizing(-1, 768 + 64 + 2) $idSearchGo = GUICtrlCreateButton("Х", 180, 370, 23, 23) GUICtrlSetResizing(-1, 768 + 64 + 2) $idCatalog = GUICtrlCreateListView("Код|Наименование товара|Производитель|Цена", 210, 40, 720, 353) GUICtrlSetResizing(-1, 102) _GUICtrlListView_SetColumnWidth($idCatalog, 0, 50) _GUICtrlListView_SetColumnWidth($idCatalog, 1, 495) _GUICtrlListView_SetColumnWidth($idCatalog, 2, 100) _GUICtrlListView_SetColumnWidth($idCatalog, 3, 70) $idOrder = GUICtrlCreateListView("", 20, 400, 910, 300) GUICtrlSetResizing(-1, 576 + 2 + 4) $idStatusbar = _GUICtrlStatusBar_Create($hGUI) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) $tRect = _WinAPI_GetWindowRect($hGUI) ;MsgBox(0,'',DllStructGetData($tRect, "Right")-DllStructGetData($tRect, "Left")) GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") ; Monitors resizing of the GUI While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Style_1() ;GUICtrlSetBkColor($idUpdatePrice, 0xbac3e0) GUICtrlSetFont($idUpdatePrice, Default, Default, 4) GUICtrlSetCursor($idUpdatePrice, 0) EndFunc ;==>_Style_1 Func _Style_1_1() ;GUICtrlSetBkColor($idUpdatePrice, -1) GUICtrlSetFont($idUpdatePrice, Default, Default, Default) GUICtrlSetCursor($idUpdatePrice, -1) EndFunc ;==>_Style_1_1 Func _Style_2() ;GUICtrlSetBkColor($idUpdatePrice, 0xbac3e0) GUICtrlSetFont($idSaveOrder, Default, Default, 4) GUICtrlSetCursor($idSaveOrder, 0) EndFunc ;==>_Style_2 Func _Style_2_1() ;GUICtrlSetBkColor($idUpdatePrice, -1) GUICtrlSetFont($idSaveOrder, Default, Default, Default) GUICtrlSetCursor($idSaveOrder, -1) EndFunc ;==>_Style_2_1 Func _WM_GETMINMAXINFO($hWnd, $Msg, $wParam, $lParam) ; used to limit the minimum size of the GUI #forceref $hWnd, $Msg, $wParam, $lParam If $hWnd = $hGUI Then Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, 964) ; min width DllStructSetData($tagMaxinfo, 8, 800) ; min height ConsoleWrite(ControlGetPos($hGUI, '', $idCatalog)[2] & @CRLF) _GUICtrlListView_SetColumnWidth($idCatalog, 1, ControlGetPos($hGUI, '', $idCatalog)[2] - 230) Return $GUI_RUNDEFMSG EndIf _GUICtrlListView_SetColumnWidth($idCatalog, 1, 700) EndFunc ;==>_WM_GETMINMAXINFO Func MY_WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) _GUICtrlStatusBar_Resize($idStatusbar) ;ConsoleWrite(ControlGetPos($hGUI, '', $idCatalog)[2] & @CRLF) _GUICtrlListView_SetColumnWidth($idCatalog, 1, ControlGetPos($hGUI, '', $idCatalog)[2] - 230) Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_SIZE When the GUI is maximized (_WM_GETMINMAXINFO), the _GUICtrlListView_SetColumnWidth function does not work. Can you explain why?
  3. error: Json_Get(): undefined function. I use jsonMap: Udf from the first post can not be downloaded. I found in another location JSON.au3 library from ward. There was another question. Can I somehow know the number of elements inside the element ["trans_result"] ["data"]? Since variants are possible ["trans_result"] ["data"] [0] ["dst"], ["trans_result"] ["data"] [1] ["dst"], ["trans_result"] ["data "] [2] [" dst "] and so on. $oJSON = Json_Decode($sJSON) Local $aLines = Json_Get($oJSON, '["trans_result"]["data"]') For $i = 0 To UBound($aLines) - 1 $sDst = Json_Get($oJSON, '["trans_result"]["data"][' & $i & ']["dst"]') MsgBox(0, '', $sDst) ConsoleWrite($sDst & @CRLF) Next
  4. My func: Func _URIEncode($sData) Local $aData = StringSplit(BinaryToString(StringToBinary($sData, 4), 1), "") Local $nChar $sData = "" For $i = 1 To $aData[0] $nChar = Asc($aData[$i]) Switch $nChar Case 45, 46, 48 To 57, 65 To 90, 95, 97 To 122, 126 $sData &= $aData[$i] Case 32 $sData &= "+" Case Else $sData &= "%" & Hex($nChar, 2) EndSwitch Next Return $sData EndFunc ;==>_URIEncode Func _GetTranslateBaidu($sText) Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("Post", "http://translate.baidu.com/v2transapi", False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8") $oHTTP.SetRequestHeader("Host", 'translate.baidu.com') $oHTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36") $oHTTP.SetRequestHeader("Connection", "keep-alive") ConsoleWrite('from=en&to=zh&query=' & _URIEncode($sText) & '&transtype=translang&simple_means_flag=3' & @CRLF) $oHTTP.Send('from=en&to=zh&query=' & _URIEncode($sText) & '&transtype=translang&simple_means_flag=3') If ($oHTTP.Status == 200) Then $sJSON = $oHTTP.ResponseText $aJSON = Json_Decode($sJSON, 10000) ConsoleWrite($aJSON['trans_result']['data'][0]['dst'] & @CRLF) EndIf EndFunc ;==>_GetTranslateBaidu Include: jsonMap.au3
  5. Hi. I can not get value of 'dst' attr from JSON: {"trans_result":{"from":"en","to":"zh","domain":"all","type":2,"status":0,"data":[{"dst":"\u6d4b\u8bd5","src":"test","relation":[],"result":[[0,"\u6d4b\u8bd5",["0|4"],[],["0|4"],["0|6"]]]}],"phonetic":[{"src_str":"\u6d4b","trg_str":"c\u00e8"},{"src_str":"\u8bd5","trg_str":"sh\u00ec"}]}} This is table: $aJSON['trans_result']['data'] But $aJSON['trans_result']['data'][0] gives an error message: Array variable has incorrect number of subscripts or subscript dimension range exceeded.
  6. Replaced @CRLF on a colon delimiter (:) and all was good. Thank you.
  7. This code causes an error: yacc stack overflow on line 249 Global $g_R2 = '1|0.1382|0.0031' & @CRLF & _ '2|0.1696|0.003' & @CRLF & _ '3|0.1994|0.003' & @CRLF & _ '4|0.2292|0.003' & @CRLF & _ '5|0.2592|0.0028' & @CRLF & _ '6|0.2876|0.0026' & @CRLF & _ '7|0.3131|0.0021' & @CRLF & _ '8|0.3337|0.0023' & @CRLF & _ '9|0.3563|0.0024' & @CRLF & _ '10|0.3803|0.0027' & @CRLF & _ '11|0.4071|0.0032' & @CRLF & _ '12|0.4387|0.0037' & @CRLF & _ '13|0.4758|0.0044' & @CRLF & _ '14|0.5197|0.005' & @CRLF & _ '15|0.5693|0.0051' & @CRLF & _ '16|0.6202|0.0055' & @CRLF & _ '17|0.6751|0.0057' & @CRLF & _ '18|0.7322|0.006' & @CRLF & _ '19|0.7923|0.0062' & @CRLF & _ '20|0.8545|0.0065' & @CRLF & _ '21|0.9197|0.0065' & @CRLF & _ '22|0.9846|0.0062' & @CRLF & _ '23|1.0462|0.0064' & @CRLF & _ '24|1.1106|0.0066' & @CRLF & _ '25|1.1767|0.0069' & @CRLF & _ '26|1.2452|0.007' & @CRLF & _ '27|1.3148|0.0071' & @CRLF & _ '28|1.3863|0.0074' & @CRLF & _ '29|1.4605|0.0073' & @CRLF & _ '30|1.5334|0.0074' & @CRLF & _ '31|1.6071|0.0078' & @CRLF & _ '32|1.6847|0.0078' & @CRLF & _ '33|1.7628|0.0079' & @CRLF & _ '34|1.8418|0.008' & @CRLF & _ '35|1.9222|0.0082' & @CRLF & _ '36|2.0045|0.0083' & @CRLF & _ '37|2.0874|0.0083' & @CRLF & _ '38|2.1708|0.0084' & @CRLF & _ '39|2.2553|0.0086' & @CRLF & _ '40|2.3411|0.0088' & @CRLF & _ '41|2.4293|0.0086' & @CRLF & _ '42|2.5157|0.0089' & @CRLF & _ '43|2.6045|0.009' & @CRLF & _ '44|2.6944|0.0092' & @CRLF & _ '45|2.786|0.0092' & @CRLF & _ '46|2.8776|0.0094' & @CRLF & _ '47|2.9716|0.0093' & @CRLF & _ '48|3.0642|0.0093' & @CRLF & _ '49|3.1574|0.0094' & @CRLF & _ '50|3.2512|0.0095' & @CRLF & _ '51|3.346|0.0096' & @CRLF & _ '52|3.4425|0.0099' & @CRLF & _ '53|3.5413|0.0097' & @CRLF & _ '54|3.6387|0.01' & @CRLF & _ '55|3.739|0.0099' & @CRLF & _ '56|3.8383|0.0098' & @CRLF & _ '57|3.9364|0.0101' & @CRLF & _ '58|4.0377|0.0101' & @CRLF & _ '59|4.1387|0.0101' & @CRLF & _ '60|4.2394|0.01' & @CRLF & _ '61|4.3394|0.0099' & @CRLF & _ '62|4.4384|0.0103' & @CRLF & _ '63|4.5411|0.0103' & @CRLF & _ '64|4.6443|0.0104' & @CRLF & _ '65|4.7481|0.0105' & @CRLF & _ '66|4.8528|0.0106' & @CRLF & _ '67|4.959|0.0108' & @CRLF & _ '68|5.0673|0.0106' & @CRLF & _ '69|5.1737|0.0109' & @CRLF & _ '70|5.2824|0.0107' & @CRLF & _ '71|5.3895|0.011' & @CRLF & _ '72|5.4991|0.0108' & @CRLF & _ '73|5.6075|0.0112' & @CRLF & _ '74|5.7193|0.0112' & @CRLF & _ '75|5.8308|0.0111' & @CRLF & _ '76|5.9422|0.0111' & @CRLF & _ '77|6.0531|0.011' & @CRLF & _ '78|6.1635|0.011' & @CRLF & _ '79|6.273|0.0113' & @CRLF & _ '80|6.3864|0.0114' & @CRLF & _ '81|6.5004|0.0115' & @CRLF & _ '82|6.6154|0.0117' & @CRLF & _ '83|6.732|0.0114' & @CRLF & _ '84|6.8457|0.0115' & @CRLF & _ '85|6.9602|0.0116' & @CRLF & _ '86|7.0759|0.0117' & @CRLF & _ '87|7.1933|0.0115' & @CRLF & _ '88|7.3085|0.0117' & @CRLF & _ '89|7.4251|0.0119' & @CRLF & _ '90|7.544|0.0117' & @CRLF & _ '91|7.6612|0.012' & @CRLF & _ '92|7.7811|0.0119' & @CRLF & _ '93|7.8998|0.0117' & @CRLF & _ '94|8.0168|0.0119' & @CRLF & _ '95|8.136|0.0118' & @CRLF & _ '96|8.2539|0.0121' & @CRLF & _ '97|8.3746|0.012' & @CRLF & _ '98|8.4946|0.0119' & @CRLF & _ '99|8.6135|0.0122' & @CRLF & _ '100|8.7358|0.0122' & @CRLF & _ '101|8.858|0.0122' & @CRLF & _ '102|8.9802|0.0122' & @CRLF & _ '103|9.1025|0.0122' & @CRLF & _ '104|9.2247|0.0122' & @CRLF & _ '105|9.347|0.0122' & @CRLF & _ '106|9.4693|0.0122' & @CRLF & _ '107|9.5917|0.0122' & @CRLF & _ '108|9.714|0.0122' & @CRLF & _ '109|9.8364|0.0123' & @CRLF & _ '110|9.959|0.0123' & @CRLF & _ '111|10.0816|0.0123' & @CRLF & _ '112|10.2045|0.0123' & @CRLF & _ '113|10.3278|0.0124' & @CRLF & _ '114|10.4514|0.0124' & @CRLF & _ '115|10.5758|0.0126' & @CRLF & _ '116|10.7013|0.0127' & @CRLF & _ '117|10.8284|0.0124' & @CRLF & _ '118|10.9529|0.0126' & @CRLF & _ '119|11.0785|0.0127' & @CRLF & _ '120|11.2059|0.0125' & @CRLF & _ '121|11.3305|0.0126' & @CRLF & _ '122|11.4564|0.0123' & @CRLF & _ '123|11.5791|0.0128' & @CRLF & _ '124|11.7071|0.0126' & @CRLF & _ '125|11.8329|0.0128' & @CRLF & _ '126|11.9605|0.0125' & @CRLF & _ '127|12.0856|0.0127' & @CRLF & _ '128|12.2121|0.0129' & @CRLF & _ '129|12.3408|0.0127' & @CRLF & _ '130|12.4676|0.0129' & @CRLF & _ '131|12.5966|0.0127' & @CRLF & _ '132|12.7241|0.013' & @CRLF & _ '133|12.8541|0.0129' & @CRLF & _ '134|12.9829|0.0127' & @CRLF & _ '135|13.1099|0.0129' & @CRLF & _ '136|13.2393|0.0128' & @CRLF & _ '137|13.3673|0.0126' & @CRLF & _ '138|13.4929|0.0127' & @CRLF & _ '139|13.6202|0.013' & @CRLF & _ '140|13.7501|0.0129' & @CRLF & _ '141|13.8786|0.0127' & @CRLF & _ '142|14.0053|0.0129' & @CRLF & _ '143|14.1343|0.0127' & @CRLF & _ '144|14.2615|0.013' & @CRLF & _ '145|14.3912|0.0128' & @CRLF & _ '146|14.5196|0.0126' & @CRLF & _ '147|14.6458|0.0128' & @CRLF & _ '148|14.774|0.0126' & @CRLF & _ '149|14.9002|0.0128' & @CRLF & _ '150|15.0284|0.0126' & @CRLF & _ '151|15.1544|0.0128' & @CRLF & _ '152|15.2823|0.0126' & @CRLF & _ '153|15.408|0.0127' & @CRLF & _ '154|15.5353|0.0125' & @CRLF & _ '155|15.6602|0.0126' & @CRLF & _ '156|15.7863|0.0128' & @CRLF & _ '157|15.9145|0.0131' & @CRLF & _ '158|16.0455|0.013' & @CRLF & _ '159|16.1759|0.0124' & @CRLF & _ '160|16.3|0.0125' & @CRLF & _ '161|16.4252|0.0127' & @CRLF & _ '162|16.5518|0.0124' & @CRLF & _ '163|16.6756|0.0124' & @CRLF & _ '164|16.8001|0.0121' & @CRLF & _ '165|16.9206|0.012' & @CRLF & _ '166|17.0403|0.0123' & @CRLF & _ '167|17.1637|0.0124' & @CRLF & _ '168|17.2878|0.0125' & @CRLF & _ '169|17.4128|0.0121' & @CRLF & _ '170|17.5341|0.0121' & @CRLF & _ '171|17.6549|0.012' & @CRLF & _ '172|17.7751|0.0124' & @CRLF & _ '173|17.8994|0.012' & @CRLF & _ '174|18.0196|0.0119' & @CRLF & _ '175|18.1387|0.0123' & @CRLF & _ '176|18.2613|0.0123' & @CRLF & _ '177|18.3841|0.0123' & @CRLF & _ '178|18.5073|0.0124' & @CRLF & _ '179|18.631|0.0119' & @CRLF & _ '180|18.7501|0.0118' & @CRLF & _ '181|18.8679|0.0121' & @CRLF & _ '182|18.9885|0.012' & @CRLF & _ '183|19.1083|0.0119' & @CRLF & _ '184|19.2268|0.0117' & @CRLF & _ '185|19.3435|0.0119' & @CRLF & _ '186|19.4624|0.0117' & @CRLF & _ '187|19.5798|0.0115' & @CRLF & _ '188|19.6947|0.0116' & @CRLF & _ '189|19.811|0.0118' & @CRLF & _ '190|19.9295|0.0117' & @CRLF & _ '191|20.046|0.0114' & @CRLF & _ '192|20.1598|0.0115' & @CRLF & _ '193|20.2744|0.0116' & @CRLF & _ '194|20.3903|0.0113' & @CRLF & _ '195|20.5029|0.0113' & @CRLF & _ '196|20.616|0.0114' & @CRLF & _ '197|20.7296|0.0114' & @CRLF & _ '198|20.8439|0.0115' & @CRLF & _ '199|20.9593|0.0112' & @CRLF & _ '200|21.0713|0.0112' & @CRLF & _ '201|21.1833|0.0112' & @CRLF & _ '202|21.2952|0.0112' & @CRLF & _ '203|21.407|0.0112' & @CRLF & _ '204|21.5189|0.0112' & @CRLF & _ '205|21.6306|0.0112' & @CRLF & _ '206|21.7422|0.0111' & @CRLF & _ '207|21.8535|0.0111' & @CRLF & _ '208|21.9644|0.011' & @CRLF & _ '209|22.0748|0.0104' & @CRLF & _ '210|22.1792|0.0106' & @CRLF & _ '211|22.285|0.0103' & @CRLF & _ '212|22.3875|0.0103' & @CRLF & _ '213|22.4904|0.0103' & @CRLF & _ '214|22.5938|0.0104' & @CRLF & _ '215|22.698|0.01' & @CRLF & _ '216|22.7982|0.01' & @CRLF & _ '217|22.8977|0.0103' & @CRLF & _ '218|23.0011|0.0099' & @CRLF & _ '219|23.1001|0.0098' & @CRLF & _ '220|23.1977|0.0101' & @CRLF & _ '221|23.2982|0.01' & @CRLF & _ '222|23.3982|0.0099' & @CRLF & _ '223|23.4972|0.0097' & @CRLF & _ '224|23.5947|0.0095' & @CRLF & _ '225|23.69|0.0097' & @CRLF & _ '226|23.7872|0.0095' & @CRLF & _ '227|23.882|0.0094' & @CRLF & _ '228|23.9759|0.0092' & @CRLF & _ '229|24.0684|0.0093' & @CRLF & _ '230|24.1612|0.0093' & @CRLF & _ '231|24.2546|0.0089' & @CRLF & _ '232|24.3438|0.009' & @CRLF & _ '233|24.4343|0.009' & @CRLF & _ '234|24.5241|0.0089' & @CRLF & _ '235|24.613|0.0087' & @CRLF & _ '236|24.6997|0.0088' & @CRLF & _ '237|24.7874|0.0086' & @CRLF & _ '238|24.8731|0.0085' & @CRLF & _ '239|24.9582|0.0084' & @CRLF & _ '240|25.0426|0.0081' & @CRLF & _ '241|25.1235|0.0081' & @CRLF & _ '242|25.2041|0.008' & @CRLF & _ '243|25.2841|0.0079' & @CRLF & _ '244|25.3636|0.0078' & @CRLF & _ '245|25.442|0.0077' & @CRLF & _ '246|25.5188|0.0077' & @CRLF & _ '247|25.5958|0.0077' & @CRLF & _ '248|25.6732|0.0071' & @CRLF & _ '249|25.7444|0.0071' & @CRLF & _ '250|25.8154|0.0071' & @CRLF & _ '251|25.8862|0.0069' & @CRLF & _ '252|25.9548|0.0069' & @CRLF & _ '253|26.0239|0.0068' & @CRLF & _ '254|26.092|0.0067' & @CRLF & _ '255|26.1585|0.0064' & @CRLF & _ '256|26.2225|0.0063' & @CRLF & _ '257|26.2855|0.0061' & @CRLF & _ '258|26.3468|0.0062' & @CRLF & _ '259|26.4083|0.0062' & @CRLF & _ '260|26.47|0.0059' & @CRLF & _ '261|26.5295|0.0056'
  8. I find out what the trigger is activated before the update of the table. He uses the EXTRACTINT64 function, which is located in the library udfdll.dll. Now the question. You can somehow use the library for the correct execution of the request?
  9. It is possible to get an example of use the UPDATE command? If to use this code: $r=_FireBird_ExecuteStatement($h_fbDll, 'update "vollink" set "barcode" = "test" where "codeint" = 9419')I get an error: If to use this code: $r=_FireBird_ExecuteStatement($h_fbDll, 'update "vollink" set "barcode" = ''test'' where "codeint" = 9419')I get an error: How to write a valid request?
  10. I need to do it programmatically. Resource is in external file.
  11. Hi. How can save this resource in a file? File for test in attach. ComboBoxEx.lmd
  12. You can slightly alter the script, and that image is inverted.
  13. I am parsing a logo.bin of firmware for Android-based phones at MTK6589. Did the unpacking blocks and their deflate uncompression. In the result, received RAW blocks. Which your script will convert in PNG.
  14. UEZ, Thank you very much!
  15. I wonder, is it possible to boost conversion? Now it takes too much time. Added: Rewrote the code a little bit. Convert now true, but very long. Converted on Intel E2200@2.2Ghz - 14 and a half minutes. #include <GDIPlus.au3> _GDIPlus_Startup() Global $hFile = FileOpen("C:\raw1.raw", 16) Global $bRaw = FileRead($hFile) FileClose($hFile) Global $hBmp = smethod_4($bRaw, 540, 960) _GDIPlus_ImageSaveToFile($hBmp, @ScriptDir & "\Converted.png") _GDIPlus_BitmapDispose($hBmp) _GDIPlus_Shutdown() Func smethod_4($bRaw, $iW, $iH) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $tBitmapData = _GDIPlus_BitmapLockBits($hBitmap, 0, 0, $iW, $iH, $GDIP_ILMWRITE, $GDIP_PXF32ARGB) Local $iScan0 = DllStructGetData($tBitmapData, "Scan0") Local $nLen = (Abs($tBitmapData.Stride) * $iH) / 4 Local $tPixel = DllStructCreate("int[" & $nLen & "];", $iScan0) Local $nOffset = 1 For $i = 1 To $nLen DllStructSetData($tPixel, 1, smethod_3(BinaryMid($bRaw, $nOffset, 2)), $i) $nOffset += 2 Next _GDIPlus_BitmapUnlockBits($hBitmap, $tBitmapData) Return $hBitmap EndFunc ;==>smethod_4 Func smethod_3($uShort) Local $num = BitAND($uShort, 0x1F) / 32 * 256 Local $num2 = BitAND(BitShift($uShort, 5), 0x3F) / 64 * 256 Local $num3 = BitShift($uShort, 11) / 32 * 256 Return BitOR(BitOR(BitOR(-16777216, BitShift($num3, -0x10)), BitShift($num2, -8)), $num) EndFunc ;==>smethod_3 I would like to optimize the code now.
  16. UEZ, Great start! Only, here is the original: '> Here is the script: '> It is possible to fix? Thx.
  17. There is a code which it seems it does. It is necessary to adapt it under Autoit. private static Bitmap smethod_4(BinaryReader binaryReader_0, Size size_0) { Bitmap bitmap = new Bitmap(size_0.Width, size_0.Height); BitmapData bitmapdata = bitmap.LockBits(new Rectangle(new Point(0, 0), size_0), ImageLockMode.WriteOnly, bitmap.PixelFormat); try { IntPtr destination = bitmapdata.Scan0; int length = (Math.Abs(bitmapdata.Stride) * bitmap.Height) / 4; int[] source = new int[length]; for (int i = 0; i < length; i++) { source[i] = smethod_3(binaryReader_0.ReadUInt16()); } Marshal.Copy(source, 0, destination, length); } finally { bitmap.UnlockBits(bitmapdata); } return bitmap; } private static int smethod_3(ushort ushort_0) { byte num = (byte) ((int) ((((double) (ushort_0 & 0x1f)) / 32.0) * 256.0)); byte num2 = (byte) ((int) ((((double) ((ushort_0 >> 5) & 0x3f)) / 64.0) * 256.0)); byte num3 = (byte) ((int) ((((double) (ushort_0 >> 11)) / 32.0) * 256.0)); return (((-16777216 | (num3 << 0x10)) | (num2 << 8)) | num); } Thx.
  18. Is it possible to do without third-party libraries?
  19. There is a raw-image. 16BPP, 5:6:5 RGB bits, 2 bytes per pixel. Width 540px, height 960px. Can it be as it is displayed on GUI? Thank you. This .raw normally opens and shows the IrfanView. raw1.zip
  20. The curl_multi_info_read function constantly returns 0. Can this be corrected? Thank you. Global Const $CURLOPTTYPE_LONG = 0 Global Const $CURLOPTTYPE_OBJECTPOINT = 10000 Global Const $CURLOPT_URL = 0x2712 Global Const $CURLOPT_WRITEDATA = 0x2711 Global Const $CURLOPT_WRITEFUNCTION = 0x4E2B Global Const $CURLOPT_PROGRESSFUNCTION = 0x4E58 Global Const $CURLOPT_NOPROGRESS = 0x2B Global Const $CURLOPT_ERRORBUFFER = 0x271A Global Const $CURLOPT_TRANSFERTEXT = 0x35 Global Const $CURL_ERROR_SIZE = 0x100 Global Const $CURLOPT_SSL_VERIFYPEER = 0x40 Global Const $CURLOPT_COOKIEFILE = $CURLOPTTYPE_OBJECTPOINT + 31 Global Const $CURLOPT_COOKIEJAR = $CURLOPTTYPE_OBJECTPOINT + 82 Global Const $CURLOPT_FOLLOWLOCATION = $CURLOPTTYPE_LONG + 52 Global Const $CURLOPT_POSTFIELDS = $CURLOPTTYPE_OBJECTPOINT + 15 Global Const $CURLOPT_POST = $CURLOPTTYPE_LONG + 47 Global Const $CURLOPT_POSTFIELDSIZE = $CURLOPTTYPE_LONG + 60 Global Const $CURLOPT_HTTPHEADER = $CURLOPTTYPE_OBJECTPOINT + 23 Global Const $CURLOPT_VERBOSE = $CURLOPTTYPE_LONG + 41 Global Enum $CURLM_CALL_MULTI_PERFORM = -1, $CURLM_OK, $CURLM_BAD_HANDLE, $CURLM_BAD_EASY_HANDLE, $CURLM_OUT_OF_MEMORY, $CURLM_INTERNAL_ERROR, $CURLM_BAD_SOCKET, $CURLM_UNKNOWN_OPTION, $CURLM_ADDED_ALREADY, $CURLM_LAST Global $hLibCurl = DllOpen(@ScriptDir & "\libcurl.dll") Global $aURLs = ['ya.ru', 'google.ru'] Global $hCurlMultiHandle = DllCall($hLibCurl, "ptr:cdecl", "curl_multi_init")[0] Global $aThreads[UBound($aURLs)] For $i = 0 To UBound($aURLs) - 1 $hThread = DllCall($hLibCurl, "ptr:cdecl", "curl_easy_init")[0] $aThreads[$i]=$hThread $tURL = DllStructCreate("char[2048]") DllStructSetData($tURL, 1, $aURLs[$i]) DllCall($hLibCurl, "int:cdecl", "curl_easy_setopt", "ptr", $hThread, "int", $CURLOPT_URL, "ptr", DllStructGetPtr($tURL)) $bCallbackBuffer = '' $pWriteFunc = DllCallbackRegister ("_my_fwrite", "uint:cdecl", "ptr;uint;uint;ptr") DllCall($hLibCurl, "int:cdecl", "curl_easy_setopt", "ptr", $hThread, "int", $CURLOPT_WRITEFUNCTION, "ptr", DllCallbackGetPtr($pWriteFunc)) DllCall($hLibCurl, "int:cdecl", "curl_easy_setopt", "ptr", $hThread, "int", $CURLOPT_WRITEDATA, "int", 0) DllCall($hLibCurl, "int:cdecl", "curl_easy_setopt", "ptr", $hThread, "int", $CURLOPT_FOLLOWLOCATION, "int", 1) DllCall($hLibCurl, "int:cdecl", "curl_easy_setopt", "ptr", $hThread, "int", $CURLOPT_VERBOSE, "int", 1) DllCall($hLibCurl, "int:cdecl", "curl_multi_add_handle", "ptr", $hCurlMultiHandle, "ptr", $hThread) Next $tActive = DllStructCreate("int") Do $iPerform = DllCall($hLibCurl, "int:cdecl", "curl_multi_perform", "ptr", $hCurlMultiHandle, "ptr", DllStructGetPtr($tActive))[0] Until DllStructGetData($tActive, 1) > 0 if ($iPerform = $CURLM_OK) Then $tMsgsLeft = DllStructCreate("int") $pMsg = DllCall($hLibCurl, "ptr:cdecl", "curl_multi_info_read", "ptr", $hCurlMultiHandle, "ptr", DllStructGetPtr($tMsgsLeft))[0] ; $pMsg = 0 ????????????? EndIf for $i = 0 to UBound($aThreads) - 1 DllCall($hLibCurl, "int:cdecl", "curl_multi_remove_handle", "ptr", $hCurlMultiHandle, "ptr", $aThreads[$i]) DllCall($hLibCurl, "none:cdecl", "curl_easy_cleanup", "ptr", $aThreads[$i]) Next DllCall($hLibCurl, "int:cdecl", "curl_multi_cleanup", "ptr", $hCurlMultiHandle) DllClose($hLibCurl) DllCallbackFree ('_my_fwrite') ConsoleWrite($bCallbackBuffer) Func _my_fwrite($buffer, $size, $nmemb, $stream) Local $vData = DllStructCreate("byte[" & $size * $nmemb & "]", $buffer) $bCallbackBuffer &= DllStructGetData($vData, 1) Return $size * $nmemb EndFunc ;==>_my_fwrite PS. Tested on AutoIt v3.3.9.22
  21. Hi, martin! I was faced with such a problem. If the COM port is busy any program, then pops up this message: And I do not know how to remove it. I want myself to handle the errors connected to the COM port. Can you help me? Thank you!
  22. Because the files will be about 40 pieces. And they should run automatically one after the other. And for this I should know that the previous installer has completed its work.
  23. http://rghost.ru/private/41108068/a4e8759c9965fa26a99e248810c7ebe3If you run the file 7zFM.sfx.exe (link above), it will be started 7zFM.exe. Need to get the time of completion of work 7zFM.exe.
  24. I'll write another example. Open the zip archive. Then in it we open the program. Complete the process by opening the archive. The program is still running. Completion of the program. Now you get the point. guinness -- your example in this case does not work.
  25. There is a sfx archive, after starting the which is extracted and run some program. Its name is unknown. How can I track the time of completion of the program?
×
×
  • Create New...