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