|
Hi all,
How can I set the focus to a MessageBox. For example: When a certain key is pressed, I show a messagebox asking the user a question. If the user would answer No the program continues as normal. And when the user presses that same key the messagebox displays, but behind the application.
Makes sense ??
Thanx in advance
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
try this.
MessageBox(GetFocus(),
"String to be displayed",
"Title",
MB_TASKMODAL | MB_YESNO).
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Thank you NiceNaidu, it seems like it did the job ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
I wants to get the full path of desktop and my document folder.
Can some one suggest how to do the same in VC++
|
|
|
|
|
|
Thanks for quick reply. I was just looking for this function
|
|
|
|
|
SHGetFolderPath()
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.5 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
I need a code(working ) for RSA for multiplying 2 large (512 bit prime number)
normal int is 32
i thought of arrays, but dunno how to do with arrays so am asking u all. hope some of u have worked with RSA
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
Have you consulted any literature by R, S, or A?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hy
I am a newby in encoding/decoding. I am writting a function in C++ that would decode an URL encoded string. It works fine if the string does not contain unicode characters. Whenever I find a "%" I convert the fallowing two digit number from hex to int and add to the returning string the character corespounding to the int. When the URL contains unicode characters there is a "u" after the "%" fallowed by a 4 digit hex. I managed to convert the for digit hex to int. But I am not able to get the character corespounding to this int.
Could anyone give some advice ?
10x in advance
Bobby
bogdanaldo
|
|
|
|
|
Try using the following code for encoding and decoding the URL
CString URLDecode(const CString& inStr)
{
CString res;
for (int x = 0; x < inStr.GetLength(); x++)
{
if (inStr.GetAt(x) == _T('%') && x + 2 < inStr.GetLength() && IsHexDigit(inStr.GetAt(x+1)) && IsHexDigit(inStr.GetAt(x+2)))
{
TCHAR hexstr[3];
_tcsncpy(hexstr, inStr.Mid(x+1, 2), 2);
hexstr[2] = _T('\0');
x += 2;
res.AppendChar((TCHAR)_tcstoul(hexstr, NULL, 16));
}
else
{
res.AppendChar(inStr.GetAt(x));
}
}
return res;
}
CString URLEncode(const CString& sInT)
{
CStringA sIn(sInT);
LPCSTR pInBuf = sIn;
CString sOut;
LPTSTR pOutBuf = sOut.GetBuffer(sIn.GetLength() * 3);
if(pOutBuf)
{
while (*pInBuf)
{
if (_ismbcalnum((BYTE)*pInBuf))
*pOutBuf++ = (BYTE)*pInBuf;
else
{
*pOutBuf++ = _T('%');
*pOutBuf++ = toHex((BYTE)*pInBuf >> 4);
*pOutBuf++ = toHex((BYTE)*pInBuf % 16);
}
pInBuf++;
}
*pOutBuf = _T('\0');
sOut.ReleaseBuffer();
}
return sOut;
}
-- modified at 6:27 Monday 19th February, 2007
|
|
|
|
|
please use <pre></pre> !!!
|
|
|
|
|
Are you looking for something like UrlCanonicalize() , or maybe the UrlEescape() /UrlUnescape() pair?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to start a thread at a particular interval
like if i set it at 4 sec then that thread should run every 4th sec..
How shold i set this timer
Can anybody help me in this...
thanxs in advance
|
|
|
|
|
please set a nickname in your profile so that everybody can identify you.
BTW, are you using MFC ? is so, you can use the CWnd::SetTimer() function for this purpose
|
|
|
|
|
toxcct wrote: please set a nickname in your profile so that everybody can identify you.
Since s/he continues to receive help, what incentive does s/he have for complying?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
because if s/he continues, fire will fall on her/his head
|
|
|
|
|
There are more than one anonymous things around.
This one has only 2 posts.
It seems there is a loophole in the register user dialog of codeproject.
Failure is not an option - it's built right in.
|
|
|
|
|
If it's a worker thread you could create it once (as thread creation in Win32 is relatively expensive) and have it Sleep between runs. For example:
void __cdecl ThreadFunc(void *)
{
for( ; ; )
{
DWORD WaitRes = WaitForSingleObject(g_hKillThreadEvent, 4000);
if (WaitRes==WAIT_OBJECT_0)
{
return;
}
}
}
Steve
|
|
|
|
|
1st of all sorry for posting this entire program hope its not a large 1. This program has been tested in gcc,msvc,tc to give the same result. My question is how does it work
#include <stdio.h>
void Call_Aswathy()
{
printf("Yes Girish........\n\n");
}
int Call_Girish(int w_argc)
{
printf("Aswathy do u hear me...\n\n");
unsigned int *p = (unsigned int *)&w_argc;
*p = *(p-1);
*(p-1) = (unsigned int) &Call_Aswathy;
return w_argc;
}
int main(int argc,char **argv)
{
unsigned int *p = (unsigned int *) &argc;
*p = *(p-1);
*(p-1) = (unsigned int) &Call_Girish;
return 0;
}
if some1 has posted a this question or similar question before plz post the exact link or mail the link
thx in advance
-- modified at 5:36 Monday 19th February, 2007
-- modified at 5:38 Monday 19th February, 2007
-- modified at 5:50 Monday 19th February, 2007
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
Deepchand P wrote: Plz give me a satisfiable reply
1) we're answering for free, so please be indulgent if the answers don't satisfy you
2) this is not a "satisfiable" title for a message
3) please use <pre></pre> tags around your code samples so that we can see your format correctly... (thanks for your consequent modification)
4) What is your question actually ? have you tried using your debugger ? what part of it don't you understand ?
5) please avoid typing in SMS; use full word instead. everybody can plainly understand you like that
|
|
|
|
|
kindly excuse as its my 2nd post i just want to know this program works.
When i analysed the program the functions are called after the main prog return 0. how does this happen?
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
u got any corrections plz correct me cos am new to posting
i tried using the debugger but the messages are printed after the main returns 0
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
How about adding breakpoints inside the functions, and see what the callstack looks like when they get called
|
|
|
|
|
This is probably one of the wurst ways to call a function on exit of another function.
To see what happens one should know a little/lot about the way c/c++ works and look at the assembly code.
Simply said: the programmer (prob a hacker who deserves to be shot ) is overwriting the return address of the function. So when the function exit it returns to the newly linked function instead.
codito ergo sum
|
|
|
|