Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A very big problem

A very big problem

Scheduled Pinned Locked Moved C / C++ / MFC
help
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Waldermort
    wrote on last edited by
    #1

    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.

    L J 4 Replies Last reply
    0
    • W Waldermort

      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.

      L Offline
      L Offline
      lastgen
      wrote on last edited by
      #2

      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!!!

      1 Reply Last reply
      0
      • W Waldermort

        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.

        L Offline
        L Offline
        lastgen
        wrote on last edited by
        #3

        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!!!

        1 Reply Last reply
        0
        • W Waldermort

          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.

          L Offline
          L Offline
          lastgen
          wrote on last edited by
          #4

          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!!!

          1 Reply Last reply
          0
          • W Waldermort

            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.

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            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...

            W 1 Reply Last reply
            0
            • J John R Shaw

              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...

              W Offline
              W Offline
              Waldermort
              wrote on last edited by
              #6

              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;
              
              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups