|
How to change the background and the foreground color in a static control:
class CDescriptionCtrl : public CStatic
{
DECLARE_DYNAMIC(CDescriptionCtrl)
protected:
COLORREF m_colorText;
pDC->SetTextColor(m_colorText);
return (HBRUSH)m_brushBkgnd;
}
void CDescriptionCtrl::SetTextColor(const COLORREF rgbColor)
{
m_colorText = rgbColor;
RedrawWindow();
}
void CDescriptionCtrl::SetBkColor(const COLORREF rgbColor)
{
m_colorBkgnd = rgbColor;
m_brushBkgnd.DeleteObject();
m_brushBkgnd.CreateSolidBrush(rgbColor);
RedrawWindow();
}
You can set the font with CStatic::SetFont(...) method. Good luck!
|
|
|
|
|
To get ip address i have this code.
Do any one know any simple method to get current IP?
CString CSignIn::GetIP()
{
CString strIp;
WSADATA wsaData;
int nErrorCode = WSAStartup(MAKEWORD(1,1), &wsaData);
if (nErrorCode != 0) {
return _T("");
}
char strHostName[81];
if (gethostname(strHostName, 80)==0)
{
hostent *pHost = gethostbyname(strHostName);
if (pHost->h_addrtype == AF_INET)
{
in_addr **ppip=(in_addr**)pHost->h_addr_list;
while (*ppip)
{
in_addr ip=**ppip;
strIp = CString(inet_ntoa(ip));
ppip++;
if (strIp!=_T("")) {
break;
}
}
}
}
return strIp;
}
{/PRE>
JAYARAJ
|
|
|
|
|
|
How to make buttons on ToolBar with inequable Width?
I wish to create a application with multiframe
once you have opened several childframes,,there should be some corresponding buttons at the bottom of the mainframe.
when you click the button,corresponding childframe is showed.
I use the ToolBar to do that,but buttons on toolbar are all the same size.
in fact,different childframe has different length of titiles...
how can i make the buttons on toolbar show the titles of childframes according to the lenght of title.?
thanks
bruspark.
bruspark
|
|
|
|
|
bruspark wrote: How to make buttons on ToolBar with inequable Width?
Use a dialog bar.
Nibu thomas
Software Developer
|
|
|
|
|
thank you for your reply.
It seems that there is no relative member function to add a button to the CDialogBar.
If each time i add a button to the bar , i have to adjust the placement of buttons.,
With the increase of buttons int the bar ,that need do lots of work.
Thank you!
Bruspark
|
|
|
|
|
|
WhiteSky,thank u for your reply.
now,I am trying to use the CPropertySheet add views(May be derived from CView) to each page.
Bruspark
|
|
|
|
|
I made a project in Visual Studio 2005 with Unicode libraries enabled. The app I am building needs to support many languages (including the East Asian ones).
What does the Language property in the Resource View ( Resource View-->Right Click on a Dialog box-->Properties) affect? Should I set it to neutral? Or is it ok to leave the default setting on? (right now it's japanese, since i'm using a japanese OS)
Thanks!
|
|
|
|
|
I think this[^] will explain everything you are looking for.
|
|
|
|
|
i have no problem with localization and resource dll loading.
what i am concerned about is how this setting will affect the dialog box other than the strings resources (like the input method, etc).
|
|
|
|
|
Does the change in person mean that you typed 'I need to write in C++' and then entered your homework assignment ?
Either way, this is a great place to ask for help, but help means that you're stuck on something specific. The sort of broad level request you've made is more appropriate on places like rentacoder.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Looks like the thread I replied to was deleted, probably some sort of race condition occured on the site, I was replying, post got deleted, my reply went to you.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
now that you're here would you mind answering my question then?
|
|
|
|
|
I'd love to, but I live in an English speaking country, I've never had to write internationalised code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Dear List,
Greetings.Presently,I am doing Ph.D at PSG College of Technology,Tamilnadu,India under Anna University.My area of research is rapid prototyping.In this i need to devlop the code to slice the solid or surface models in to n no of thin layers.i.e dividing the solid in to layers.Please any one in the list,can you send me the comments or code for this using C or C++.
Thanking You,
With Warm Regards,
M.Sendil Kumar
M.Sendil Kumar,
Lecturer in Mechanical Engg.,
Dr.Mahalingam College of Engg & Technology,
Pollachi,
Tamilnadu,India -642 003
|
|
|
|
|
I have been putting it off for a month now because i couldnt find a real good place to start studying for this. So i figured I would ask you all here if you recommend some nice places or books to read to work with Internet programming using Windows Sockets or (if you think it is better) any other socket programming.
obviously if at all possible I'd like to study Windows sockets 2, but 1.1 is ok I guess. Remember before you say go read MSDN I am really new to Internet/Network Programming, so something that will guide me is truly the most helpful.
Thanks
|
|
|
|
|
I have a trouble of getting the caption of a menu item when user use arrow key up/down to move the light on the menu.
For example, with NotePade, I can hook WM_SELECTMENU to see the handle of a menu. So, I can use the API function "GetMenuString" to get the caption.
However, with MS.Word, the menu is not the menu of the windows's system, so I can't get the caption of menu item by the above way. The menu class name used in MS.Word is "MsoCommandBar", I used Spy++ to see the messages related to this class. However, I can't get anything to solve my trouble.
I'm in dark. Please, help me. Thanks a lot..
|
|
|
|
|
vtalau wrote: However, with MS.Word, the menu is not the menu of the windows's system, so I can't get the caption of menu item by the above way. The menu class name used in MS.Word is "MsoCommandBar", I used Spy++ to see the messages related to this class. However, I can't get anything to solve my trouble.
I'm in dark. Please, help me. Thanks a lot..
I did face the same problem sometime back.
From MSDN:
GetMenu does not work on floating menu bars. Floating menu bars are custom controls that mimic standard menus; they are not menus. To get the handle on a floating menu bar, use the Active Accessibility APIs.
Nibu thomas
Software Developer
|
|
|
|
|
would you like to give me the pages which have information of the Active Accessibility APIs in detail, please?. I ever searched by Google with the key word of "Accessibility API", but I can find nothing related to my problems.
|
|
|
|
|
Even I did
Nibu thomas
Software Developer
|
|
|
|
|
would you like to give me a small example code to do that, please?. I'm a student, I'm fond of Win32, I'm trying to do that.
|
|
|
|
|
I'm confused. If you have a header named "myheader.h" defined has:
#ifndef MyHeaderH
#define MyHeaderH
#endif // MyHeader
Then what's the use of the "#pragma once" directive if both are used to include a file only once? Or am I wrong and they have different purposes?
I've seen the "#pragma once" definition here
Thanks in advance
hint_54
|
|
|
|
|
Well AFAIK both accomplishes the same purpose. Apart from that(AFAIK) #pragma maintains a list of included files too.
Nibu thomas
Software Developer
|
|
|
|