Thread: Tabbed Windows with MDI?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #15
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    hahahaha ^_^ idk if my sanity even made it to the door.. but yea, it does feel good to have figured out the problem. which i will never understand, but i solved. and yea.. i wasn't sure if i wanted to stick those #define's in my header file b/c in their example, they were in the main code and in wondering if that could cause a problem, thats where they were placed. lol however, theres an updated version of my code and header / rc files that can be attained from the links above.


    Now, for a NEW headache ^_^ i want to incorporate a simple XOR encryption.. just so that when the file is opened in like notepad, my girlfriend or mom wouldn't be able to read it or be able to figure out "oh.. he just made a=b, b=c, etc.. this is the code i've come up with so far:
    Code:
    case ID_ENCRYPT_TEXT:
                        {
                             char algorithm[25] = "Az!By@Cx#Dw$Ev%Fu^Gt&Hs*";
                             int i;
                             DWORD dwTextLength;
                             dwTextLength = GetWindowTextLength(hwnd);
                             if(dwTextLength > 0)// No need to bother if there's no text.
                             {
                                    LPSTR pszText;
                                    pszText = (LPSTR)GlobalAlloc(GPTR, dwTextLength + 1);
                                    if(pszText != NULL)
                                    {
                                      char windowText[dwTextLength + 1];
                                      for (i = 0; i <= dwTextLength; i++)
                                      {
                                          windowText[i] = pszText[i];
                                      }
                                      if(windowText != NULL)
                                      {
                                             for (i = 0; i <= dwTextLength; i++)
                                             {
                                                 windowText[i] = windowText[i] ^ algorithm[i % 20];
                                             }
                                             SetWindowText(hwnd, windowText);
                                      }
                                    }
                             }                                    
                        }
                        break;
    but of course..when i click it, it does nothing. i probably have it placed wrong, and am trying to use something wrong.. but this wasn't part of the tutorial. this is something i want to do out of curiosity and self need, lol. so, any suggestions? thanks


    // on a side note, as for the icons included in the code, i uploaded those as well
    // shibbyinc.ico | txticon.ico
    Last edited by willc0de4food; 05-18-2005 at 02:51 AM.
    Registered Linux User #380033. Be counted: http://counter.li.org

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make a windows application
    By crvenkapa in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2007, 09:59 AM
  2. Editor design: Traditional MDI versus Tabbed MDI
    By psychopath in forum Game Programming
    Replies: 7
    Last Post: 01-22-2007, 07:48 AM
  3. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM