| View previous topic :: View next topic |
| Author |
Message |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Sun Jan 29, 2006 9:03 pm Post subject: DllCall-Support for X10 remote controls (i.e.Notebooks) |
|
|
Hi,
my Aldi Medion Notebook MD96500 has a X10.com remote control, which is not recognized as HID-USB-Device nor by winlirc.
After a long research I have found the X10 SDK to support the remotecontrol in your own applications.
Time to write a DLL to use with AHK for remote controlling apps with my remote control.
In the function DoAction you receive the Key and the state (pressed/released). Thus you can expand the script very easy.
if Command = "louder" then rise the volume
if Command = "2" switch to channel 2 in your TV-APP
...
...
If you have problems please Mail me or post in that thread
The DLL: http://www.autohotkey.net/~Micha/X10/AutohotkeyRemoteX10.dll
The script: http://www.autohotkey.net/~Micha/X10/X10RemoteControl.ahk
If you have problems to get the dll working, you will need new MS-Dlls (mfc80.dll, msvcr80.dll) please download the 2 Archives, unpack them and start the vcredist_x86.exe. It will install the needed dlls
http://www.autohotkey.net/~Micha/vcredist_x86.sfx.part1.exe
http://www.autohotkey.net/~Micha/vcredist_x86.sfx.part2.rar
There's a uploadlimit of 2 MB, thus I had to split the Archives
Ciao
Micha
Last edited by Micha on Thu Feb 02, 2006 11:35 am; edited 2 times in total |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Mon Jan 30, 2006 12:13 am Post subject: |
|
|
Nice looking package. Now, when anyone searches for X10 or similar, they will find a ready-made solution thanks to you  |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Thu Feb 02, 2006 11:36 am Post subject: |
|
|
| Updated links. Add mfc-dlls in a package |
|
| Back to top |
|
 |
Muffy Guest
|
Posted: Thu Feb 16, 2006 11:57 am Post subject: H |
|
|
Sounds fine, but doesn't work with my Medion X10 on WinXP
The remote control is working, as i can see with a test program, but if i run your script no tooltip is displayed. Any ideas? |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Thu Feb 16, 2006 9:03 pm Post subject: |
|
|
Hi Muffy,
are there any error-messages or does just nothing happens ?
What test program do you have used? Perhaps I can try, if it works with my remote control, just to see that it should work.
Ciao
Micha |
|
| Back to top |
|
 |
guest166 Guest
|
Posted: Sun Feb 26, 2006 1:09 pm Post subject: |
|
|
I have a Niveus Media USB remote (x10 clone), will this solution work for me?
Any chance you could tell me step by step (read: for someone with no clue) how to get this working?  |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Sun Feb 26, 2006 5:58 pm Post subject: |
|
|
Hi,
I can't tell you if it will work, but you can have a try.
Download the dll and the script from the first post.
Download this ZIP: http://www.autohotkey.net/~Micha/mfc_dlls.zip
Put all files to the same directory and start the script.
If you press a key on the remotecontrol a tooltip should appear.
If that works, you can do everything what's possible with ahk by pressing a button on the remote control.
Ciao
Micha |
|
| Back to top |
|
 |
Adj
Joined: 23 Dec 2007 Posts: 3
|
Posted: Sun Dec 23, 2007 11:07 pm Post subject: |
|
|
Hey Micha,
This sounds great! i'd love this if i could get it to work.
However i failed to get it working. I do not know what the problem is. I got a working (works with girder, which i do not like so much) X10 Remote Control with my Aldi Medion desktop.
I've downloaded the files, extracted them and put them in one directory. No errors occur when i start the script, but nothing happens when i press a button. I've checked the Key history and script info which is empty.
I'm not so known with DLL's so i might do something wrong there..
Could you please give me some direction to a solution please?
Thanks in advance!
Adj |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Mon Dec 24, 2007 10:01 am Post subject: |
|
|
Hi Adj,
please try dependency walker. A short description is here |
|
| Back to top |
|
 |
Jeggo Guest
|
Posted: Sun Mar 02, 2008 7:08 pm Post subject: X10 Desktop Remote |
|
|
Hello Micha,
I have the same problem with my X10 Medion remote clone.
As proposed I did a Dependency Walker run. As far as understand the output everything is OK.
I believe, that the AutohotkeyRemoteX10.dll is not processing the X10 commands.
I just mailed you the log file.
CU
Jens |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
|
| Back to top |
|
 |
Jeggo Guest
|
Posted: Tue Mar 04, 2008 9:41 pm Post subject: |
|
|
Hi Micha,
I tried the things you mentioned. But it did not work
Still no reaction of the script, when I press a key on the remote.
Is it possible to get the sourcecode for your DLL?
Maybe I can findout what the problem is.
CU
Jens |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 437 Location: Germany
|
Posted: Wed Mar 05, 2008 5:57 pm Post subject: |
|
|
Hi,
are you sure that you have installed the correct driver, the batteries of the remote control are not empty and the remote control is working at all?
here is the code:
| Code: | // AutohotkeyRemoteX10.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "ahscript.h"
#include ".\AutohotkeyRemoteX10.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
//helper function for single byte char to unicode translatation
UINT Initialize(DWORD hWnd)
{
fEndThread = FALSE;
pWnd = CWnd::FromHandle((HWND)hWnd);
AfxBeginThread(RunThread, NULL);
return NULL;
}
void UnInitialize(void)
{
fEndThread = TRUE;
//EVENT Abwarten
pEventsReporter->Release();
pEventsReporter = NULL;
pActiveHome->Release();
pActiveHome = NULL;
}
UINT RunThread (LPVOID pParam )
{
int nReturn = 0;
HRESULT hr;
hr = CoInitialize(NULL);
hr = CoCreateInstance( CLSID_ActiveHome, NULL, CLSCTX_INPROC|CLSCTX_LOCAL_SERVER, IID_IActiveHome, (LPVOID *) &pActiveHome );
if (SUCCEEDED(hr))
{
VARIANT varReseved1;
VariantInit(&varReseved1);
VARIANT varReseved2;
VariantInit(&varReseved2);
VARIANT varAction;
VariantInit(&varAction);
varAction.vt = VT_BSTR;
wchar_t wchTemp[10];
//setup events reporting for _IActiveHomeEvents
pEventsReporter = new CEventsReporter;
if (pEventsReporter)
{
pEventsReporter->AddRef();
//hook up pEventsReporter to get calls
pEventsReporter->AdviseActiveHome(pActiveHome);
MSG msg;
HWND hwnd;
HWND hwndParent;
while (GetMessage( &msg, NULL, 0, 0 ) > 0)
{
if (msg.hwnd && (((msg.message >= WM_KEYFIRST) && (msg.message <= WM_KEYLAST)) || ((msg.message >= WM_IME_SETCONTEXT) && (msg.message <= WM_IME_KEYUP))) )
{
hwnd = msg.hwnd;
for (;(hwndParent = GetParent( hwnd )) && IsChild( hwndParent, hwnd ); hwnd = hwndParent) {}
if (! ::GetWindowLong( hwnd, DWL_DLGPROC ) || !IsDialogMessage( hwnd, &msg ))
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
else
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
}
}
else
{
printf("error: CoCreateInstance hr=0x%x", (unsigned int)hr);
}
return TRUE;
} |
|
|
| Back to top |
|
 |
Jeggo Guest
|
Posted: Wed Mar 05, 2008 7:42 pm Post subject: |
|
|
Hi Micha,
now it is working
It looks like a reboot was missing. Next weekend I will try to integrate it in my AHK-script.
I will tryout what drivers and DLLs where actual needed to run the X10 remote.
CU
Jens |
|
| Back to top |
|
 |
|