Jump to content

Datus

Active Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by Datus

  1. Cheers, works with 2008 server as well
  2. just to let you know i found this very usefull. ive been using code to check where mouse pointer was and change the icon. this is much better and reduced the complexity of the code i had to do.
  3. Hope you never get to see a proper whine if you think people have been whining on this post. The comments are to make people aware and how to over come them. Heres a WHINE. A previous compiler ok newer one isnt, if there is A history of AV not liking the compiler it cant be hard before releasing a new version to test it before launch to see if the most popular AV's have an issue. But didnt want to post that........
  4. i have the same problem today when i upgraded the script compiler. fix was to un-install it and install and older version. hope they fix the issue on next release.
  5. Well done thanks very much. When i get a chance i will study the code to see how you cracked it but will use it in my program. Cheers!
  6. interesting. i have searched my drive for that example but no luck atm. had 1 pc and 2 laptops since then ;0
  7. not sure what you mean. doesnt make a different how many charactors i use? i think i need api calls or something
  8. spent a while looking through forums but not luck. in my mind im sure i have found this before but was over a year ago doh. anyway what i am trying to do is scroll a label (text) over a backdrop without flicker. here is the code #include "GUIConstantsEx.au3" #include "StaticConstants.au3" $main=GUICreate("A window", 400, 150) $picl = GUICtrlCreatePic(@WorkingDir & "\backdrop.jpg", 0, 0, 400, 150) GUICtrlSetState(-1, $GUI_DISABLE) $labell = GUICtrlCreateLabel("this is label over image" &@CRLF& " and even more text", 00, 10, 400, 65, $SS_CENTER) GUICtrlSetFont(-1, 14) GUICtrlSetColor(-1, 0x000000) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Close = GUICtrlCreateButton("Close", 350, 35, 60, 40) GUISetState(@SW_SHOW, $main) GUISetState() For $i = 150 To 0 Step -1 ; Nedd to look for this within loop $msg = GUIGetMsg() If $msg = $Close Then GUIDelete($main) Exit EndIf GUICtrlSetPos($labell, 1, $i) Sleep(45); Needed despite GUIGetMsg to slow the scroll! Next
  9. that fine if you know what your going to put in the label. however i read a file with film names in which can be multiple words etc. just as my example code shows at the start. was just responding to comments made by codybarret
  10. one thing i want to do is put text from bottom up. you cant do that with a label. or can you?
  11. ive used a label instead. still doesnt give exaclty the control i wanted but better than the button in present form. wish they would spend some more time sorting out gui controls and settings rather than adding even more complicated functions. spend more time trying work arrounds than coding these days. But still i love Autoit and wouldnt be without it.
  12. Cant see whats wrong here but as soon as you set the color of the button the styles are ignored and text is placed at the top of the button. Im probably using the wrong command to change color but tried it with built in code designer to make sure. Any ideas? #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUICreate("My GUI Button") $Button_1 = GUICtrlCreateButton("Run Notepad", 10, 30, 100,100,$BS_BOTTOM) $Button_2 = GUICtrlCreateButton("Button Test", 10, 140, 100,100,$BS_BOTTOM) GUICtrlSetBkColor(-1, 0x00ff00) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd not found anything on search.
  13. Ive put it in public documents and it works fine. Thanks for the replies. I will look at FileOpenDialog at a later date. Cheers again.
  14. Bits relevant here. I run the program from Program Files. #RequireAdmin #region;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_run_tidy=y #AutoIt3Wrapper_run_obfuscator=y #endregion;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIListBox.au3> #include <file.au3> #include <Array.au3> #include <GUIConstants.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <Date.au3> Global $LastUpdatedFile $LastUpdatedFile = @WorkingDir & "\_LastUpdatedFile.txt" $CheckOk = FileOpen($LastUpdatedFile, 1);Section Open Files Note: Open synopsis text files if requested later! If $CheckOk = -1 Then MsgBox(0, $CheckOk & ":Open error with file:", $LastUpdatedFile) Exit EndIf EndIf comes back with -1
  15. My code wont work (opening files etc) unless i run as administrator by right clicking the .exe I remember this being an issue with Vista and Autoit removed the need. I have put #RequireAdmin at the top of my code but doesnt work. I am logging in as a Domain Admin user. Any Ideas for a work arround? or am I missing something.
  16. Thank you it worked. Wasnt sure if the .5 was needed when I looked at Int before i posted. Was looking for the old Val type command but couldnt find it. Anyway thanks again and hopefully this will help others.
  17. I am trying to read a file with the julian date stored. I read the date into a variable but when I pass it to _dayvaluetodate it returns nothing. Do i need a special declaration or something. $DatesFile="2454950.5";possible doesnt like string _DayValueToDate ($DatesFile , $Y, $M, $D) MsgBox(0,"date=",$Y) MsgBox(0,"date=",$M) MsgBox(0,"date=",$D)
  18. when you reply you will notice the options for bold italic icons etc well to the far right there is an option called "wrap in code tags" For simplicity paste your code in to the reply. Highlight it all then click the icon. You will see [ code ] appear at the start and [ / code ] at the end without spaces. Click preview post to see if its worked. Job Done......
  19. Cheers works using the example given. Just wanted to make sure there wasnt an easier way. #include <Date.au3> ; Julian date of today $Daysleft=58 $sJulDate = _DateToDayValue (2009, 01, 01) MsgBox(4096, "", "Todays Julian date is: " & $sJulDate) $sJulDate = $sJulDate + $Daysleft ; YDAY difference calculation Dim $Y, $M, $D $sJulDate = _DayValueToDate ($sJulDate+@YDAY-1, $Y, $M, $D) MsgBox(4096, "", "@YDAY difference from 2009-01-01: " & $Y & "/" & $M & "/" & $D)
  20. Trying to find a way to convert @YDAY variable (gives the day of the year) to a date eg YYYYMMDD Tried help and search forum but nothing so far. Any Idea's Background info. Reason I want to do this is to predict when a drive will fill. I find out how many days it will take to fill it then add it to @YDAY and then display that in a format anyone can understand.
  21. Thanks for both replies Martin. I see what you've done which is to read the list after sorting and re-apply the colours. I have amended the code for others in the sort area to count how many rows there are in the list as my example populated it with 10 records but real world code there will be random number of records. Hope one day Autoit can pump some developement time into perhaps making these type of GUI handling issues a bit easier. #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <windowsconstants.au3> Dim $DispArray[1][5] GUICreate("(Internal) ListView Set Item State", 750, 550, -1, -1) $hListView = GUICtrlCreateListView("Status|Server|Drv|GB Total", 125, 25, 610, 430) GUISetState() $B_DESCENDING = _GUICtrlListView_GetColumnCount($hListView) ;GUIRegisterMsg($WM_NOTIFY, "SortView") ; _GUICtrlListView_BeginUpdate($hWnd) ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0xFF0000, 16, 16));Red _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0xffff00, 16, 16));Yellow _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap(GUICtrlGetHandle($hListView), 0x00FF00, 16, 16));Green _GUICtrlListView_SetImageList($hListView, $hImage, 2);2 seems to insert a column to allow you to put an image in ; Set columns width _GUICtrlListView_SetColumnWidth($hListView, 0, 80) _GUICtrlListView_SetColumnWidth($hListView, 1, 80) _GUICtrlListView_SetColumnWidth($hListView, 2, 80) _GUICtrlListView_SetColumnWidth($hListView, 3, 80) For $x = 1 To 10 $DispArray[0][0] = $x $DispArray[0][1] = "Server" $DispArray[0][2] = "Warning2" $DispArray[0][3] = "Warning3" _GUICtrlListView_AddArray($hListView, $DispArray) Next For $x = 0 To 9 If $x = 5 Then _GUICtrlListView_SetItemStateImage($hListView, $x, 1);pick colour 1 = red ElseIf $x = 7 Then _GUICtrlListView_SetItemStateImage($hListView, $x, 2);pick colour 2 = yellow Else _GUICtrlListView_SetItemStateImage($hListView, $x, 3);pick colour 3 = green EndIf Next GUIRegisterMsg($WM_NOTIFY, "SortView") Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Exit Func SortView($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $ListRowCount $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_COLUMNCLICK; A column was clicked Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) _GUICtrlListView_SimpleSort($hWndListView, $B_DESCENDING, DllStructGetData($tInfo, "SubItem")) ; No return value EndSwitch EndSwitch $ListRowCount = _GUICtrlListView_GetItemCount($hListView) For $x = 0 To $ListRowCount -1 If _GUICtrlListView_GetItemText($hWndListView, $x) = 5 Then _GUICtrlListView_SetItemStateImage($hListView, $x, 1);pick colour 1 = red ElseIf _GUICtrlListView_GetItemText($hWndListView, $x) = 3 Then _GUICtrlListView_SetItemStateImage($hListView, $x, 2);pick colour 2 = yellow Else _GUICtrlListView_SetItemStateImage($hListView, $x, 3);pick colour 3 = green EndIf Next ;Return $GUI_RUNDEFMSG EndFunc ;==>SortView
  22. Nope it did't work with this sort routine, any sugestions or back to my original question. #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> Dim $DispArray [1] [4] GUICreate("(Internal) ListView Set Item State", 750,550, -1, -1) $hListView = GUICtrlCreateListView("Status|Server|Drv|GB Total", 125,25,610,430) GUISetState() $B_DESCENDING=_GUICtrlListView_GetColumnCount ($hListView) GUIRegisterMsg($WM_NOTIFY, "SortView") ; Load images $hImage = _GUIImageList_Create () _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0xFF0000, 16, 16));Red _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0xffff00, 16, 16));Yellow _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0x00FF00, 16, 16));Green _GUICtrlListView_SetImageList ($hListView, $hImage, 2);2 seems to insert a column to allow you to put an image in ; Set columns width _GUICtrlListView_SetColumnWidth ($hListView, 0, 80) _GUICtrlListView_SetColumnWidth ($hListView, 1, 80) _GUICtrlListView_SetColumnWidth ($hListView, 2, 80) _GUICtrlListView_SetColumnWidth ($hListView, 3, 80) For $x = 1 to 10 $DispArray [0] [0] = $x $DispArray [0] [1] = "Server" $DispArray [0] [2] = "Warning2" $DispArray [0] [3] = "Warning3" _GUICtrlListView_AddArray($hListView,$DispArray ) If $x = 5 then _GUICtrlListView_SetItemStateImage ($hListView, 0, 1);pick colour 1 = red ElseIf $x = 7 then _GUICtrlListView_SetItemStateImage ($hListView, 0, 2);pick colour 2 = yellow Else _GUICtrlListView_SetItemStateImage ($hListView, 0, 3);pick colour 3 = green EndIf Next Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Exit Func SortView($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_COLUMNCLICK; A column was clicked Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) _GUICtrlListView_SimpleSort ($hWndListView, $B_DESCENDING, DllStructGetData($tInfo, "SubItem")) ; No return value EndSwitch EndSwitch ;Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  23. Took a bit of messing to get it to work but here is the code for others #include <GuiConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> Dim $DispArray [1] [4] GUICreate("(Internal) ListView Set Item State", 750,550, -1, -1) $hListView = GUICtrlCreateListView("Status|Server|Drv|GB Total", 125,25,610,430) GUISetState() ; Load images $hImage = _GUIImageList_Create () _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0xFF0000, 16, 16));Red _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0xffff00, 16, 16));Yellow _GUIImageList_Add ($hImage, _GUICtrlListView_CreateSolidBitMap (GUICtrlGetHandle($hListView), 0x00FF00, 16, 16));Green _GUICtrlListView_SetImageList ($hListView, $hImage, 2);2 seems to insert a column to allow you to put an image in ; Set columns width _GUICtrlListView_SetColumnWidth ($hListView, 0, 80) _GUICtrlListView_SetColumnWidth ($hListView, 1, 80) _GUICtrlListView_SetColumnWidth ($hListView, 2, 80) _GUICtrlListView_SetColumnWidth ($hListView, 3, 80) For $x = 1 to 10 $DispArray [0] [0] = $x $DispArray [0] [1] = "Server" $DispArray [0] [2] = "Warning2" $DispArray [0] [3] = "Warning3" _GUICtrlListView_AddArray($hListView,$DispArray ) If $x = 5 then _GUICtrlListView_SetItemStateImage ($hListView, 0, 1);pick colour 1 = red ElseIf $x = 7 then _GUICtrlListView_SetItemStateImage ($hListView, 0, 2);pick colour 2 = yellow Else _GUICtrlListView_SetItemStateImage ($hListView, 0, 3);pick colour 3 = green EndIf Next Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() Exit Now this is the bit I will test next and that is column sorting. Will advise if this works or not.
  24. Yes I have been looking at those examples. Just had another go and managed to get something. I will post my results in the next few hours whilst I evaluate the results. Thanks for replying.......
  25. Im building an array with values in it which I then use to populate a row on a list view. What i am trying to achieve is to show a square (or .jpg if need be) yellow or red as warning symbols. This is how i build my array Dim $DispArray [1] [8] $DispArray [0] [0] = "Warning0" $DispArray [0] [1] = "Warning1" $DispArray [0] [2] = "Warning2" $DispArray [0] [3] = "Warning3" $DispArray [0] [4] = "Warning4" $DispArray [0] [5] = "Warning5" $DispArray [0] [6] = "Warning6" $DispArray [0] [7] = "Warning7" What I would like to do is something like this $DispArray [0] [0] = _CreateSolidBitMap (0xFF0000, 16, 16) I then use the array to populate the list _GUICtrlListView_AddArray($FilmListDisp,$DispArray ) Anyone got any easy idea's. I have spent some time searching forum etc but its not been fruitfull.
×
×
  • Create New...