Jump to content

Psibernetic

Active Members
  • Posts

    126
  • Joined

  • Last visited

About Psibernetic

  • Birthday 04/05/1991

Profile Information

  • Location
    Oklahoma City, Oklahoma
  • Interests
    Programming....Gaming....Building Custom PCs....Teaching others programming.....learning anything tech-oriented

Psibernetic's Achievements

Adventurer

Adventurer (3/7)

0

Reputation

  1. This could help you. Takes a bit of mathematically manipulating the ratio of size from $GUI_Height to your IE control. GUIRegisterMsg($WM_SIZE, "WM_SIZE") Func WM_SIZE($hWnd, $iMsg, $iwParam, $ilParam) $GUI_Height=_WinAPI_GetWindowHeight($GUI) $GUI_Width=_WinAPI_GetWindowWidth($GUI) GUICtrlSetPos() ;Set new size based on new GUI size Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE
  2. I am having issues trying to detect a doublelclick in a listview control. According to smashly, the issue is with an int in the $tagNMHDR struct not being converted to int64. I need assistance correcting this, whether in the struct or a workaround (other than running 32bit). The following link is to the discussion, few months old now. http://www.autoitscript.com/forum/index.php?showtopic=100148&st=0&p=771136&#entry771136 Some code that only notifies me with a msgbox when I run 32bit: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $Form1 = GUICreate('boo', 361, 270, 200, 200) ;~ Create listview $hListView = GUICtrlCreateListView( "", 0, 0, 260, 377) ; LEFT],[TOP],WIDTH],[HEIGHT] _GUICtrlListView_SetExtendedListViewStyle ($hListView, BitOR($LVS_AUTOARRANGE,$LVS_EX_FULLROWSELECT,$LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES,$LVS_EX_ONECLICKACTIVATE)) ; Add columns _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 150) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE ;~ ======================================================== ;~ This thing is responsible for click events ;~ ======================================================== Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_ITEMACTIVATE ; Sent by a list-view control when the user double-clicks an item with the left mouse button Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $Index = DllStructGetData($tInfo, "Index") $subitemNR = DllStructGetData($tInfo, "SubItem") ; make sure user clicks on the listview & only the activate If $Index <> -1 Then ; col1 ITem index $item = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $Index),'|') $item = $item[1] ;Col item 2 index $item2 = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $subitemNR),'|') $item2= $item2[2] MsgBox(0,"",$item & ' ' & $item2 & @CRLF) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  3. I am not setup to test this script so I cannot just debug, however it looks like you are using COM (OLE) to write to Excel. The COM Object for Excel could be encountering an error, try installing an error handler like this: Global $g_eventerror = 0 ; to be checked to know if com error occurs. Must be reset after handling. $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler ; This is my custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Windescription is: " & $oMyError.windescription & @CRLF& "Error was on line: " & $oMyError.scriptline) $g_eventerror = 1 ; something to check for when this function returns Endfunc
  4. Not sure if I can help, but will try. First, you INI you posted the first section [App1] is missing a square bracket: App1] . If that doesn't help, can you post your full code. Those snippets are vague.
  5. I am having issues trying to detect a doublelclick in a listview control. According to smashly, the issue is with an int in the $tagNMHDR struct not being converted to int64. I need assistance correcting this, whether in the struct or a workaround (other than running 32bit). The following link is to the discussion, few months old now. http://www.autoitscript.com/forum/index.php?showtopic=100148&st=0&p=771136&#entry771136 Some code that only notifies me with a msgbox when I run 32bit: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $Form1 = GUICreate('boo', 361, 270, 200, 200) ;~ Create listview $hListView = GUICtrlCreateListView( "", 0, 0, 260, 377) ; LEFT],[TOP],WIDTH],[HEIGHT] _GUICtrlListView_SetExtendedListViewStyle ($hListView, BitOR($LVS_AUTOARRANGE,$LVS_EX_FULLROWSELECT,$LVS_EX_DOUBLEBUFFER,$LVS_EX_SUBITEMIMAGES,$LVS_EX_ONECLICKACTIVATE)) ; Add columns _GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 150) ; Add items _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddItem($hListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE ;~ ======================================================== ;~ This thing is responsible for click events ;~ ======================================================== Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iCode, $tNMHDR, $hWndListView $hWndListView = $hListView If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $LVN_ITEMACTIVATE ; Sent by a list-view control when the user double-clicks an item with the left mouse button Local $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $Index = DllStructGetData($tInfo, "Index") $subitemNR = DllStructGetData($tInfo, "SubItem") ; make sure user clicks on the listview & only the activate If $Index <> -1 Then ; col1 ITem index $item = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $Index),'|') $item = $item[1] ;Col item 2 index $item2 = StringSplit(_GUICtrlListView_GetItemTextString($hListView, $subitemNR),'|') $item2= $item2[2] MsgBox(0,"",$item & ' ' & $item2 & @CRLF) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  6. I am having same issue. I cannot however find an example of using $LVN_ITEMACTIVATE to bypass this issue, can I get an example or link to one? I solved this by editing $tagNMHDR in StructureConstants.au3 include to: Switch @OSArch Case "X86" Global $tagNMHDR = "hwnd hWndFrom;int IDFrom;int Code" Case "X64" Global $tagNMHDR = "hwnd hWndFrom;int64 IDFrom;int Code" EndSwitch I dislike that I had to make it a variable and not a constant, but this code generates errors if it is a Const, due to the conditional statement.
  7. I am trying to change the genre and comment field in the file properties of any number of .mp3 files. I have looked into ID3COM and cannot find any documentation on its calls. DSOFile only seems to support office files. Can anyone point me in the right direction, I figure COM will be the route I go down. Any help is a blessing.
  8. Figured it out... Help file just confused me. By using _GuiImageList($SizeX, $SizeY, $ColorDepth, 1) Where the 1 is the option for "Use a mask" it uses the Icons built in mask. DUH! ...I'll leave this info here in case anyone else makes this mistake.
  9. How can I get the transparency to pass through correctly? I have read a few things about this issue on the web and have not figured a way out to fix this yet. Any help is greatly appreciated.
  10. What it turned out to be is Global variables were holding com methods: $iTunesApp.selectedTrack() so returning them from a function works fine, but clearing out the globals ="" doesnt work for whatever the reason.
  11. Hey Torels I'm using this in a huge program I am working on, you saved my life with predefining these COM calls for me. Also I am having an issue unregistering this COM event...iTunes feels it still must prompt that the COM interface is still in use...even though its not any ideas?
  12. @Hunter, IKilledBambi is correct, you should be looking over tutorials and the incredibly helpful help file AutoIt has for us. You can access it just by pressing F1 in SciTE. Also, he just made a suggestion. If it wasn't what you were looking for try to say so in a nicer way. here are a few links that may help: Loop Tutorial and Examples Refrence Guide to GUI creation ALSO, plz don't bump when your post isn't even an hour old... you are pushing others (including mine) off the Topic List.
  13. Something like this may be what you need. #include <Misc.au3> HotKeySet ( "{F1}", _HoldF2() ) Func _HoldF2() While _isPressed(70) Send("{F1 down}") WEnd Send("{F1 up}") Return 1 EndFunc I didn't test this. Far too much work to write a reader to detect which keys are being pressed for a help post, but this should get you off on the right track regardless.
  14. Try this: Dim $Test[3] = ["0xffffff",125,500] only thing really different is the explicit need to dimension array with a Ubound (last index in the array), calling is the same. msgbox(0, "test of index", $Test[0]) replace $Test[0] with $Test[1] and so on
×
×
  • Create New...