Leaderboard
Popular Content
Showing content with the highest reputation on 06/26/2016 in all areas
-
first try saving your current theme and load the default one to see whether that fixes it... then you can start asking yourself the questions. Yea ... at least a couple of seconds Jos2 points
-
MySQL UDFs using libmysql.dll functions: most functions from MySQL API all are prefixed with an underscore: _MySql... e.g.: _MySQL_Real_Query( sometimes parameters are chaged - read function descriptions in include file MySQL.au3 If you do not need the power of these UDFs and you simple want to use basic SQL commands, then have a look at not included: MySQL_Connect - This function is deprecated. Use _MySQL_Real_Connect instead. MySQL_Create_DB - This function is deprecated. Use mysql_query() to issue an SQL CREATE DATABASE statement instead. MySQL_Drop_DB - This function is deprecated. Use mysql_query() to issue an SQL DROP DATABASE statement instead. MySQL_Escape_String - You should use _mysql_real_escape_string() instead! MySQL_Kill - This function is deprecated. Use mysql_real_query() to issue an SQL KILL statement instead mysql_library_end - Called by _MySQL_EndLibrary. mysql_library_init - Called by _MySQL_InitLibrary. I included a fallback-libmysql.dll: yoou can include libMySQLDLL.au3 and set $Use_EmbeddedDLL=True when calling _MySQL_InitLibrary an example for XAMPP / cdcol is also included in ZIP. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.8.1 (beta) Author: Prog@ndy Script Function: MySQL-Plugin Demo Script #ce ---------------------------------------------------------------------------- #include <array.au3> #include "mysql.au3" ; MYSQL starten, DLL im PATH (enthält auch @ScriptDir), sont Pfad zur DLL angeben. DLL muss libmysql.dll heißen. _MySQL_InitLibrary() If @error Then Exit MsgBox(0, '', "could nit init MySQL") MsgBox(0, "DLL Version:",_MySQL_Get_Client_Version()&@CRLF& _MySQL_Get_Client_Info()) $MysqlConn = _MySQL_Init() ;Fehler Demo: MsgBox(0,"Error-demo","Error-Demo") $connected = _MySQL_Real_Connect($MysqlConn,"localhostdfdf","droot","","cdcol") If $connected = 0 Then $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"Error:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST) Endif ; XAMPP cdcol MsgBox(0, "XAMPP-Cdcol-demo", "XAMPP-Cdcol-demo") $connected = _MySQL_Real_Connect($MysqlConn, "localhost", "root", "", "cdcol") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $query = "SELECT * FROM cds" $mysql_bool = _MySQL_Real_Query($MysqlConn, $query) If $mysql_bool = $MYSQL_SUCCESS Then MsgBox(0, '', "Query OK") Else $errno = _MySQL_errno($MysqlConn) MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn)) EndIf $res = _MySQL_Store_Result($MysqlConn) $fields = _MySQL_Num_Fields($res) $rows = _MySQL_Num_Rows($res) MsgBox(0, "", $rows & "-" & $fields) ; Access2 1 MsgBox(0, '', "Access method 1- manual") Dim $array[$rows][$fields] For $k = 1 To $rows $mysqlrow = _MySQL_Fetch_Row($res,$fields) $lenthsStruct = _MySQL_Fetch_Lengths($res) For $i = 1 To $fields $length = DllStructGetData($lenthsStruct, 1, $i) $fieldPtr = DllStructGetData($mysqlrow, 1, $i) $data = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1) $array[$k - 1][$i - 1] = $data Next Next _ArrayDisplay($array) ; Access 2 MsgBox(0, '', "Access method 2 - row for row") _MySQL_Data_Seek($res, 0) ; just reset the pointer to the beginning of the result set Do $row1 = _MySQL_Fetch_Row_StringArray($res) If @error Then ExitLoop _ArrayDisplay($row1) Until @error ; Access 3 MsgBox(0, '', "Access method 3 - read whole result in 2D-Array") $array = _MySQL_Fetch_Result_StringArray($res) _ArrayDisplay($array) ; fieldinfomation MsgBox(0, '', "Access fieldinformation") Dim $arFields[$fields][3] For $i = 0 To $fields - 1 $field = _MySQL_Fetch_Field_Direct($res, $i) $arFields[$i][0] = _MySQL_Field_ReadValue($field, "name") $arFields[$i][1] = _MySQL_Field_ReadValue($field, "table") $arFields[$i][2] = _MySQL_Field_ReadValue($field, "db") Next _ArrayDisplay($arFields) ; free result _MySQL_Free_Result($res) ; Close connection _MySQL_Close($MysqlConn) ; exit MYSQL _MySQL_EndLibrary() MySQL UDf Downloads: (including x86 and x64)</array.au3>1 point
-
I don't get it. @mLipok has polished (pun intended) a nice ADO UDF which works flawlessly. Why insist on using another one which causes issues?1 point
-
dmob, Delighted to hear that you like it - I aim to please.....!!!!!! M231 point
-
dmob, Please let me know what you think of this implementation. Example (look at line #30): #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx_UpDown.au3" #include <Array.au3> ; Just for display in example Global $aRet, $iEditMode = 0 ; Create GUI $hGUI = GUICreate("LVEx Beta Example", 500, 360) ; Create ListView $cListView = GUICtrlCreateListView("Tom|Dick|Harry", 10, 10, 480, 300, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($cListView,$LVS_EX_FULLROWSELECT ) _GUICtrlListView_SetColumnWidth($cListView, 0, 150) _GUICtrlListView_SetColumnWidth($cListView, 1, 150) _GUICtrlListView_SetColumnWidth($cListView, 2, 150) ; Create array and fill Left listview Global $aLV_List[15] For $i = 0 To 14 $aLV_List[$i] = $i & "|Dick " & $i & "|Harry " & $i GUICtrlCreateListViewItem($i & "|Dick " & $i & "|Harry " & $i, $cListView) Next ; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text $iLV_Index = _GUIListViewEx_Init($cListView, $aLV_List, 0, Default, Default, 4) _GUIListViewEx_SetEditStatus($iLV_Index, "0", 1, 1, "0|9|1") ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUIListViewEx_SetEditStatus($iLV_Index, "1", 2, "1|2|3", 1) _GUIListViewEx_SetEditStatus($iLV_Index, "2", 2, "1|2|3", 3) $cDisplay_Button = GUICtrlCreateButton("Show content", 10, 320, 230, 30) $cExit_Button = GUICtrlCreateButton("Exit", 260, 320, 230, 30) ; Register for sorting, dragging and editing _GUIListViewEx_MsgRegister() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $cExit_Button Exit Case $cDisplay_Button $aLV_List = _GUIListViewEx_ReturnArray($iLV_Index) If Not @error Then _ArrayDisplay($aLV_List, "Returned Left") Else MsgBox(0, "Left", "Empty Array") EndIf EndSwitch ; This function must be in the idle loop to enable editing of any kind $vRet = _GUIListViewEx_EditOnClick(33) If IsArray($vRet) Then ; Uncomment to see returned array ;ConsoleWrite("Edits performed: " & $vRet[0][0] & @CRLF) ;_ArrayDisplay($vRet, @error) $avRet = "" EndIf WEnd And the UDF to use with it: Read the _GUIListViewEx_SetEditStatus function header to see how the syntax works - I hope it is reasonably intuitive. M231 point
-
@Deye, actually, that would be a lot easier than you might think. look inside the _Crypt_DecryptFile function. you'll see it reads the encrypted file, decrypts it in memory, then writes the decrypted data to file. you should be able to rewrite it to return the decrypted data as a string. then, parsing the data in memory is easy. i remember @guinness has a nice UDF to handle ini file in memory, although i cannot seem to locate that topic at the moment.1 point
-
It indeed seems that the Contextmenu message isn't part of the triggered events, but you could point all submenu items to the same Func and do an action based on the pressed submenu which you can test with @GUI_CtrlId Jos1 point
-
Have you changed any Theme colors of Windows? Jos1 point
-
when u use assign, eval dont use the $. This should work : ;bad : Assign("$Lf_MenuItemReplItemID" & $i, "data") ;good: Assign("Lf_MenuItemReplItemID" & $i, "data") ;= $Lf_MenuItemReplItemID = "data"1 point
-
#include <MsgBoxConstants.au3> $test = Example(12) Switch $test Case "qsdsqdqsdqsd.exe" ;... Case Else MsgBox(0,"test","Example " & $test) EndSwitch Func Example($iVal) Local $sApp Switch $iVal Case 4 $sApp = "notepad.exe" Case 8 $sApp = "mspaint.exe" Case 12 $sApp = "calc.exe" EndSwitch MsgBox($MB_OK, "Example", $iVal) Return $sApp EndFunc1 point
-
About a return command
youtuber reacted to JLogan3o13 for a topic
So something like this: ShellExecute(Example(12)) Func Example($iVal) Local $sApp Switch $iVal Case 4 $sApp = "notepad.exe" Case 8 $sApp = "mspaint.exe" Case 12 $sApp = "calc.exe" EndSwitch Return $sApp EndFunc1 point -
GUIListViewEx - BugFix Version 6 Apr 24
232showtime reacted to Melba23 for a topic
232showtime, Try this: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GUIListViewEx.au3" #include <Array.au3> Global $List1, $sString, $hButton0, $iLV_Index gui1() Func gui1() $hGUI1 = GUICreate("Gui 1", 400, 400, 200, 200) $hButton0 = GUICtrlCreateButton("Load", 100, 10, 80, 30) $hButton1 = GUICtrlCreateButton("Clear 1", 10, 10, 80, 30) $hButton2 = GUICtrlCreateButton("Edit", 10, 60, 80, 30) $List1 = GUICtrlCreateListView("", 10, 100, 180, 80, BitOR(0x0200, 0x008), BitOR(0x00000020, 0x00000001)) _GUICtrlListView_AddColumn($List1, "1", 150, 2) _GUICtrlListView_AddColumn($List1, "2", 500, 2) _GUICtrlListView_AddColumn($List1, "3", 50, 2) _GUICtrlListView_Scroll($List1, 10, 100) ; Initiate ListView within UDF $iLV_Index = _GUIListViewEx_Init($List1, "") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hButton1 MsgBox("", "MsgBox 1", "Clear???") _GUICtrlListView_DeleteAllItems($List1) Case $hButton2 ; Disable the first GUI GUISetState(@SW_DISABLE, $hGUI1) gui2() ; Re-enable the first GUI GUISetState(@SW_ENABLE, $hGUI1) Case $hButton0 _GUIListViewEx_LoadListView($iLV_Index, "Save.lvs") ; Reset column alignment _GUICtrlListView_JustifyColumn($List1, 0, 2) _GUICtrlListView_JustifyColumn($List1, 1, 2) _GUICtrlListView_JustifyColumn($List1, 2, 2) _WinAPI_RedrawWindow(GUICtrlGetHandle($List1)) EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $sString = GUICtrlCreateEdit("", 50, 50, 100, 100, $ES_WANTRETURN) $hButton3 = GUICtrlCreateButton("Save", 10, 10, 80, 30) GUISetState() While 1 ; We can only get messages from the second GUI Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hButton3 $sRead1 = GUICtrlRead($sString) _GUIListViewEx_Insert($sRead1 & "||") ; Add item to ListView uaing UDF _GUIListViewEx_SaveListView($iLV_Index, "Save.lvs") GUICtrlSetState($hButton0, $GUI_ENABLE) ExitLoop EndSwitch WEnd GUIDelete($hGUI2) EndFunc ;==>gui2 M231 point -
_GDIPlus_ImageScale($hImage, 0.15, 0.15) Should do it for you.1 point
-
@ProgAndy I like anything that smells to SQL !! Unfortunately you link does not work (for me ?). Rgds ptrex1 point
-
I don't know of a good way.... Here's one that relies on Send..... It's better to use ControlSend, but SysTreeViews are not really supported yet. $title = "Computer Management" Run("mmc.exe compmgmt.msc", @SystemDir) WinWait($title) Send("d") Send("{TAB}") sleep(2000);hard-coded delay... Send("{AppsKey}a") ;bring up right-click menu1 point