|
-
Sep 30th, 2006, 10:29 PM
#1
Thread Starter
New Member
problem to get Notepad's ImmGetContext
VB Code:
Private Declare Function ImmGetContext Lib "imm32.dll" (ByVal hwnd As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Sub Command1_Click()
dim hwnd as long,hIMC as long
hwnd = FindWindow("Notepad", vbnullstring)
if hwnd<>0 then
hIMC=ImmGetContext(hwnd)
msgbox hIMC
end if
end sub
but hIMC always return 0,how can i get notepad 's ImmGetContext,anyone can help me?
-
Oct 2nd, 2006, 12:31 PM
#2
-
Oct 2nd, 2006, 02:01 PM
#3
Member
Re: problem to get Notepad's ImmGetContext
I have never worked with IME so my knowledge is rather vague. First, is the IME program installed on your computer. If it is, I think it's the Notepad edit window that is provided with IME.
As I said, my knowledge is vague.
-
Oct 7th, 2006, 06:18 PM
#4
-
Oct 8th, 2006, 03:27 AM
#5
Member
Re: problem to get Notepad's ImmGetContext
-
Oct 9th, 2006, 02:51 AM
#6
Thread Starter
New Member
Re: problem to get Notepad's ImmGetContext
ImmGetContext
Returns the input context associated with the specified window.
HIMC ImmGetContext(
HWND hWnd
);
Parameters
hWnd
[in] Handle to the window for which to retrieve the input context.
Return Values
Returns the handle to the input context.
Remarks
An application should routinely use this function to retrieve the current input context before attempting to access information in the context.
------------------------------------------------------
the problem is if hwnd isn't myself process,then this APIdoesn't work
if i set hwnd = FindWindow("", "Form1") or hwnd=form1.hwnd or hwnd=text1.text
it's both work
if hwnd is external process's hwnd,then it's doesn't work
anyone can help me?
-
Oct 9th, 2006, 02:55 AM
#7
Thread Starter
New Member
Re: problem to get Notepad's ImmGetContext
maybe can use c++ write a dll,this dll can get ImmGetContext,then use VB inject this dll to notepad,but i don't know how to write it in c++....
-
Oct 9th, 2006, 08:06 AM
#8
-
Oct 10th, 2006, 10:50 PM
#9
Thread Starter
New Member
Re: problem to get Notepad's ImmGetContext
 Originally Posted by manavo11
So you want to get the text that is typed in a notepad instance, right? Try searching for the FindWindow, FindWindowEx and GetWindowText APIs.
no,i want get IME CandidateList's text,so your way doesn't work
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|