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. GetWindowText [modified]

GetWindowText [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
7 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.
  • S Offline
    S Offline
    Sam 2006
    wrote on last edited by
    #1

    hi, i've got a problem with getwindowtext. i've spent at least an hour trying to figure out why this won't work. (sad, huh?) i have this code:

    BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
    {
    LPSTR title = "";
    CString thetitle = "";

    GetWindowText(hwnd, title, 100);
    thetitle = (CString) title;
    

    AfxMessageBox(thetitle); //just to see its value
    if(thetitle == "...") {
    ...
    }

    return TRUE;
    

    }

    onSomeButtonClick...() {
    if(!EnumWindows((WNDENUMPROC) EnumWindowsProc, 0)) {
    ...
    }
    }

    for some reason, thetitle is always blank. can someone tell me why this is happening? any tips for fixing this would help. thanks. -- modified at 21:14 Wednesday 24th May, 2006

    _ 1 Reply Last reply
    0
    • S Sam 2006

      hi, i've got a problem with getwindowtext. i've spent at least an hour trying to figure out why this won't work. (sad, huh?) i have this code:

      BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
      {
      LPSTR title = "";
      CString thetitle = "";

      GetWindowText(hwnd, title, 100);
      thetitle = (CString) title;
      

      AfxMessageBox(thetitle); //just to see its value
      if(thetitle == "...") {
      ...
      }

      return TRUE;
      

      }

      onSomeButtonClick...() {
      if(!EnumWindows((WNDENUMPROC) EnumWindowsProc, 0)) {
      ...
      }
      }

      for some reason, thetitle is always blank. can someone tell me why this is happening? any tips for fixing this would help. thanks. -- modified at 21:14 Wednesday 24th May, 2006

      _ Offline
      _ Offline
      _anil_
      wrote on last edited by
      #2

      Try char title[100]; GetWindowText(hwnd, title, 100); Regards Anil

      S 1 Reply Last reply
      0
      • _ _anil_

        Try char title[100]; GetWindowText(hwnd, title, 100); Regards Anil

        S Offline
        S Offline
        Sam 2006
        wrote on last edited by
        #3

        it worked! thanks a lot. 1 more question... how do you put the text in that font? :confused:

        _ N 2 Replies Last reply
        0
        • S Sam 2006

          it worked! thanks a lot. 1 more question... how do you put the text in that font? :confused:

          _ Offline
          _ Offline
          _anil_
          wrote on last edited by
          #4

          Sorry did not get your question Regards Anil

          S 1 Reply Last reply
          0
          • _ _anil_

            Sorry did not get your question Regards Anil

            S Offline
            S Offline
            Sam 2006
            wrote on last edited by
            #5

            Forget about it then. Doesn't matter. Thanks.

            1 Reply Last reply
            0
            • S Sam 2006

              it worked! thanks a lot. 1 more question... how do you put the text in that font? :confused:

              N Offline
              N Offline
              Nibu babu thomas
              wrote on last edited by
              #6

              Sam Kline wrote:

              it worked! thanks a lot. 1 more question... how do you put the text in that font?

              Look down where the smileys are. Just above them there is a section called Formatting: B I U S small BIG... Hope you saw it. Now select any text and just click on those items. Now your selected text will be wrapped within html tags. Thats it. Hope this is what you meant. :~


              Nibu thomas A Developer Programming tips[^]  My site[^]

              S 1 Reply Last reply
              0
              • N Nibu babu thomas

                Sam Kline wrote:

                it worked! thanks a lot. 1 more question... how do you put the text in that font?

                Look down where the smileys are. Just above them there is a section called Formatting: B I U S small BIG... Hope you saw it. Now select any text and just click on those items. Now your selected text will be wrapped within html tags. Thats it. Hope this is what you meant. :~


                Nibu thomas A Developer Programming tips[^]  My site[^]

                S Offline
                S Offline
                Sam 2006
                wrote on last edited by
                #7

                eh, i use opera. i don't see the formatting thing in it, for some reason. i just opened this in IE and i see what you mean. http://www.samkline.com/files/filehosting/klines/post.png[^] -- modified at 15:12 Thursday 25th May, 2006

                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