AutoHotkey Community

It is currently May 27th, 2012, 2:57 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: September 7th, 2009, 8:11 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
:oops:
Sorry for the wrong link/message name with regards to -1, I've corrected above :)


iStart
Index of the item to begin the search with, or -1 to find the first item that matches the specified flags. The specified item itself is excluded from the search.

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2009, 8:19 am 
Offline

Joined: December 19th, 2006, 2:17 pm
Posts: 164
:)
You are great - thank you very much indeed.
Thumbs up and keep up your great work.
:)
EDIT : for the records 3 = LVNI_FOCUSED := 1 | LVNI_SELECTED := 2

_________________
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 9:31 pm 
Offline

Joined: December 19th, 2006, 2:17 pm
Posts: 164
Sorry to bring this up again - I am trying to understand it - this size in the code below shouldn't be an integer :?:
HotKeyIt wrote:
Code:
      RemoteBuf_Read(hPOINT, POINT,size),RemoteBuf_Close(hPOINT)

From code:
HotKeyIt wrote:
Code:
~ENTER::
 hwnd:=WinExist("A")   ; this won't be needed as the shortcut will be in a "ifwinexist" hotkey command
controlgetfocus, cntrlNN ;,A
   if (RegExMatch(cntrlNN, "i)syslistview32")) {   ;if more than one syslistview32 are present
      ControlGet,chwnd,HWND,,%cntrlNN%,ahk_id %hwnd%
;~       ControlGetPos,x,y,,,,ahk_id %chwnd%
      SendMessage,LVM_GETITEMNEXT:=0x100c,-1,3,,ahk_id %chwnd%   ; http://msdn.microsoft.com/en-us/library/bb761057.aspx
      item:=ErrorLevel
      If ErrorLevel=4294967296
         Return
      VarSetCapacity(POINT,16) ;to receive position
      RemoteBuf_Open(hPOINT, hwnd, 8)
      SendMessage,LVM_GETITEMPOSITION:=0x1010,item,RemoteBuf_Get(hPOINT),%cntrlNN%,ahk_id %hwnd% ;http://msdn.microsoft.com/en-us/library/bb761048.aspx
      RemoteBuf_Read(hPOINT, POINT,size),RemoteBuf_Close(hPOINT)
      x:=NumGet(POINT,0)
      y:=NumGet(POINT,4)
      PostMessage, 0x86, 0, ,, ahk_id %chwnd% ; WM_NCACTIVATE
      PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONDOWN
      PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONUP
      PostMessage, 0x203, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONDBLCLCK
      PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONUP
     tooltip x=%x% . y=%y% : %item%
      chwnd=
   }
Return

It works perfectly - I wouldn't have noticed - I am confused. Looking at the code for RemoteBuf_Read() this size is fed to a VarSetCapacity() function :?

_________________
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 10:01 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
It should be 8.
Looking at code of RemoteBuf, it works because of this I think
AutoHotkey Help wrote:
Since this function is often called simply to ensure the variable has a certain minimum capacity, for performance reasons, it shrinks the variable only when RequestedCapacity is 0. In other words, if the variable's capacity is already greater than RequestedCapacity, it will not be reduced (but the variable will still made blank for consistency).

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 17th, 2010, 11:48 pm 
Offline

Joined: December 19th, 2006, 2:17 pm
Posts: 164
Thanks a lot for the prompt reply - I read this, but still I couldn't figure out how big is size :D

Btw why is not VarSetCapacity(POINT,8 ) ?

Hope it's not something (too) obvious :roll:

_________________
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 6:38 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
RECT

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 10:32 am 
Offline

Joined: December 19th, 2006, 2:17 pm
Posts: 164
HotKeyIt wrote:

Danke sehr :)
Was wondering cause apparently (?) a simple point struct would do (see LVM_GETITEMPOSITION)

_________________
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 11:10 am 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
Kein problem :)

I think so, did you try it, does it work as well :?:

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 18th, 2010, 5:31 pm 
Offline

Joined: December 19th, 2006, 2:17 pm
Posts: 164
Yes I think with 8 it is fine - tested and works. So the final iteration is :
Code:
enterL:
hwnd:=WinExist("A")
controlgetfocus, cntrlNN ;,A
if (RegExMatch(cntrlNN, "i)syslistview32")) {
   ControlGet,chwnd,HWND,,%cntrlNN% ;,ahk_id %hwnd%
   SendMessage,LVM_GETNEXTITEM:=0x100c,-1,3,,ahk_id %chwnd%   ; http://msdn.microsoft.com/en-us/library/bb774953.aspx
   item:=ErrorLevel
   ; tooltip item : %item%
   If ErrorLevel=4294967295 ; was 4294967296
      Return
   VarSetCapacity(POINT,8) ;to receive position
   RemoteBuf_Open(hPOINT, hwnd, 8)
   SendMessage,LVM_GETITEMPOSITION:=0x1010,item,RemoteBuf_Get(hPOINT),%cntrlNN% ;,ahk_id %hwnd% ;http://msdn.microsoft.com/en-us/library/bb761048.aspx
   RemoteBuf_Read(hPOINT, POINT,8),RemoteBuf_Close(hPOINT)
   x:=NumGet(POINT,0)
   y:=NumGet(POINT,4)
   PostMessage, 0x86, 0, ,, ahk_id %chwnd% ; WM_NCACTIVATE
   PostMessage, 0x201, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONDOWN
   PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONUP
   PostMessage, 0x203, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONDBLCLCK
   PostMessage, 0x202, 0, X&0xFFFF | Y<<16,, ahk_id %chwnd% ; WM_LBUTTONUP
   }
Return

Final, well, ahem, gkouch
Thanks !

_________________
XP SP3 Pro x32 / 7 x64 Pro - AHK 1.0.48.05


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2010, 4:25 pm 
Offline

Joined: April 19th, 2010, 10:22 pm
Posts: 145
Location: Mobile, AL
Great post guys - I love it when something like this has already been worked out and its ready to plug and play :-) I just tried it on a listview I use at work.. I was thinking about putting in a request to have them setup the listview to accept the enter, your solution worked in seconds - thanks!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: rbrtryn and 28 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group