|
Thanx for the help....
Regards
Programm3r
|
|
|
|
|
Hi, i want to create an SDI application without Frame And Menu bars.
And in this SDI application ,i split the window into 3 views.
How can i close all the views at a time by clicking one button in the top view?
|
|
|
|
|
kiranin wrote: want to create an SDI application without Frame And Menu bars
Create window without using style WS_OVERLAPPEDWINDOW .
kiranin wrote: And in this SDI application ,i split the window into 3 views.
How can i close all the views at a time by clicking one button in the top view?
Look for splitterwindow.
By the way, you have posted this question already, isn't it?
|
|
|
|
|
I tried But it only closes maximize, minimize and close buttons only Still caption Bar is Coming and also menu
|
|
|
|
|
kiranin wrote: I tried But it only closes maximize, minimize and close buttons only Still caption Bar is Coming and also menu
Are you sure ?
I talked about removing style WS_OVERLAPPEDWINDOW .
Can you show me how you have implemented in your code?
One way is to 0 use ModifyStyle to remove this style in OnCreate
|
|
|
|
|
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style &= ~WS_THICKFRAME;
cs.style &= ~WS_OVERLAPPED;
// optional - set initial window size
cs.cx = 400;
cs.cy = 670;
return TRUE;
}
|
|
|
|
|
Use ModifyStyle(WS_OVERLAPPEDWINDOW,0) in OnCreate of your function, instead of this.
|
|
|
|
|
How to Close and minimize the whole Application bu using a button in the top View.
And How to Paint menu or remove it?
|
|
|
|
|
kiranin wrote: How to Close and minimize the whole Application bu using a button in the top View.
send message WM_CLOSE for close button. and minimizing you need to use ShowWindow().
kiranin wrote: And How to Paint menu or remove it?
If you have use WS_OVERLAPPEDWINDOW style, there will be no menu.
|
|
|
|
|
|
kiranin wrote: menu is there yaar
You are doing some thing wrong. Try my suggestions above on sample SDI app.
|
|
|
|
|
How to Send WM_ClOSE MESSAGE TO THE BUTTON?
|
|
|
|
|
use,
PostMessage(AfxGetMainWnd(),WM_CLOSE,0,0);
|
|
|
|
|
Hi all,
How can I read from a dxf file format Using VC++ ,
Please Help me
Thanks in Advance
George K Jolly
|
|
|
|
|
georgekjolly wrote: How can I read from a dxf file format Using VC++ ,
this doesn't mean anything. you have to know what is stored in this file, if it is binary or text file first. if it is binary, you have to know what is structure of the datas.
what application does generate such .dxf files ?
|
|
|
|
|
I think it depends to AutoCad
|
|
|
|
|
|
Hi,
On a toolbar I am working on, the button is erased but it still responds to mouse clicks. I have already tried NOT to ANSWER the WM_ERASEBKGND; use BeginPaint-EndPaint, or GetDC-ReleaseDC instead, but the background is either erased or it is completely transparent and not drawn. Either way, the button does not show, but is active. Now, if I don't respond to WM_PAINT messages, the toolbar is correctly drawn, and the button is ok...
Do you know what I should do?
ThanX
mfranco
|
|
|
|
|
What is it exactly that you're trying to do?
|
|
|
|
|
I am just trying to change the bkgnd/text color of a static control, created during OnCreate(). To do this, when the browser is resized and Windows sends a WM_PAINT message, I wrote the OnPaint()->BeginPaint() to change it. Exactly: There is a main toolbar which holds a static control and a button. The OnPaint() is inside the .cpp of the main toolbar. Inside the OnPaint() I try to paint the main toolbar and the static control. The static control gets painted ok, and so does the main toolbar. However, the button disappears even if I don't paint anything like:
LRESULT CMFToolbar::OnPaint(UINT uMsg,WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
return 0;
}
->Result: Everything is in place, except for the button that disappears.
In sumary, what I need to do is this:
-> Create a static control to receive scrolling text feed;
-> Change the color of this text and the control's bkgnd;
-> Put an image on the toolbar;
-> Create a button that DOESN'T DISSAPEAR
Sorry if I can't explain very well, but I am more used to C programming, so talking about classes and how they are called, when there is no main function is a bit confusing for me
For instance, I do not understand very well the following piece of code:
<br />
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if (pWnd->GetDlgCtrlID() == IDC_MYSTATIC)<br />
{<br />
pDC->SetTextColor(RGB(255, 0, 0));<br />
pDC->SetBkMode(TRANSPARENT);<br />
hbr = GetStockObject( NULL_BRUSH );<br />
}<br />
<br />
return hbr;<br />
}<br />
-> What is CMyDlg? Is it the main toolbar?
-> Where do I put this kind of code?
-> Where is the BRUSH returned to?
Oh Well...
Sorry...
Thanks
|
|
|
|
|
mfranco_neto wrote: Now, if I don't respond to WM_PAINT messages, the toolbar is correctly drawn, and the button is ok...
What are you trying to do in WM_PAINT ?
Whatever area you paint you should validate, then let the default handler paint the rest.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
![Go to Parent](https://www.codeproject.com/App_Themes/CodeProject/Img/arrow-up24.png) Hi.
Ok, here's what I need to do:
|----- Edit Control (Child Window)
|
Main_Toolbar---- ----- Button
|
|------ Static Control (Child Window)
-> Create a toolbar with an edit box, for user input; (OK)
-> Create a button that responds to mouse click; (OK)
-> Create a static control with text; (ok)
-> Create a bitmap on the toolbar; (not ok yet, but i have not worked on it yet)
Now, how am I trying to do these:
-> Create everything inside the OnCreate(); (ok)
-> Position everything inside the OnSize(); (ok)
-> Change Static Control's Text/Bkgnd color inside OnPaint(); (NOT OK)
|
|---->
<br />
LRESULT CMFToolbar::OnPaint(UINT uMsg,WPARAM wParam, LPARAM lParam, BOOL& bHandled)<br />
{<br />
<br />
::OutputDebugString("WM_PAINT");<br />
<br />
PAINTSTRUCT ps, ps2;<br />
HDC hDC = NULL;<br />
HDC hDC2= NULL;<br />
RECT test_rect = {100,100,100,20};<br />
RECT bk_rect = {100,100,100,20};<br />
HRGN hRgn = NULL;<br />
HRGN hRgn2 = NULL;<br />
HBRUSH hBr = CreateSolidBrush(RGB(255,0,0));<br />
HBRUSH hBr2 = CreateSolidBrush(RGB(0,0,255));<br />
<br />
::GetClientRect(m_hWnd,&test_rect);<br />
::GetClientRect(m_ReadRssWnd,&bk_rect);<br />
<br />
hRgn2= CreateRectRgn(test_rect.right/3,test_rect.top,test_rect.right-300,test_rect.bottom);<br />
hRgn = CreateRectRgn(bk_rect.left+200,bk_rect.top,bk_rect.right-100,bk_rect.bottom);<br />
<br />
hDC2 =::BeginPaint(m_hWnd,&ps2);<br />
hDC =::BeginPaint(m_ReadRssWnd,&ps);<br />
<br />
::SelectClipRgn(hDC2,hRgn2);<br />
::SelectClipRgn(hDC,hRgn);<br />
<br />
::SetTextColor(hDC,RGB(255,255,255)); <br />
::SetBkColor(hDC,RGB(255,0,0));<br />
<br />
::FillRect(hDC2,&test_rect,hBr2); <br />
::FillRect(hDC,&bk_rect,hBr);<br />
<br />
::TextOut( hDC, 0, 0, _T("Some Text"), 9 );<br />
<br />
::EndPaint(m_ReadRssWnd,&ps);<br />
::EndPaint(m_hWnd,&ps2);<br />
<br />
return 0;<br />
<br />
}<br />
<br />
<br />
After the WM_PAINT message, even if I don't paint anything inside the OnPaint(), the button disappeas...
Some answers to other posts I had posted people said that I shouldn't call BeginPaint()-EndPaint() of the child window (m_ReadRssWnd) inside the OnPaint() of the main toolbar (m_hWnd).
I don't understand this... isn't there just one OnPaint() method?
Thanks in advance
|
|
|
|
|
You need to read up on how messages are handled/pumped/routed, WM_PAINT, Begin/EndPaint, Rebar controls, and OnCtrlColor.
I'm afraid the MSDN docs for all are too lengthy to replicate here.
In short, i think you may be making things harder than they need to be.
Try using a rebar and handle OnCtrlColor in the parent control.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
hi
i am using TableLayoutPanel ,and i have created some rows and columns and i want to work with cells.
my problem is that i want to control one cell by changing it color when the cursor in on it.
|
|
|
|
|
hey all,
iam trying to do the following.
the data gets stored in a group of files. the files have to be called back or opened at a later stage to plot.
on selecting a checkbox, the default or the first file name (of say, 4 files) should be displayed in an edit bar. the edit bar goes active only on clicking the check box. the edit bar should be able to scroll through to find all the available files. the files are stored with .txt extension.
the file that gets selected gets plotted which is done by clicking another pushbutton "plot".
I cannot get the file names to be displayed in the edit bar. how do i do it?
Thanks in advance.
|
|
|
|
|