A very big problem
-
I have just spent the last 2 weeks developing a class which is able to monitor all changes within an edit box. I know it sounds like nothing big but trust me it is. I am able to trap, monitor and change most messages that deal with this and all is working well. Until I tried inserting Unicode text with the aid of an IME. Here is the problem. When the IME window is open, due to the nature of this class it is forced to close. This is preventing the user from changing their compostion. What I need to do is quite simple, just prevent my class from executing until the composition has been finalised. In theory I just need to check if the compostion window is open, but I am unable to find any such function or message which is able to do this. Please help, I really need to find an answer to this.
-
I have just spent the last 2 weeks developing a class which is able to monitor all changes within an edit box. I know it sounds like nothing big but trust me it is. I am able to trap, monitor and change most messages that deal with this and all is working well. Until I tried inserting Unicode text with the aid of an IME. Here is the problem. When the IME window is open, due to the nature of this class it is forced to close. This is preventing the user from changing their compostion. What I need to do is quite simple, just prevent my class from executing until the composition has been finalised. In theory I just need to check if the compostion window is open, but I am unable to find any such function or message which is able to do this. Please help, I really need to find an answer to this.
Not entirely 100% clear on the issue, but assuming you are running windows you can do something like enumerate all the windows and search for a caption or similar. This isn't the best solution, but is about all you can do if you don't have full control of whatever is spawning/closing the window. In order to enumerate the windows you can take a couple of approaches: If you know what process owns the window, you can call EnumProcessWindows(), otherwise you will need to call EnumWindows() and check for child windows with EnumChildWindows(). I'm a little short on time at the moment so sorry I can't give a good example, perhaps later tonight. Anyway I hope this helps a little. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
-
I have just spent the last 2 weeks developing a class which is able to monitor all changes within an edit box. I know it sounds like nothing big but trust me it is. I am able to trap, monitor and change most messages that deal with this and all is working well. Until I tried inserting Unicode text with the aid of an IME. Here is the problem. When the IME window is open, due to the nature of this class it is forced to close. This is preventing the user from changing their compostion. What I need to do is quite simple, just prevent my class from executing until the composition has been finalised. In theory I just need to check if the compostion window is open, but I am unable to find any such function or message which is able to do this. Please help, I really need to find an answer to this.
Assuming you are running windows you can do something like enumerate all the windows and search for a caption or similar. This isn't the best solution, but is about all you can do if you don't have full control of whatever is spawning/closing the window. In order to enumerate the windows you can take a couple of approaches: If you know what process owns the window, you can call EnumProcessWindows(), otherwise you will need to call EnumWindows() and check for child windows with EnumChildWindows(). I'm a little short on time at the moment so sorry I can't give a good example, perhaps later tonight. Anyway I hope this helps a little. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
-
I have just spent the last 2 weeks developing a class which is able to monitor all changes within an edit box. I know it sounds like nothing big but trust me it is. I am able to trap, monitor and change most messages that deal with this and all is working well. Until I tried inserting Unicode text with the aid of an IME. Here is the problem. When the IME window is open, due to the nature of this class it is forced to close. This is preventing the user from changing their compostion. What I need to do is quite simple, just prevent my class from executing until the composition has been finalised. In theory I just need to check if the compostion window is open, but I am unable to find any such function or message which is able to do this. Please help, I really need to find an answer to this.
Assuming you are running windows you can do something like enumerate all the windows and search for a caption or similar. This isn't the best solution, but is about all you can do if you don't have full control of whatever is spawning/closing the window(unless you want to apply some hooks :-D). In order to enumerate the windows you can take a couple of approaches: If you know what process owns the window, you can call EnumProcessWindows(), otherwise you will need to call EnumWindows() and check for child windows with EnumChildWindows(). I'm a little short on time at the moment so sorry I can't give a good example, perhaps later tonight. Anyway I hope this helps a little. When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
-
I have just spent the last 2 weeks developing a class which is able to monitor all changes within an edit box. I know it sounds like nothing big but trust me it is. I am able to trap, monitor and change most messages that deal with this and all is working well. Until I tried inserting Unicode text with the aid of an IME. Here is the problem. When the IME window is open, due to the nature of this class it is forced to close. This is preventing the user from changing their compostion. What I need to do is quite simple, just prevent my class from executing until the composition has been finalised. In theory I just need to check if the compostion window is open, but I am unable to find any such function or message which is able to do this. Please help, I really need to find an answer to this.
I have read what you have said and it does not make since to me. First, stop getting down on yoyrself (A bad habit of mine). When you say "it sounds like nothing", you are correct (for some of us, in part), but that does not mean that it is. That is a matrer of who is reading your post. I believe your problem is a bit more complecated than that. What you are looking for is not as simple as you think, when deling with IME. It sounds like you waont to mix the two, which you (theoretcicaly) can not. INTP Every thing is relative...
-
I have read what you have said and it does not make since to me. First, stop getting down on yoyrself (A bad habit of mine). When you say "it sounds like nothing", you are correct (for some of us, in part), but that does not mean that it is. That is a matrer of who is reading your post. I believe your problem is a bit more complecated than that. What you are looking for is not as simple as you think, when deling with IME. It sounds like you waont to mix the two, which you (theoretcicaly) can not. INTP Every thing is relative...
Like I said the solution is simple, I just need to find the IME window and check if it is open. Finding the window is not so simple as searching for the window title, since all the IME really is is an edit box which floats around on the screen positioning itself (usually) over the caret. This actually changes from system to system, depending on the IME version, OS and users settings. the solution was infact very simple, and I blame myself for not seeing it in the hundreds of IME specific messages and commands.
HIMC hImc = ImmGetContext(hEdit); if(ImmGetOpenStatus(hImc) ) // IME window is open return false;