AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DllCall and ComCtl32.dll

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Steven Chisholm



Joined: 23 May 2007
Posts: 2

PostPosted: Mon Jun 11, 2007 8:20 pm    Post subject: DllCall and ComCtl32.dll Reply with quote

I have not been able to get any function inside ComCtl32.dll to be found. Here is an example function call. I've tried many variations and on 2 computers, so I believe it is a bug.

Code:
DllCall("ComCtl32.dll\ListView_SetSelectionMark","UInt",HWND,"UInt",1)   ;ErrorLevel = -4


ErrorLevel = -4 (Function not found in DLL)
Back to top
View user's profile Send private message
JGR



Joined: 15 Jun 2006
Posts: 52
Location: Unavailable until ~30th August

PostPosted: Mon Jun 11, 2007 8:37 pm    Post subject: Reply with quote

There is no function called ListView_SetSelectionMark in comctl32.dll

Look at http://msdn2.microsoft.com/en-us/library/ms671362.aspx

MS commctrl.h says:
#define ListView_SetSelectionMark(hwnd, i) \
(int)SNDMSG((hwnd), LVM_SETSELECTIONMARK, 0, (LPARAM)(i))

#define LVM_SETSELECTIONMARK (LVM_FIRST + 67)

#define LVM_FIRST 0x1000 // ListView messages

Hence: should be something like:
SendMessage 0x1000+67,0, 1, , ahk_id %HWND%
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Tue Jun 12, 2007 12:41 pm    Post subject: Reply with quote

In other words, Microsoft describes them as macro functions, meaning they are not real functions to be called with DllCall, but rather wrappers, syntax sugar hiding, under a familiar look, some barbaric method... Wink
These macros cannot be used outside the C-family languages.
As JGR advises, you have to use SendMessage (often documented at the same place).
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group