diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
commit | 864081102a5f252415f41950b3039a896b4ae9c5 (patch) | |
tree | c6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/status/i_hotkey.inc | |
parent | db5149b48346c417e18add5702a9dfe7f6e28dd0 (diff) |
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/status/i_hotkey.inc')
-rw-r--r-- | plugins/Watrack/status/i_hotkey.inc | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/plugins/Watrack/status/i_hotkey.inc b/plugins/Watrack/status/i_hotkey.inc new file mode 100644 index 0000000000..3ad23ae656 --- /dev/null +++ b/plugins/Watrack/status/i_hotkey.inc @@ -0,0 +1,62 @@ +{main hotkey code}
+function InsertProc(wParam:WPARAM;lParam:LPARAM):int_ptr; cdecl;
+var
+ CurWin:HWND;
+ s:pWideChar;
+ p:PAnsiChar;
+ isUnicode:boolean;
+ i:integer;
+ j:integer;
+ tt:tTemplateType;
+begin
+ result:=0;
+ if DisablePlugin=dsPermanent then
+ exit;
+ if Loword(LastStatus)<>WAT_PLS_NORMAL then
+ exit;
+// i:=CallService(MS_WAT_GETMUSICINFO,0,0);
+ if UseMessages=BST_CHECKED then
+ begin
+ CurWin:=GetFocus;
+ if CurWin<>0 then
+ begin
+// j:=WndToContact(WaitFocusedWndChild(GetForegroundwindow){GetFocus});
+ j:=WndToContact(CurWin);
+ p:=GetContactProtoAcc(j);
+// p:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,j,0));
+ if DBReadByte(j,p,'ChatRoom',0)=1 then
+ begin
+ isUnicode:=false;
+ tt:=tmpl_chat;
+ end
+ else
+ begin
+ isUnicode:=true;
+ tt:=tmpl_pm;
+ end;
+ if SimpleMode<>BST_UNCHECKED then
+ i:=0
+ else
+ i:=FindProto(p);
+ s:=GetMacros(tt,i);
+ // not empty and not disabled
+ if (s<>nil) and (uint_ptr(s)<>uint_ptr(-1)) then
+ begin
+ if StrScanW(s,'{')<>nil then
+ SendRTF(CurWin,s,isUnicode,UserCP)
+ else
+ begin
+ if isUnicode then
+ SendMessageW(CurWin,EM_REPLACESEL,0,tlparam(s))
+ else
+ begin
+ SendMessageA(CurWin,EM_REPLACESEL,0,tlparam(WideToAnsi(s,p,UserCP)));
+ mFreeMem(p);
+ end;
+ end;
+ mFreeMem(s);
+ end;
+ result:=1;
+ end;
+ end;
+end;
|