Vadersapien
Active Members-
Posts
130 -
Joined
-
Last visited
Recent Profile Visitors
309 profile views
Vadersapien's Achievements
Adventurer (3/7)
0
Reputation
-
Ok, that works, and I figured out a crude way to let in work in TabItems(hide and show when needed). My redraw function: Func Redraw($hWnd, $msg, $wParam, $lParam) If GUICtrlRead($LiveControlCommandsTab) = 1 Then _WinAPI_RedrawWindow($hWnd, '', '', $RDW_UPDATENOW) _WinAPI_DrawRotatedText($hGUI, 'Test', 5, 50) _WinAPI_DrawRotatedText($hGUI, 'Test', 25, 50) _WinAPI_DrawRotatedText($hGUI, 'Test', 45, 50) _WinAPI_DrawRotatedText($hGUI, 'Test', 65, 50) Else _WinAPI_RedrawWindow($hWnd) EndIf Return $GUI_RUNDEFMSG EndFunc Is there a better way to do it?
-
Thanks, your bottom one works perfect when using it more than once. I found out the top one didn't because of the _WinAPI_RedrawWindow(). However now I am faced with another problem: The text will disappear when the windows is hidden, then shown again, or even after a minimize and restore. Any way to fix this? EDIT: What about drawing the text in a TabItem? I haven't been able to find to do so.
-
One prob with the WinAPI method though. I managed to put it all in a function, but it only allows me to draw one lot of text at a time.
-
I think I've just about searched the whole forum for this and haven't found anything(correct me if I'm wrong). Is there a way to have a label control displays text vertically? Or maybe rotate the control? Would it be possible to achieve this with GDI+ maybe?
-
Just an example of a simple crash detector: Only disadvantage is that you must call CleanUp() every time before you use Exit. #include <GUIConstants.au3> Opt('TrayIconHide', True) $AppCrash = IniRead('CrashData.ini', 'CrashData', 'appcrash', 'Unknown') If $AppCrash = 'true' Then MsgBox(-1, 'Info', 'The script crashed last time it was used') EndIf IniWrite('CrashData.ini', 'CrashData', 'AppCrash', 'true') GUICreate('Crash Detector', 250, 40) $CrashSim = GUICtrlCreateButton('Simulate Crash', 5, 5, 115, 30) $Exit = GUICtrlCreateButton('Exit', 130, 5, 115, 30) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE CleanUp() Case $Exit CleanUp() Case $CrashSim Exit EndSwitch WEnd Func CleanUp() GUIDelete() IniWrite('CrashData.ini', 'CrashData', 'AppCrash', 'false') Exit EndFunc
-
Download files with progress
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
Tested it on 7 and and only the 2nd and 4th progress bars work. The others don't budge. According to the console they aren't being downloaded either... The small ones seem to work fine though. Maybe a queue would be more suitable(the general idea would be to push the files into an array and read off that, wouldn't it?). Another thing I'd like to do is fire off a function to manipulate those files once downloaded(in this case extracting, I should be able to do that with the ZLib UDF) -
Download files with progress
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
I had read the help for InetGet prior to posting this thread. Tried to implement it in my code, but it didn't work. Tried again from a fresh script. It worked. Here's how far I got: #include <GUIConstants.au3> Local $hGUI = GUICreate('Download File', 800, 70) Local $Progress = GUICtrlCreateProgress(10, 10, 780, 20) DirCreate(@TempDir & '\RS Media Manager\') GUISetState() _RSMWare_GetData('http://10.0.0.5/rsmware/rsmware.ini', @TempDir & '\RS Media Manager\rsmware.ini') GUICtrlCreateButton('Button', 10, 40, 780, 20) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete() DirRemove(@TempDir & '\RS Media Manager', 1) Exit EndSwitch WEnd Func _RSMWare_GetData($url, $target) $hDownload = InetGet($url, $target, 1, 1) Do GUICtrlSetData($Progress, Ceiling((InetGetInfo($hDownload, 0)/InetGetInfo($hDownload, 1))*100)) Until InetGetInfo($hDownload, 2) InetClose($hDownload) MsgBox(Default, '', IniRead(@TempDir & '\RS Media Manager\rsmware.ini', 'Alarm Clock', 'Author', 'Unknown')) EndFunc Because of the Do...Until loop in the function it "removes" the entire "background downloading" feature...is there a way to fix this? Also I haven't been able to figure out a way to download multiple files at once...could anyone help with this -
Hi, I know this is probably quite simple, but I'd like to know how to download a file(in the background) and put the amount downloaded in the progress bar. I'd like to be able execute a function when the download finishes, as well as allowing the script to continue while downloading the files. It is a folder of files that will change quite contantly, so a file list can't be hardcoded.
-
Not a simple as I though it'd be. I my original idea was to just set the window style to $WS_POPUP with this code: If WinExists('GIMP Startup') Then _WinAPI_SetWindowLong(WinGetHandle('GIMP Startup'), $GWL_STYLE, $WS_POPUP) however that doesn't work properly(I'll get double progress bars, a white title bar or I completely white window). By the way, this is GIMP 2.7 Any Suggestions?
-
[Solved] Read .ini file from internet
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
I solved my problem(finally) The ini file had to be uploaded in binary mode for it to parse correctly...though I find it weird how the section names still read when uploaded in text mode Is there a way I can mark the thread resolved at all? -
[Solved] Read .ini file from internet
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
Oh that's because I've been adding code all over the place since it's a test environment I was gonna clean all that up once I merged it into my actual program. If you saw how I MsgBoxed the contents of the local and downloaded ini, both return the exact same contents...maybe I'm just gonna have to download it first... -
[Solved] Read .ini file from internet
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
Well, here is my entire code: #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <IniString.au3> #include <WindowsConstants.au3> Local $var = IniStringReadSectionNames(BinaryToString(InetRead('http://10.0.0.5/rsmware/rsmware.ini'))) Local $listview, $hImage $inet = BinaryToString(InetRead('http://10.0.0.5/rsmware/rsmware.ini')) MsgBox(-1, '', FileRead(FileOpen("rsmware.ini", 0))) MsgBox(-1, '', $inet) GUICreate('Test GUI', 800, 600) MsgBox(-1, '', IniStringRead($inet, 'Alarm Clock', 'Author', 'Error')) $appname = GUICtrlCreateLabel('', 250, 10, 450, 20) $appauthor = GUICtrlCreateLabel('', 250, 30, 450, 20) $appver = GUICtrlCreateLabel('', 250, 50, 450, 20) $appinfo = GUICtrlCreateLabel('', 250, 70, 450, 500) $listview = GUICtrlCreateListView('', 0, 0, 200, 600, BitOr($LVS_SORTASCENDING, $LVS_SHOWSELALWAYS, $LVS_SINGLESEL, $LVS_NOCOLUMNHEADER)) GUISetState() GUIRegisterMsg($WM_NOTIFY, '_WM_NOTIFY') _GUICtrlListView_AddColumn($listview, 'Column 1', 196) _GUICtrlListView_BeginUpdate($listview) For $i = 1 To $var[0] _GUICtrlListView_AddItem($listview, $var[$i], $i-1) Next _GUICtrlListView_EndUpdate($listview) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Func _WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndListView $hWndListView = $listview If Not IsHWnd($listview) Then $hWndListView = GUICtrlGetHandle($listview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) Switch HWnd(DllStructGetData($tNMHDR, "hWndFrom")) Case $hWndListView Switch DllStructGetData($tNMHDR, "Code") Case $NM_CLICK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $SelectedIndices = _GUICtrlListView_GetSelectedIndices($listview, True) If UBound($SelectedIndices) = 2 Then $SelectedApp = _GUICtrlListView_GetItemText($listview, $SelectedIndices[1]) GUICtrlSetData($appname, $SelectedApp) MsgBox(-1, '', IniStringRead($inet, 'Alarm Clock', 'Author', 'Error')) GUICtrlSetData($appver, 'Version ' & IniStringRead($inet, $SelectedApp, 'Version', '')) GUICtrlSetData($appinfo, IniStringRead($inet, $SelectedApp, 'Description', '')) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Don't bother testing the code, it won't work since I'm using local IP addresses. Figured out how to address detecting if there's no internet or the server is down, all I had to do was ping the server and check the result. Still don't know why it locks up while downloading though. Also found out that using _InetGetSource() with the AutoIt update.dat works fine too... -
[Solved] Read .ini file from internet
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
Hmm...another problem...I can only parse files off the hard disk(via fileread) with _IniString_Read(). Ones from the internet(via _InetGetSource() or InetRead) won't work for some reason... -
[Solved] Read .ini file from internet
Vadersapien replied to Vadersapien's topic in AutoIt General Help and Support
Thanks! Nice UDF too. It's exactly what I was looking for...I did quite a thorough search of the forums, yet it didn't show up...maybe I was just the wrong keywords Functionality like this should be included in AutoIt! EDIT: One problem: The script locks up while downloading the file, or if there is no internet access. Any idea how to avoid that? -
Hi, Just wondering if you can use icons larger than 32x32px in an imagelist. Even with $fLarge set to True it still only extracts the 32x32px icon, even though the file has resolutions all the way up to 256x256...