|
use SetLayeredWindowAttributes set a dialog .
but i don't want the button and title to be transparent too.
how to do?
|
|
|
|
|
This happens because the dialog background and the button face have the same color value.
You could change the background color of the dialog so that it is slightly different from that of the button face.
Now you can specify the dialog background color as the second parameter to SetLayeredWindowAttributes .
You can change the dialog background color by handling the WM_CTLCOLORDLG[^] notification or if you're using MFC you can use CWinApp::SetDialogBkColor[^] function.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
hi everybory.
I using VC++6.0. if I have font name and font size of text => text height and text width ?
hope everybody help for me.
thanks very much.
nothing
|
|
|
|
|
You can use the GetTextMetrics[^] function to get the font height and width.
First get a handle to the font using CreateFont[^] or CreateFontIndirect[^].
Then create a device context using GetDC[^] and select the font into the device context using SelectObject[^].
Now you can use GetTextMetrics on the device context handle.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi, every one:
I have a problem with the underline style of richedit.let me descrip it in detail:
1,I input "abc" in richedit.
2,Then, i set only "c" with underline style."ab" remains the old style.
3,I select "abc" and set the bold or italic style to all of them.
4,"abc" has the style of bold or italic, and all the three characters have the underline style.This is confusing.The reasonable result is only the "c" has the underline style.
the code snippet i use is:
//set underline style
INT nStart, nEnd;
SendMessage( EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd, NULL );
CHARFORMAT2W cf;
ZeroMemory( &cf, sizeof( cf ) );
cf.cbSize = sizeof( cf );
SendMessage( EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
cf.dwMask |= CFM_UNDERLINE;
cf.dwEffects |= CFE_UNDERLINE;
SendMessage( EM_SETSEL, nStart, nEnd, NULL );
SendMessage( EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
//set bold style
INT nStart, nEnd;
SendMessage( EM_GETSEL, (WPARAM)&nStart, (LPARAM)&nEnd, NULL );
CHARFORMAT2W cf;
ZeroMemory( &cf, sizeof( cf ) );
cf.cbSize = sizeof( cf );
SendMessage( EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
cf.dwMask |= CFM_BOLD;
cf.dwEffects |= CFE_BOLD;
SendMessage( EM_SETSEL, nStart, nEnd, NULL );
SendMessage( EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf, NULL );
Is there any bug in my code?please help me.
|
|
|
|
|
I solved this problem today just now, the CHARFORMAT works. it is confusing too for me.
Is this a bug of richedit?
|
|
|
|
|
Hallo, i have an SDI-Application it is View class derived directly from CView, i need tob e able to change the output in it or to move the cursor with ctrl+pos1 or ctrl+end .Important: I can not use the class CRichEditView instead of CView to drive the View of my application. Thanks.
|
|
|
|
|
The text you can change with SetWindowText[^].
You can move the blinking cursor using SetCaretPos[^].
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
The problem is i do not have a blinking cursor., because this is a view derived from CView calss.
|
|
|
|
|
Did you try calling SetCaretPos ?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
susanne1 wrote: Important: I can not use the class CRichEditView instead of CView to drive the View of my application.
And what about the CEditView[^] ?
If you implement directly from CView, you don't have any support for text (so, no cursor neither) or you will need to implement it yourself.
|
|
|
|
|
You need to do what ? a text editor ? and you cannot use either CEditView or CRichEditView ?
This signature was proudly tested on animals.
|
|
|
|
|
i need to print out the results of a database query, a class derived directly from CView is the only suitable possible solution till now i had before classes derived from CRichEditView and CEditView buut i hhad a lot of disadvanteges and ristrictions with them.
|
|
|
|
|
Stick an edit control in the view, occupying all of the view. (Which is, for all intents and purposes, what CEditView does, so why not use it?)
|
|
|
|
|
susanne1 wrote: Important: I can not use the class CRichEditView instead of CView to drive the View of my application.
Why? This restriction severly limits, if not eliminates altogether, your options.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I dont think, it is good to use CView instead of CEditView or CRichEditView.
If you can derive a class from CView then you have handle SetCaretPos, SetWindowText and all to get the text support as suggested by earlier posters.
Величие не Бога может быть недооценена.
|
|
|
|
|
1/ Your question isn't really about SDI - it would be equally true from MDI too.
2/ If you're not allowed to use a Richedit control, maybe just a simple CEDitView?
3/ If you can;'t use that... then how about:
Crystal Edit - syntax coloring text editor[^]
It's not trivial to use, but I've used it for an in-program script editor with syntax colouring in the past to good effect.
Good luck!
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
First off, you should use CScrollView, rather than CView.
Secondly, you need to either register a custom window class with a custom cursor and override the PreCreateWindow method (preferred), or handle WM_SETCURSOR messages and call SetCursor() with the proper cursor handle, previously loaded in your init code (will flicker).
onwards and upwards...
|
|
|
|
|
Hi,
how to use external function in a dll from c
For Example:I have one function(say random value generation) in C.
So the same function i want to use for my another C project using that dll.
How can i call old project function from currect project using dll.
I tried "#pragma dll(MyFile)"...
Wat i did is copy paste that dll to cureect project folder and create one header file, in that file i used #pragma dll(MyFile)->MyFile is dll name.
But it is giving complier error...Plz help me ASAP.
Thanks,
Mohan.T
Mohan t working for N.I.C
|
|
|
|
|
mohant$.net wrote: But it is giving complier error...Plz help me ASAP.
The volume of your speakers is set too low so I'm unable to hear the error message. Can you please tell us what it is?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for ur replay
Below are the errors am getting:
testdll error LNK2019: unresolved external symbol _calling referenced in function _prttext
testdll fatal error LNK1120: 1 unresolved externals.
U have any other method to call the function means please forward me.....
Mohan t working for N.I.C
|
|
|
|
|
Have you declared _calling() after the #pragma directive?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
No,
I will try that
Thanks Much
Mohan t working for N.I.C
|
|
|
|
|
|
Hello,
i'm working on PC/SC smart card. i'm using microsoft's winscard.dll for smart card interaction. while sending a full 256 byte using SCardTransmit it is returning 0x0000000e (not enough memory). I tried to allocate memory by manually using malloc but still it's failing. Here is my code.
unsigned char photo_buff[21000];
div_t div_result;
char quo[2],rem[2];
photo_buff[0]=0xF5;
DWORD lReturn;
DWORD dwRecv;
DWORD last_block;
int size;
size=Convert_to_Hex((unsigned char *)photofinger_size_char,4);
photo_buff[1]=Hex_OP[0];
photo_buff[2]=Hex_OP[1];
last_block=(photofinger_size+3)/255;
memcpy(photo_buff+3,image,photofinger_size);
for(i=0;i<photofinger_size+3;i=i+255)
{
ZeroMemory(CmdBytes.bdata,sizeof(CmdBytes.bdata));
/*CmdBytes.bIns=0xD0;
CmdBytes.bCla=0x00;*/
send_buff_new[0]=0x00;
send_buff_new[1]=0xD0;
div_result=div(i,256);
itoa(div_result.quot,(char *)quo,16);
if(div_result.quot<16)
{
quo[1]=quo [0];
quo[0]=0x00;
}
Convert_to_Hex((unsigned char *)quo,2);
CmdBytes.bP1=Hex_OP[0];
itoa(div_result.rem,(char *)rem,16);
Convert_to_Hex((unsigned char *)rem,2);
CmdBytes.bP2=Hex_OP[0];
CmdBytes.bP3=0xFF;
memcpy(CmdBytes.bdata,photo_buff+i,255);
lReturn = SCardTransmit(hCardHandle,
SCARD_PCI_T0,
(PUCHAR)&CmdBytes,
256+5,
NULL,
pbRecv,
&dwRecv ); //lReturn returns 0x0000000e
}
return 1;
}
If anybody came across this problem please help me.
-----
deepakect
|
|
|
|