Re: WinAPI LowLevel Keyboard Hooks

2012-07-21 Thread torhu
On 19.07.2012 13:45, DLimited wrote: Hello everyone, I had this great idea of writing a Program that intercepts all keyboard presses and modifies them in certain cases. I want to use it as some kind of global makro program to run in the background and for example allow me to easily post unicode

WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
Hello everyone, I had this great idea of writing a Program that intercepts all keyboard presses and modifies them in certain cases. I want to use it as some kind of global makro program to run in the background and for example allow me to easily post unicode smileys. This is where the probelms

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread David
Unfortunately there are two versions of this function, SetWindowsHookExW and SetWindowsHookExA. What's the difference? The W-Function is the Unicode version and the A is the ANSI version. Showing the code of your DLL might help.

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
But what are the differences of loading the Unicode version vs. the ANSI version? I called the Unicode one because I figured that would be the sensible choice, since Unicode is the default for D (if I remember correctly). I have no clue what the actual effects of calling the wrong version

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread dnewbie
On Thursday, 19 July 2012 at 15:49:48 UTC, DLimited wrote: But what are the differences of loading the Unicode version vs. the ANSI version? I called the Unicode one because I figured that would be the sensible choice, since Unicode is the default for D (if I remember correctly). I have no

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
I guess you have to 'export' the function: extern (Windows) export LRESULT LowLevelKeyboardProc(int code, WPARAM wParam, LPARAM lParam) and include EXPORTS LowLevelKeyboardProc in the .DEF file Thanks, I changed that. Also, I changed LoadLibraryW( ) to LoadLibraryA( ) in the main program

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
On Thursday, 19 July 2012 at 16:38:19 UTC, DLimited wrote: I guess you have to 'export' the function: extern (Windows) export LRESULT LowLevelKeyboardProc(int code, WPARAM wParam, LPARAM lParam) and include EXPORTS LowLevelKeyboardProc in the .DEF file Thanks, I changed that. Also, I

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread dnewbie
You don't see the WHOA message? Try this alias HANDLE HHOOK;

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
On Thursday, 19 July 2012 at 17:35:29 UTC, dnewbie wrote: You don't see the WHOA message? Try this alias HANDLE HHOOK; No, I don't get any message after key-presses. I changed int function() to HANDLE, sadly it still doesn't work.

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread dnewbie
On Thursday, 19 July 2012 at 17:48:06 UTC, DLimited wrote: On Thursday, 19 July 2012 at 17:35:29 UTC, dnewbie wrote: You don't see the WHOA message? Try this alias HANDLE HHOOK; No, I don't get any message after key-presses. I changed int function() to HANDLE, sadly it still doesn't work.

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
On Thursday, 19 July 2012 at 18:40:15 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 17:48:06 UTC, DLimited wrote: On Thursday, 19 July 2012 at 17:35:29 UTC, dnewbie wrote: You don't see the WHOA message? Try this alias HANDLE HHOOK; No, I don't get any message after key-presses. I changed

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread dnewbie
On Thursday, 19 July 2012 at 18:56:15 UTC, DLimited wrote: On Thursday, 19 July 2012 at 18:40:15 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 17:48:06 UTC, DLimited wrote: On Thursday, 19 July 2012 at 17:35:29 UTC, dnewbie wrote: You don't see the WHOA message? Try this alias HANDLE

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
On Thursday, 19 July 2012 at 19:43:45 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 18:56:15 UTC, DLimited wrote: On Thursday, 19 July 2012 at 18:40:15 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 17:48:06 UTC, DLimited wrote: On Thursday, 19 July 2012 at 17:35:29 UTC, dnewbie wrote:

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread dnewbie
On Thursday, 19 July 2012 at 19:51:31 UTC, DLimited wrote: Yes, I did. Are the newlines important? And you really get a MessageBox per keystroke? I start as admin, disabled my AV but still, no success. Yes, I get 2 WHOA messages. One from the WM-KEYDOWN and the other from WM-KEYUP. Sorry I

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread DLimited
On Thursday, 19 July 2012 at 20:06:55 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 19:51:31 UTC, DLimited wrote: Yes, I did. Are the newlines important? And you really get a MessageBox per keystroke? I start as admin, disabled my AV but still, no success. Yes, I get 2 WHOA messages. One

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread Mike Parker
On 7/20/2012 5:17 AM, DLimited wrote: On Thursday, 19 July 2012 at 20:06:55 UTC, dnewbie wrote: On Thursday, 19 July 2012 at 19:51:31 UTC, DLimited wrote: Yes, I did. Are the newlines important? And you really get a MessageBox per keystroke? I start as admin, disabled my AV but still, no

Re: WinAPI LowLevel Keyboard Hooks

2012-07-19 Thread Mike Parker
On 7/20/2012 12:49 AM, DLimited wrote: But what are the differences of loading the Unicode version vs. the ANSI version? You should always be using the Unicode version of Win32 functions in new applications. AFAIK, the ANSI versions call the Unicode versions internally, but do a conversion