AutoHotkey Community

It is currently May 27th, 2012, 9:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 25th, 2011, 9:27 pm 
Offline

Joined: June 7th, 2008, 6:00 am
Posts: 389
I'm using AHK_L Unicode 32B, not sure if that matters but...

I'm using the following:
Reciever.ahk
Code:
#SingleInstance
OnMessage(0x4a, "Receive_WM_COPYDATA")
Return

Receive_WM_COPYDATA(W, L)
{
    SA := NumGet(L + 8)
    SL := StrLen(SA)
    VarSetCapacity(I, SL)
    DllCall("lstrcpy", "str", I, "uint", SA)
    Tooltip, % I
}


Sender.ahk
Code:
Send_WM_COPYDATA("Test")

Send_WM_COPYDATA(STS)
{
    TST = Reciever.ahk ahk_class AutoHotkey
    VarSetCapacity(CDS, 12, 0)
    NumPut(StrLen(STS) + 1, CDS, 4)
    NumPut(&STS, CDS, 8)
    PDHW := A_DetectHiddenWindows
    PTMM := A_TitleMatchMode
    DetectHiddenWindows On
    SetTitleMatchMode 2
    SendMessage, 0x4a, 0, &CDS,, %TST%
    DetectHiddenWindows %PDHW%
    SetTitleMatchMode %PTMM%
}


It used to work on AHK basic, however on AHK_L, I can only get the first letter to show up. Does anyone know why?

Thanks for your time! I'm probably just overlooking something.

_________________
Image
[Functions] Wicked's Collection Of Functions - Check it out!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2011, 10:54 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Code:
Receive_WM_COPYDATA(W, L) {
   Tooltip % StrGet( NumGet(L+8), NumGet(L+4), "UTF-16" )
}


Also, you need to adjust StrLen in sender.ahk

Code:
NumPut( (StrLen(STS)*2) + 2, CDS, 4)


Edit: Oops. I just noticed.. AHK_L documentation has updated examples under OnMessage()

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 25th, 2011, 11:38 pm 
Offline

Joined: June 7th, 2008, 6:00 am
Posts: 389
My God, SKAN... Is there anything you can't do?

I honestly feel bad for all the times I've had to hassle you to help me in the past. You're a fantastic help!

Rsed explained to me why the changes needed made in IRC.

Thanks guys!

_________________
Image
[Functions] Wicked's Collection Of Functions - Check it out!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2011, 12:03 am 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
"Is there anything you can't do?"
Can he figure out how to call DwmDefaultWinowProc() with WM_NCHITTEST? :P
I'm really over my head in the "Script for sending winows back" thread

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2011, 12:57 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
nimda wrote:
"Is there anything you can't do?"
Can he figure out how to call DwmDefaultWinowProc() with WM_NCHITTEST? :P
I'm really over my head in the "Script for sending winows back" thread
1st off your missing 01100100 :P

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 26th, 2011, 1:27 am 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
My phone's qwerty keyboard is... questionable :P


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher and 69 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