PostMessage Problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ram (nav_ram_at_rediffmail.com)
Date: 01/24/05


Date: 23 Jan 2005 22:59:16 -0800

sir,
i am creating a software to type my regional language in windows
applications like word, pagemaker, coreldraw, quarkxpress etc. for that
i set a global keyboard hook to get the keyboard input and i
programatically change the pressed keys to my regional language
character and send back to the application using postmessage api. it
works smooth in some applications like pagemaker and word. but it fails
in quark and coreldraw.
in some applications i can't send 'vbkeyback'.
what is the problem with this code?
how can i postmessage to all applications without any problem.
plz help.....
below is my code:

Sub Send_Txt()
Cj = Conjuncts2(frmMain.Text1.Text)
Call PostMessage(frmMain.Timer1.Tag, WM_CHAR, vbKeyBack, Keybrd_Delay)
Call PostMessage(frmMain.Timer1.Tag, WM_CHAR, Asc(Cj), Keybrd_Delay)
End Sub

Private Sub Form_Load()
Keybrd_Delay = Val(GetSetting("LEO", "Teddy", "Software", "1"))
End Sub

'' To get foreground window handle...
Private Sub Timer1_Timer()
Dim hFore As Long, hFocus As Long
If hFocus = 0 Then
hFore = GetForegroundWindow()
Call AttachThreadInput(GetWindowThreadProcessId(hFore, 0&),
GetCurrentThreadId, True)
hFocus = GetFocus
Call AttachThreadInput(GetWindowThreadProcessId(hFore, 0&),
GetCurrentThreadId, False)
End If
Timer1.Tag = hFocus
End Sub

Sub Send_Txt()
Cj = Conjuncts2(frmMain.Text1.Text)
Call PostMessage(frmMain.Timer1.Tag, WM_CHAR, vbKeyBack, Keybrd_Delay)
Call PostMessage(frmMain.Timer1.Tag, WM_CHAR, Asc(Cj), Keybrd_Delay)
End Sub

plz help

ram



Relevant Pages

  • Re: More than One
    ... In pre-ASP and ASP 3 I worked with a customer by developing a website on my ... applications that have limited access. ... each application's runtime configuration collection are ... > calculated from the whole hierarchy from its own web.config, to sub ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: More than One
    ... separate access controls. ... ASP.NET 1.1 applications. ... each application's runtime configuration collection ... |> calculated from the whole hierarchy from its own web.config, to sub ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Can VBA hook onto function keys???
    ... I would like to be able to switch to other applications ... Private Sub Workbook_Activate ... The first procedure tells Excel to fire "CopyValueToClipboard" when F1 is pressed. ... You can now switch to another application and paste. ...
    (microsoft.public.excel.programming)
  • Closing ManagementEventWatcher when Windows Service stops...
    ... I believe that the reason is that the multiple watchers that I spawn ... Public Sub New ... 'Required by the Component Designer ... <!-- CAD Applications which trigger random opening of CAD Help Portal ...
    (microsoft.public.win32.programmer.wmi)