|
Hi,
I want to add a extra button on title bar(otrh than three standard buttons) of all the application currently running. How can I do this ? this is done by another application available on Webex.com.
Regards,
Hemant Kulkarni.
|
|
|
|
|
|
|
how to display text transparently by DC?
Background of the text contains multiple colors and/or bitmaps.
Text goes cross most of colors (bitmaps) of background.
E.g.
If transparent rate is near 100%, text color on red bkgnd becomes almost red also, and on blue bkgnd almost blue.
any idea for this?
thx
|
|
|
|
|
CDC::SetBkMode(TRANSPARENT);
--
======
Arman
|
|
|
|
|
i forgot to add one line in my post:
do no use CDC::SetBkMode(TRANSPARENT) to blur my post.
here is not a place for u to show u r so clever.
i suggest u understand post before u write down ur reply.
|
|
|
|
|
I think he needs to darw a text of course(trasnparent)
|
|
|
|
|
See here
<br />
Graphics graphics2(GetDC()->m_hDC);<br />
<br />
Font font(L"System", 22);<br />
PointF point(0.0f, 20.0f);<br />
SolidBrush Brush(Color(150, 53, 97, 200));<br />
<br />
graphics2.DrawString(L"This is a test",14,<br />
&font,point,&Brush);<br />
|
|
|
|
|
Hello I would like to call DLL function with any parameters specified on runtime (some kind of rundll32 ) Input is ini file
[DllCall]
DllName=User32.dll
DllFunction=MessageBoxA
Parameters=4
Parameter1=0
Parameter2="Hello!"
Parameter3="Title!"
Parameter4=0
I would like to: 1) don't specify in my c++ all API I would like to callin future (its brr )
2) best wihout no inline, during it's not supported by Vc++ 2005 x64 compilier
(yes its possible to use external asm file in x64)
My problem is knowledge as well: I don't know how I call with any parameters (best would be something like function AddParameter(...) )
here some tutorial code
int main(int argc, char* argv[])
{
typedef PULONG (*LP)(...);
LP lp;
HMODULE m;
m = LoadLibraryA("user32.dll");
lp = (LP)GetProcAddress(m, "MessageBoxA");
lp();
FreeLibrary(m);
return 0;
}
Such method I did (useless)
int main(int argc, char* argv[])
{
DWORD aint = 0;
char someTxt[50] = "Hello!";
HINSTANCE dlScope = LoadLibraryA("user32.dll");
FARPROC rFunction = GetProcAddress(dlScope, "MessageBoxA");
DWORD outPnt;
__asm {
push aint
lea eax, someTxt
push eax
lea eax, someTxt
push eax
push aint
call rFunction
mov outPnt, eax
}
FreeLibrary(dlScope);
printf("%d", outPnt);
return 0;
}
|
|
|
|
|
Something that seems strange to me is that you don't define the types of your parameters. And the types of the parameters is very important for a function signature. So, this is a flaw I see in this design.
Also, why do you want to provide such mechanism ? The functions in the dll are known and if you want to call them, you know their prototypes. Or am I missing something ? If you could provide some informations there it will be usefull. Like explaining why do you want to achieve such a thing, maybe there is another solution.
|
|
|
|
|
yes but I would like to define them on runtime, not static.
I want this for simple scriptting language which can call any api from system.
-- modified at 6:46 Wednesday 26th July, 2006
|
|
|
|
|
There is no easy way of doing that. You'll have to use some powerfull techniques like template for example but I cannot give you a complete solution like that (I don't have one myself).
Using a dll increase a lot more the difficulty cause to load a function, you need to know its function prototype (that is statically defined) so, I don't think this is feasible.
|
|
|
|
|
I am developing a network application using CAsyncSocket.
I have OnReceive() overridden to read data (as does everyone I guess!)
All is fine - the application is successfully receiving data from the peer - until suddenly the calls to OnReceive() cease. For debugging, I also call ioctlsocket() with FIONREAD, and this reports that there are zero bytes in the network read buffer when the OnReceive() calls stop.
However, if I force a new call to OnReceive() this proves that definitely IS data available - as more data is read. Also, calling AsyncSelect() when the stall occurs, DOES trigger a new call to OnReceive(). However I don't want to schedule calls to AsyncSelect() - I shouldn't have to - and that would cause a performance hit anyway.
The stall occurs regularly - usually at least once every minute. An occasional missed call to OnReceive() would be tolerable, but this is ridiculous!
There are similar issues noted on the internet, e.g.
http://groups.google.co.uk/group/microsoft.public.vc.mfc/browse_thread/thread/26f6d6cb0151c2ad/6ed6994c7bcdf45c?lnk=st&q=&rnum=3&hl=en#6ed6994c7bcdf45c
.. but I have not seen a proper explanation, let alone resolution, and I have run out of things to try / debug.
Any help very gratefully received!
cheers,
Neil
|
|
|
|
|
I might be misremembering this, but doesn't there have to be a read pending before receive notifications are sent?
(Normally I use raw sockets, or a custom class to manage TCP/UDP stuff, so my memory is a bit hazy on this one)
Steve S
Developer for hire
|
|
|
|
|
Hi Steve
Thanks for replying.
I think a read IS pending. The problem is that the socket seems to "go to sleep" and it is necessary to call AsyncSelect() to make the framework realise data can be read.
cheers,
Neil
cheers,
Neil
|
|
|
|
|
I never came across this problem in my network applications. I wonder how your code in the OnReceive() handler looks like?
|
|
|
|
|
No, I think you are right.
At the time I was using code from OpenSSL, and I think that causes some strange things to happen. I changed my algorithm, and now it is fully working. So I don't think there really is a bug with the MS software, you just have to be careful with these functions, and call them at the right times etc.
cheers,
Neil
|
|
|
|
|
hello,
In my application i am using the GetVersionOfFile() in MFC Application;
i Have doubt about the a and b . any idea about dat
GetVersionOfFile(szAppPath , a , 256 ,b ,256);
szAppPath->path of file
a->?
256->?
b->?
256->?
janan
|
|
|
|
|
ningthemcha wrote: GetVersionOfFile() in MFC Application
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
a-> VersionBuffer
b-> Language Buffer
Here is the code for the function.
void GetVersionOfFile (char * pszAppName,
char * pszVerBuff,
int iVerBuffLen,
char * pszLangBuff,
int iLangBuffLen)
{<br />
DWORD dwScratch;<br />
DWORD * pdwLangChar;<br />
DWORD dwInfSize ;<br />
UINT uSize;<br />
BYTE * pbyInfBuff;<br />
char szVersion [32];<br />
char szResource [80];<br />
char * pszVersion = szVersion;<br />
<br />
dwInfSize = GetFileVersionInfoSize (pszAppName, &dwScratch);<br />
<br />
if (dwInfSize)<br />
{<br />
pbyInfBuff = new BYTE [dwInfSize];<br />
memset (pbyInfBuff, 0, dwInfSize);<br />
if (pbyInfBuff)<br />
{<br />
if (GetFileVersionInfo (pszAppName, 0, dwInfSize, pbyInfBuff))<br />
{<br />
if (VerQueryValue (pbyInfBuff,<br />
"\\VarFileInfo\\Translation",<br />
(void**)(&pdwLangChar),<br />
&uSize))<br />
{<br />
if (VerLanguageName (LOWORD (*pdwLangChar),<br />
szResource,<br />
sizeof(szResource)))<br />
{<br />
strncpy (pszLangBuff, szResource, iLangBuffLen);<br />
}<br />
wsprintf (szResource, "\\StringFileInfo\\%04X%04X\\FileVersion",<br />
LOWORD (*pdwLangChar), HIWORD (*pdwLangChar));<br />
<br />
if (VerQueryValue (pbyInfBuff,<br />
szResource,<br />
(void**)(&pszVersion),<br />
&uSize))<br />
{<br />
strncpy (pszVerBuff, pszVersion, iVerBuffLen-1);<br />
}<br />
}<br />
}<br />
delete [] pbyInfBuff;<br />
}<br />
}<br />
}
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Hey, we don't get many psychics on CP.
If I send you some function prototypes, can you send me some source back
(I checked the online MSDN and there's no MFC function documented called that, although I would have guessed that a and b were buffers, and the two constants were buffer sizes.)
Steve S
Developer for hire
|
|
|
|
|
What happens when an Object of CWinApp derived Class is Created in MFC ??
Can Somebody answer my above question .
Thanks in advance.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
What are the actions that takes take when I say CMyApp theApp;
in MFC Application ??
Looking forward for your reply.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
What are the actions that takes place when I say CMyApp theApp;
in MFC Application ??
Looking forward for your reply.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Patience is a virtue, and virtue brings it's own reward.
When the app is loaded, the constructor is called, which is done before WinMain (from the MFC library, unless you provided your own) is called. Mostly, this will just result in the base constructor(s) being called. Mostly, this just sets some object-specific data, and initialises the various state stuff used by MFC.
WinMain is then responsible for calling the object's InitInstance(), which usually triggers window creation and stuff like that.
Of course, the MFC source is available, which is where I found this.
Steve S
Developer for hire
|
|
|
|
|