
sambuddy
Active Members-
Posts
36 -
Joined
-
Last visited
sambuddy's Achievements

Seeker (1/7)
0
Reputation
-
Advice needed on ToolTips and system tray icon
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
<bump> -
Hello All, I have two questions i hope you can help me with. My first question is when i run the code below, an icon is displayed in the system tray. Now if i do a right mouse click on the icon in the tray, the script will pause until i exit the menu (this can be seen by the console output stopping) BUT.....Shouldn't the Opt("TrayAutoPause",0) ; stop this from happening? (i want the script to continue UNTIL i select "Pause" in the menu) My second question is, when the script starts, the tooltip is displayed with the info in it that i want....but the tooltip is only displayed WHEN the script starts, i thought it was meant to be displayed when the icon was in focus. When the script starts the tool tip shows the following "STB= 5 C:\TrayItems.au3" BUT once it has disappeared and i hover my mouse over the icon i get the following "TrayItems.au3" What am i missing? Thanks >_< #Include <Constants.au3> $stb=5 Opt("TrayAutoPause",0) ; Script will not be paused when clicking the tray icon. TrayTip("STB="& $stb,@ScriptFullPath,30,1);in the tooltip, tell us what stb is running and what script TrayCreateItem("Script Details:") TrayCreateItem("STB="& $stb) TrayCreateItem(@ScriptFullPath) dim $x=0 While 1 $msg = TrayGetMsg() ConsoleWrite("message = " & $msg & ": count = " & $x & @CRLF) $x=$x+1 WEnd Exit
-
Hello All, I have a table with a "bit" field in it BUT i am unable to insert a bit into it using autoit. Can anyone share some advice on how to represent a "bit" in autoit? e.g. Trying to insert a "bit" into the database I have tried the following queries. "INSERT INTO Picture_Table(True_False) VALUES (TRUE)" "INSERT INTO Picture_Table(True_False) VALUES (1)" "INSERT INTO Picture_Table(True_False) VALUES (Binary(1))" But none of them work Thanks for your help
-
Storing a graphic into MySQL using BLOB
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
Hello Bo8ster, My problem has been solved The following code works as long as you set a parameter on the SQL server that limits the "Maximum Packet Size" It was set to something in the KB range, when i increased it to 10MB, everything started working as it should. Thanks for your patience and help #include <array.au3> #include "mysql.au3" dim $file="c:\1.bmp" dim $f_handle _MySQL_InitLibrary() $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn,"localhost","root","holden","music") 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 $connected = _MySQL_Real_Connect($MysqlConn, "localhost", "root", "holden", "music") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $f_handle=FileOpen($file,16) if @error <> 0 Then ConsoleWrite("file open error " & @error & @CRLF) EndIf $contents=FileRead($f_handle,FileGetSize($file)) if @error <> 0 Then ConsoleWrite("file read error " & @error & @CRLF) EndIf $bmp=String($contents) $query="INSERT INTO album_artwork(artwork) values(" & $bmp & ")" _MySQL_Real_Query($MysqlConn, $query) if @error <> 0 Then ConsoleWrite("SQL statement failed error =" & @error & @CRLF) EndIf _MySQL_Close($MysqlConn) _MySQL_EndLibrary() exit(0) -
Storing a graphic into MySQL using BLOB
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
I am using BLOB (i have also tried LONGBLOB) -
Storing a graphic into MySQL using BLOB
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
Hello b08ster, I think i may be onto something I have just reduced the size of the graphic from being 1.5 meg down to 9kb by changing it to b/w and making it tiny. But, it worked through autoit that way. It seems to be related with the size of the picture -
Storing a graphic into MySQL using BLOB
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
Hello Bo8ster, All of my commands work on the command line EXCEPT for the one where i try to send something to the BLOB. When i issue that, the text string "c:\1.bmp" gets stored in the db instead of the actual file. I am currently looking into how to enable all the logs. I have switched everything on in the admin gui but am still not getting much out of it Thanks -
Storing a graphic into MySQL using BLOB
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
That is part of the problem I don't get any error from the commands i run. It all executes as though it all worked, but there is no graphic in the DB. If i change the following red lines into the following green lines, the text "c:\\1.bmp" gets stored in the db so it would seem that my problem is more related to the fact that i am trying to submit binary data to the db rather that text data, but i am not sure how i should get around this $query="INSERT INTO album_artwork(artworkID, artwork) values(7," & $contents & ")" _MySQL_Real_Query($MysqlConn, $query,FileGetSize("c:\1.bmp")) $query="INSERT INTO album_artwork(artworkID, artwork) values(7,'c:\\1.bmp')" _MySQL_Real_Query($MysqlConn, $query) -
Hello All, I am in the process of submitting data to an SQL database using autoit. I am able to submit all text data, but when i try to submit a graphic, i get no errors and i don't get the new entry into the database. I am using the MySQL UDF's from Prog@ndy . I have posted my code below. I think the problem has got to do with how i am passing the contents of the file to the database (i have highlighted these lines in red), but i am not sure how else i should deal with it. Thanks for your help #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_InitLibrary() If @error Then Exit MsgBox(0, '', "") MsgBox(0, "DLL Version:",_MySQL_Get_Client_Version()&@CRLF& _MySQL_Get_Client_Info()) $MysqlConn = _MySQL_Init() $connected = _MySQL_Real_Connect($MysqlConn,"localhost","root","holden","music") 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 $connected = _MySQL_Real_Connect($MysqlConn, "localhost", "root", "holden", "music") If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn)) $file=FileOpen("C:\1.bmp",16) if @error <> 0 Then ConsoleWrite("file open error " & @error & @CRLF) Else ConsoleWrite("file " & $file & @CRLF) EndIf $contents=FileRead($file,FileGetSize("c:\1.bmp")) if @error <> 0 Then ConsoleWrite("file read error " & @error & @CRLF) EndIf $query="INSERT INTO album_artwork(artworkID, artwork) values(7," & $contents & ")" ConsoleWrite("file size = " & FileGetSize("c:\1.bmp") & @CRLF) _MySQL_Real_Query($MysqlConn, $query) if @error <> 0 Then ConsoleWrite("SQL statement failed error =" & @error & @CRLF) EndIf exit(0)
-
Hello All, I use ConsoleWrite and ConsoleWriteError in my scripts to show what is happening and to show that the script hasn't locked up which is great in scite. When my script runs as an exe, it shows a little window with an exit button on it so i can stop the script in a controlled manner. Is there any way i can add a console window (like what we have in scite) to display the output of ConsoleWrite and ConsoleWriteError. I get the feeling that i am unable to redirect my own output back into my script, so if anyone has any other suggestions i am interested to know what you do. Thanks
-
Receiving "sendmessage" in a C# application
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
Hello Richard, Thankyou for your reply. I have now got it working and I have got my autoit scripts controlling some apps (woohoo). I was initially using mouse clicks but i had one (3rd party) app that kept on stealling focus, hence this message sending will make the scripts more robust. My appologies to the moderator for asking a C# question on the autoit forum. My intention was to find out what the opposite of the sendmessage function was (e.g. receivemessage) but it obviously didn't come out that way. Anyway, it's all working now -
can you use GetPixelColor on a bitmap without actually showing it on the screen? I want to go through some files and check some colors in them with out having to display them on the screen. e.g. Can I do something like this? _GDIPlus_Startup () $hBitmap = _GDIPlus_BitmapCreateFromFile ($input) $pixel_colour=PixelGetColor($x,$y,$hBitmap) ConsoleWrite("the pixel colour is " & Hex($pixel_colour,6) & @crlf) Thanks
-
is there a way that i can use the pixel search function on a bitmap file rather than just the desktop? or do i need to open the bmp file, display it on the screen in a window and then run the function? Thanks fro your help
-
How do i pass a string to a dll
sambuddy replied to sambuddy's topic in AutoIt General Help and Support
thanks for that. I have tried it but no luck