|
How about the current set of properties for example :
the page contains a listview and the text of the listview items is set at a particular set of properties font,size,color etc.
Now can we get the properties of the currently displayed text in the listview.
|
|
|
|
|
sure, if the author of the control wants to store and report all the font usage for that control, you'll be able to get it. but in general, there's no way to know which fonts a window has used.
|
|
|
|
|
As Chris said, it is not guaranteed to get what you want.
A window or control has an associated device context and a device context has an associated font.
However, when a window draws text it can change this.
You can get the currently associated font using the GetTextMetrics[^] function.
But this may not be the expected result.
|
|
|
|
|
You could try experimenting with API hooking, however, this might prove to be quite a challange, if possible at all, and it might or might not produce the required result.
You could try hooking the GetDC[^], GetWindowDC[^], BeginPaint[^]... (and probably their counterparts also, ReleaseDC, EndPaint, ...) and the kinds, also DrawText[^], DrawTextEx[^], TextOut[^], ..., keep track of the connection between the Device Contexts and window handles, querying the font information at the right places (e.g. like when DrawText is called).
Check out this article: API hooking revealed[^] for more info on API hooking. The hooking part itself is somewhat easier if you try to hook things in your own process, no need to 'Inject' a DLL, you can simply load it.
Btw, why do you need that information? Just curious here...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
In general case, except the discovering of the font color :
void TryGetFontInfo(CWnd* pcWnd)
{
if (pcWnd->GetSafeHwnd()) {
CFont* pcFont(pcWnd->GetFont());
if (pcFont->GetSafeHandle()) {
LOGFONT sLF = {0};
pcFont->GetLogFont(&sLF);
}
}
}
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Hi all,
How to keep the Modeless dialog Active on the screen.
I have created modeless dialog,when i click outside that dialog that dialog gets disappered.
How can i make it active,even if i click outside the dialog to modify something.
I dont want to make it as Modal because,i cant go to other dialog for modification
Please let me know any suggestions
Thanks
Sharan
|
|
|
|
|
Try adding WS_TOPMOST[^] to the extended style of your dialog.
The best things in life are not things.
|
|
|
|
|
This is expected behavior, if you click outside a modeless dialog, the focus goes to whatever you selected, that's what modeless dialogs do. If you don't want to lose focus, use a modal dialog. You can use the top most approach that was suggested, but your dialog is going to always be in the way of whatever it is you're selecting behind it so this should only be done if your dialog is small.
|
|
|
|
|
Simply set the System Modal property of the dialog to True and it will get the top most style.
|
|
|
|
|
«_Superman_» wrote: Simply set the System Modal property of the dialog to True
if you put system modal property to true,it will lose it basic functionality as modeless dialog box
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
// I have created modeless dialog...
What parent was set ?
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
So which C++ documentation tools have you used? I know about Doxygen, of course. I'm just wondering if there's anything better/easier to use. It doesn't have to be free.
|
|
|
|
|
i use // and, sometimes, /*...*/
|
|
|
|
|
Chris Losinger wrote: use // and, sometimes, /*...*/
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I use the MSDN recommended XML Documentation[^] these days, but I only code for my own amusement.
The best things in life are not things.
|
|
|
|
|
I also use Doxygen, but I've also set up my UML tool, Enterprise Architect, to automatically convert the comments I add in the diagrams to the right format for Doxygen, and I set up my VisualAssist makros to also create function header documentation in the right format with all parameters and the return value listed. So all I have to do is fill in the actual meaning, no matter whether the code comes straight from UML, or has been added within VS.
The funny thing is, noone ever looks at the docs I created with Doxygen, people (including myself) are happy enough just with the oddly formatted comments 
|
|
|
|
|
What are the differences between overlapped window and popup window. Does the overlap mean that window can overlap each other? and popup window can't?
|
|
|
|
|
Perhaps you should return to go and collect $200?
MSDN: Window Styles[^]
|
|
|
|
|
enhzflep wrote: Perhaps you should return to go and collect $200?
where i should i give my account no!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I think the Microsoft documentation could be a bit clearer. In reality the basics of both types are the same but the overlapped window has a title bar and a border. you can see for yourself by creating a very basic Win32 program (as described in Win32 Window Minimal[^]) and experimenting with the different window styles.
The best things in life are not things.
|
|
|
|
|
Hello,
I need to use this macro to make my menus, but this don't work right!
All samples that I have are used with CMainFrame class.
I need this to use wit CDialog based application!
My question is, works this macro with(in) CDialog???
Thanks for any help!
Arrin
|
|
|
|
|
Have you tried it, and if so, what were your results? Alternatively you can find a lot of suggestions here[^].
The best things in life are not things.
|
|
|
|
|
You'll need to handle the WM_KICKIDLE message in order to work with ON_UPDATE_COMMAND_UI in your dialogs.
Here[^] is a very detailed article on this topic.
This[^] CP article might also be useful. 
|
|
|
|
|
Hello !
I use WSAAsyncSelect to do a small ChatSystem in the WLAN Server.
(the max client may be has 100-200 online,and the ordinary time is 30-50 online at the same time.)
like this:
SOCKET sock = (SOCKET) wParam;
if(WSAGETSELECTERROR(lParam)){
DeleteClient(sock);
return;
}
switch(WSAGETSELECTEVENT(lParam)){
case FD_ACCEPT:
sClient = accept(wParam, (struct sockaddr *)&client, &iAddrSize);
WSAAsyncSelect(sClient, hwnd, WM_SOCKET, FD_READ | FD_CLOSE);
break;
case FD_READ:
ReadData(sock);
break;
case FD_CLOSE:
DeleteClient(sock);
break;
default:
break;
}
at last ,when add/del client, it will refresh onlines info to the Server's list control. May be it doesn't receive the FD_CLOSE message.
but usually ,it has some few days ago results. I run in the Lan and use other Lan computer to test it, but can't found this problem.
How about this ?
Thanks for you reply !
|
|
|
|
|
hello i hope this will work.
don't use WSAAsyncSelect() probably your window might be missing some messages posted by
mfc socket framework (This will happen)
use WSAEventSelect() by creating one more thread. send notification messages to your main window by using SendMessage() function. it will work perfectly.
Possibly one more reason is
Socket abort operation notification will take at most 2 msi cylcles ( 1 msi is 2 minutes).
this is tcp ip implementation
bye
yln
|
|
|
|