|
Hi!
Is it possible to use the CColorDialog in a win32 api c++ application without mfc?
Thank you very much for your answers in advance!
Well... I am a beginner ...
|
|
|
|
|
You might want to check the API-call ChooseColor .
|
|
|
|
|
Hi,
I am a new in VC++
I made dialog box in MFC
I create a dialog box, which contains three-command button.
OK, Cancel and Apply. Then I place Tab Control on this dialog box. Tab control contains three pages like page1, page2 and page3. Page1 contains three-radio button namely Radio1, Radio2 and Radio3.Now I would like to do operations on Radio Button.
If I select Radio1, Apply button should be enabled the clicking on the Apply Button, It should be disabled. Similarly on Radio button2 and Radio button3. I know how to Enable/Disable Apply button-
CButton but;
but.Attach(GetDlgItem(IDC_APPLY)->GetSafeHwnd());
but.EnableWindow(FALSE);
but.Detach();
Please help me.
rajesh
|
|
|
|
|
Repost... : My post...[^]
BOOL Cwnd::EnableWindow(BOOL bEnable = TRUE); <font style="color:green;">
TOXCCT >>> GEII power
|
|
|
|
|
I have a tree control that reads data from database and draw it on creation, I need it to refresh once the database has changed.
The point is, I want to keep the tree control synchonized by event driven method. What message is appropiate to send to the tree control ?
Horace
|
|
|
|
|
hello friends
how can i deny the list control column resizing when we double click the header control???
mind is everything.
|
|
|
|
|
|
Cohen , THANKS FOR YOUR RESPONSE
IN THAT ARTICLE THEY SAYS
The header control in the ListView control sends notification to the parent window (e.i. the ListView) before it begins resizing a column. We can override the OnNotify() function in the CListCtrl derived class to handle this notification. The code below prevents resizing of all columns. Note that the resize cursor still shows up.
BOOL CMyListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
switch (((NMHDR*)lParam)->code)
{
case HDN_BEGINTRACKW:
case HDN_BEGINTRACKA:
*pResult = TRUE; // disable tracking
return TRUE; // Processed message
}
return CListCtrl::OnNotify(wParam, lParam, pResult);
}
BUT DIDNT WORK WITH MY LIST CONTROL....
ANY IDEA ??????????
mind is everything.
|
|
|
|
|
Hi..How to display tooltip on toolbar button..
Thanks
---Sumit Kapoor---
|
|
|
|
|
How to save HTMLs into a single file? First,I want to save several HTMLs,not only one; Second,I will save them into a file that with my own format. Third,without any source(jpg,gif)lost. Most important is that how should I make my own file format. Can you help me? Thank you very much!
Alick
|
|
|
|
|
but this already exist...
it is the mht file type...
TOXCCT >>> GEII power
|
|
|
|
|
What do you mean by: "without any source(jpg,gif)lost"?
Do you want to put the jpg's in the same file?
For the HTML it would be easy... open byte mode read a html file write it to your file, read another and add it to your other file... It would be good if you put some kind of seperator between those html's such as ~seperator~ . For the jpg or other sources you can add them in the same way but you have to write somewhere in your file (The top would be good) the filename,etc...
For the file format I have no information... I think you have to write your extension into the registry and specify the application for it...
Well... I am a beginner ...
|
|
|
|
|
Hi
Provided that I have a class declaration as follows:
class A
{
...
}
and a class object a1:
A a1;
I want to know the difference between the following:
A a2 = a1; (1)
A a2(a1); (2)
A a2 = A(); (3)
A a2(A()); (4)
What is the most preferred? My colleague says that (1) and (2) are equal, since (1) will call the copy contructor automatically and operator= will not be called, is that true?
Thanks!
|
|
|
|
|
** cough **
I was not only wrong, but very wrong
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
When class A has a copy constructor, these lines:
A a2 = a1;
A a2(a1); mean the same thing. The first line does not call operator= (this is a misconception I see posted occasionally). Likewise, lines 3 and 4 construct a new A object then use the copy constructor to copy it into a2 .
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Hi
Thanks for the reply. I have one more question regarding the copy constructor though:
If I'm not wrong, the = operator usually returns an object (in this case, it returns A& [or const A&? or const A? or A?, I'm not sure here, any help will be appreciated]), but since the copy constructor does not return anything, does this mean that the = operator in this case will not return anything also?
Thanks!
|
|
|
|
|
As I said, that is a constructor call in disguise, it doesn't call operator= . The reasoning is that in C you write:
int x = 1; but in C++ the original syntax was the constructor-call one:
A a1;
A a2(a1); So to make the two congruent, C++ also added these:
int x(1);
A a2 = a1; which both initialize a variable. For C++ objects this calls an available constructor with one parameter. If you want to call a constructor with more parameters, you have to use the a2(a1) style of syntax.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot stop me with paramecium alone!
|
|
|
|
|
Hmm, I could have sworn Meyers explicitly states that not to be the case. However, testing shows you to be correct on your first point but not the second. All four variations result in the same thing.
When I get into work, I will check Meyer's book.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Ok, I checked Meyers and it was an attack of bad memory. He mentions this case:
std::string me;
me = "Bob";
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Hi,
I am trying to create a simple Dialog Based form but have run into a problem that has me stumped.
My code is something like this:
HWND HWndParent;
WinMain(....) {
HWND HWNDStatus;
HWndParent = CreateWindow("PintrackrApp", "Pintracker",
WS_DLGFRAME|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX
|WS_BORDER, 200, 100, 600, 350, NULL,NULL,
hInstance, NULL);
HWndStatus = StatusBarCreate(hInstance);
ShowWindow(HwndParent,nShowCmd);
ShowWindow(HWndToolbar,nShowCmd); //This is fine
ShowWindow(HWndStatus,nShowCmd);
//Window message loop here
}
HWND StatusBarCreate(HINSTANCE hInstance) {
HWND StatusBar;
RECT rectTest;
int nArray[2];
int nParts;
InitCommonControls();
StatusBar = CreateWindow(STATUSCLASSNAME,"Test Status Bar",
WS_CHILD | WS_VISIBLE | WS_BORDER,
351,0,0,0,HWndParent,NULL,HInstance,NULL);
StatusDC = GetDC(HWndParent);
GetClientRect(HWndParent, &rectTest);
ReleaseDC(HWndParent, StatusDC);
nArray[0] = (rectTest.right)/2;
nArray[1] = (rectTest.right);
GetClientRect(HWndParent,&rectTest);
SendMessage(StatusBar,SB_SETPARTS,sizeof(nArray)/sizeof(nArray[0]), (LPARAM) (LPINT) nArray);
SendMessage(StatusBar,SB_SETTEXT,0(LPARAM) (LPSTR) "TEST STATUS MESSAGE");
SendMessage(StatusBar,SB_SETTEST,1,(LPARAM) (LPSTR) "Test Msg2");
return(StatusBar);
}
Everything compiles ok but when I run the program and display the window I don't see the status bar. If I maximize the window I see the Status Bar displayed about halfway down in my window. Both of the messages and partitions appear to be correct. The status bar is also only as wide as my Toolbar. It does not fill the whole width of my window.
I have tried searching MSDN & Code Project Fourms and the only thing I found suggested checking that my screen resolution is not smaller than my window. The screen resolution is 1024 x 768 and my windwo is 600 X 350. I am Stumped, I thought windows was supposed to be smart enough to place the status bar at the bottom of the window. Any ideas?
RWA
|
|
|
|
|
|
Huh? What does Clikety[^] mean?
|
|
|
|
|
|
Ok, once you explained it Clikety I was able to follow the link. Thanks.
I did some more research on this myself and finally figured it out . In the Platform(?) SDK MSDN doc it mentions that windows defaults it's positions for a new window based on the last window created. Since I was creating a Toolbar before the Status bar the Status Bar was placed in a position I didn't expect. I experimented a little and finally got the right positioning when I create the Status Bar BEFORE I create the Toolbar....
Thanks for your efforts....
|
|
|
|