AutoHotkey Community

It is currently May 27th, 2012, 12:57 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: January 29th, 2006, 9:03 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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 February 2nd, 2006, 11:35 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 30th, 2006, 12:13 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Nice looking package. Now, when anyone searches for X10 or similar, they will find a ready-made solution thanks to you :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 2nd, 2006, 11:36 am 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Updated links. Add mfc-dlls in a package


Report this post
Top
 Profile  
Reply with quote  
 Post subject: H
PostPosted: February 16th, 2006, 11:57 am 
:D Sounds fine, but doesn't work with my Medion X10 on WinXP :cry:

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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2006, 9:03 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2006, 1:09 pm 
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? :oops:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2006, 5:58 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 23rd, 2007, 11:07 pm 
Offline

Joined: December 23rd, 2007, 10:48 pm
Posts: 11
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 24th, 2007, 10:01 am 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Hi Adj,
please try dependency walker. A short description is here


Report this post
Top
 Profile  
Reply with quote  
 Post subject: X10 Desktop Remote
PostPosted: March 2nd, 2008, 7:08 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2008, 8:18 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
Hi,
I've recompiled the dll.
Please download the new vcredist from microsoft
http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
The new Dll:
http://www.autohotkey.net/~Micha/X10/AutohotkeyRemoteX10.zip
and the X10 SDK. The dll should work without, but I have installed Server2003 and the notebook drivers for my remote control doesn't install with that os. I wasn't able to run the dll without the sdk, but you can try it without the sdk first.
http://www.x10.com/activehomepro/sdk/
My remote is working without further dlls on my new installed notebook
Please post if you have any further problems
Ciao
Micha


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 4th, 2008, 9:41 pm 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2008, 5:57 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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;
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 5th, 2008, 7:42 pm 
Hi Micha,

now it is working :D
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2010, 8:11 am 
Offline

Joined: March 2nd, 2007, 7:25 am
Posts: 57
Location: Germany
I was disappointed when I realized that my remote is no HID device. I bought it last week just for AHK. Finding your script is a great relief. It is actually cooler because I don't have to care about the HID Script.

Would it be possible to use COM with AHK_L so that we wouldn't need your DLLs?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bon, sks and 23 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