|
Get the menu handle or CMenu object(before the menu popup),use ModifyMenu to assign every menu item MF_OWNERDRAW style.
And then your windows will be receive WM_MEASUREITEM and WM_DRAWITEM message,in the message handler
you measure your menu item size and draw it as your wish. If you use MFC,it would be more easy. MFC
will call your CMenu::MeasureItem and CMenu::DrawItem() automatically.
BTW:
you can find BCMenu in CP.
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Thanks, I found BCMenu, and it works pretty nice.
|
|
|
|
|
Hi,
I have created a Named Pipe with a NULL DACL security descriptor to allow everyone to access the pipe on a server application and have also created a client application to connect to it. All works fine if client and server are on the same machine but i get a
0x0000052e Logon failure: unknown user name or bad password.
When using a remote client.
Anybody shed some light on this will be appreciated.
Ceri
|
|
|
|
|
If you specify NULL as DACL, the named pipe gets a default security descriptor. The ACLs in the default security descriptor for a named pipe grant full control to the LocalSystem account, administrators, and the creator owner. They also grant read access to members of the Everyone group and the anonymous account.
So check if u can communicate with client machine with administartor rights.
Else set named pipe's security descriptor by calling the SetSecurityInfo function.
Chill,
The chosen One
|
|
|
|
|
No, that is incorrect. That's true if you specify NULL for the lpSecurityAttributes to CreateNamedPipe. I am creating a security attribute structure but the DACL for the security descriptor is NULL - see below
<br />
<br />
<br />
SECURITY_ATTRIBUTES saPipeSecurity;<br />
PSECURITY_DESCRIPTOR pPipeSD = NULL;<br />
<br />
memset ( ( VOID *) &saPipeSecurity, 0, sizeof ( SECURITY_ATTRIBUTES) );<br />
<br />
if ( ! ( pPipeSD = ( PSECURITY_DESCRIPTOR) <br />
( malloc ( SECURITY_DESCRIPTOR_MIN_LENGTH)) ) )<br />
return FALSE;<br />
<br />
if ( ! InitializeSecurityDescriptor ( pPipeSD, <br />
SECURITY_DESCRIPTOR_REVISION) )<br />
return FALSE;<br />
<br />
if ( ! SetSecurityDescriptorDacl ( pPipeSD, TRUE, ( PACL) NULL, FALSE) )<br />
return FALSE;<br />
<br />
saPipeSecurity.nLength = sizeof ( SECURITY_ATTRIBUTES);<br />
saPipeSecurity.bInheritHandle = TRUE; <br />
saPipeSecurity.lpSecurityDescriptor = pPipeSD;<br />
<br />
<br />
HANDLE hPipe = CreateNamedPipe("\\\\.\\pipe\\PipeTest",PIPE_ACCESS_INBOUND ,PIPE_TYPE_BYTE,PIPE_UNLIMITED_INSTANCES,4086,4086,20000,&saPipeSecurity);<br />
<br />
|
|
|
|
|
Hi CPians,
I'd like to write a small dialog app doing a kind of Search in File just like the one in Visual C++. Does anybody know how this works ? The search is really fast, so I think there must be another solution than loading the file as text in a CString and applying the Find method
Thanks for the advices
~RaGE();
|
|
|
|
|
One solution is file-mapping.
Kuphryn
|
|
|
|
|
hello
can some body tell me about TAPI 3 COM based working in Visual C++. i am doing "internet telephony" project. where i need that codec for interactive voice support using Visual C++ 6 and TAPI 3.
thanks
|
|
|
|
|
|
Hello,
I' ve downloaded the complete February 2003 platform SDK and am now trying to install it on my WinXP SP1 box. But when I run the setup I get an error saying "Only XMLSchemaCache schema collections can be used. The xml is not valid". I've searched Google and Microsoft but came up with nothing.
Can anyone help me with this?
Thanks,
Arjan.
|
|
|
|
|
it does not support XP home edition
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
I have Professional!
Arjan.
|
|
|
|
|
Try installing MS XML 4, and making sure that works. It may be that the installer (which I believe uses XML) cannot cope with the version of the MS XML stuff you have installed.
Having said that, I've installed the same SDK from CD (I have MSDN) on WinXPSP1 with no problems.
Steve S
|
|
|
|
|
hi
can some body tell me about codec support in UnimodemV for voice support. i am doing "internet telephony" project. where i need that codec for interactive voice support using Visual C++ 6 and TAPI 3.
thanks
|
|
|
|
|
you won't be able to if u ask questions like that!
Don't try it, just do it!
|
|
|
|
|
i would like to know how do i convert different image files to BMP format and again back to original format from BMP without using MFC.
|
|
|
|
|
Check out CxImage on Code project, you will find that very usefull.
The World is getting smaller and so are the people.
|
|
|
|
|
Thanks for the reply.but the code given there is in c++,whereas im working in Win32.Plz tell me if u find any thing code or reference which converts the files ...(Win32)..
|
|
|
|
|
What do you mean you are working in Win32. You must be using some kind of compiler C, C++, VB to use the Win32 API's.
|
|
|
|
|
I think CxImage is not dependent on MFC, so you can use those classes without any prob.but need to check on that wheather it uses MFC or not. Doing image manupulation in pure C is a heavy task, i dont even want to think about that.
The World is getting smaller and so are the people.
|
|
|
|
|
CxImage can be running on Linux. So, I guess it is MFC independent.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I have an object od CBitmap.
I have to get text dynamically and display in Bitmap..
So guys any idea how to Write a text in a Bitmap ....
String is CString type and not another bmp
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Construct a DC from the CPaintDC, and use DrawText of gdi function to draw on the screen...
Cheers
Regards.
The World is getting smaller and so are the people.
|
|
|
|
|
The simple way:
Load the bitmap into a CBitmap. Get it's dimensions and construct a target-compatible, memory-based DC. As an example, create a DC based on the device context of the window you wish to display the bitmap in.
Then select the CBitmap into the memory-based DC, use the TextOut function to write a string of text to it. Now you can use the BitBlt function to copy bits from the in-memory DC (containing the bitmap and the text) to the window display DC (most apparently blank).
See the MSDN for CDC:CreateCompatibleDC for an example, which loads a bitmap from a resource file, then spanks it to a window. The idea behind everything is that when you "select" a bitmap to a DC, the DC will represent the drawing surface of this bitmap.
For a more in-depth explanation and tutorials, see Chris Becke's tutorial Bitmap Basics - A GDI tutorial[^]
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
create a DC based on the device context of the window you wish to display the bitmap in.
Actually that bmp is not fixed on a particular window..
Basically its a dragImage.It moves along with the mouse pointer...
So will ur solution work for this case?
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|