 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Steven Chisholm
Joined: 23 May 2007 Posts: 2
|
Posted: Mon Jun 11, 2007 8:20 pm Post subject: DllCall and ComCtl32.dll |
|
|
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 |
|
 |
JGR
Joined: 15 Jun 2006 Posts: 52 Location: Unavailable until ~30th August
|
Posted: Mon Jun 11, 2007 8:37 pm Post subject: |
|
|
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 |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Tue Jun 12, 2007 12:41 pm Post subject: |
|
|
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...
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 |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|