|
The ObjMedia tool looks promising.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
How can I make the text in window titlebar in the center of titlebar, I can't find any check box in dialog properties?
|
|
|
|
|
There are no standard flags you can set to centre justify text in a title bar. If you need to do something like that then you will ahve to custom draw the caption yourself.
See the Custom caption article here at CP by David Lorde
If you vote me down, my score will only get lower
|
|
|
|
|
As far as i know there is no such method
present right now .
But can use a CString variable and then
format it according to the length of the
window.
Put this code on redraw window which will
dynamically change the caption when window
is redrawn
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
pc_dev wrote: How can I make the text in window titlebar in the center of titlebar, I can't find any check box in dialog properties?
There is no such property .. but you can centre your caption text simple mathematics... by providing extra space at start of your caption! or make your custom titlebar here is link for that :-
http://www.codeproject.com/wtl/titlebar.asp[^] [WTL]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi,
You may perform some calculation. For example, the following
code does it:
CString str = TEXT("My Title");
CRect rcWindow;
GetWindowRect(rcWindow);
TEXTMETRIC tm;
CDC *pdc = GetDC();
CSize szCaption = pdc->GetTextExtent(str);
pdc->GetTextMetrics(&tm);
int nAveCharWidth = pdc->GetTextExtent(" ").cx;
int x = (rcWindow.Width() / 2) - (szCaption.cx / 2);
int nWhites = x / nAveCharWidth;
CString strCaption = TEXT("");
for (int j = 0; j < nWhites; j ++)
{
strCaption += TEXT(" ");
}
strCaption += str;
ReleaseDC(pdc);
// Now strCaption will be set at the center of the title bar
SetWindowText(strCaption); // or do it yourself
--
======
Arman
|
|
|
|
|
Hi
I have a ICopyHook handler which i register for finding deletion of folders . When the folder is moved to recycle bin . The Handler is giving only the source path and i am not able to get the destination path(i.e) the path of the recycle bin . Any idea on how to get the destination path ?
Thanks in advance
|
|
|
|
|
Hi,
I want to set the focus to a CButton control.
I'm using GetDlgItem(IDC_MY_BUTTON)->SetFocus(); but it does not work.
It works for CEdit controls but not CButtons.
How can I set the focus to a CButton control?
|
|
|
|
|
actually, yes, it set the focus, but the problem is graphical (button style pb).
but i'd ask you one more thing : do you want to set the focus on the button, or change the default button ??
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You are correct, it does have focus, but does not accept the enter key.
I want to set the focus.
See the replys below
Many Thanks,
AORD
|
|
|
|
|
hum, it seems that what you need have been answered several ways, but at a low level...
did you try CWnd::GetDefID() ?
by using this function, the window the button is on will change its default button (it will remove the property from the last one to set it to the button you provide then). this way, you'll be able to press the "enter" key to use you button.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
AORD wrote: GetDlgItem(IDC_MY_BUTTON)->SetFocus();
Well, it wont work. I have been facing similar problems, and I go down to PostMessage() level. What you probably can do is, Get the handle of the button with which you would want to deal, and then continue by posting an appropriate message. The following code snippet should help solving your problem.
<br />
HWND hButton;<br />
GetDlgItem(ID_MYBUTTON, &hButton); <br />
::PostMessage(hButton, BN_SETFOCUS, 1, 0);<br />
Regards,
Rajesh R. Subramanian,
Cyberscape Multimeida Limited,
Bombay, India.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
See my answers down ...
SkyWalker
-- modified at 11:46 Monday 14th November, 2005
|
|
|
|
|
toxcct is right.
The button gets actually the focus. You can prove that to yourself by pressing the "space" key after you set the control to that button. You will see how it goes down and up.
SkyWalker
|
|
|
|
|
... and to see the difference, add
PostMessage(WM_KEYDOWN, (WPARAM)VK_TAB);
in OnInitDialog()
This will start showing you the focus rectangle on your buttons.
SkyWalker
|
|
|
|
|
It is not during InitDialog(), It is that he wants the button to achieve focus during run time. The fact is that It acquires focus but still is not clearly visble. My solution works, I hope.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
Rajesh R. Subramanian wrote: It is not during InitDialog(),
Correct. I want the user to press enter while the focus is on an CEdit control, then I want the focus to move to a CButton control. But the CButton control does not obtain its normal focus (as it would if the user had pressed the tab key).
Yes toxcct & Mircea you are correct, the CButton does obtain a sort of focus by using GetDlgItem(IDC_MY_BUTTON)->SetFocus(); and the button is drawn incorrectly and nothing happens when the enter key is pressed (the space key works).
::PostMessage(hButton, BN_SETFOCUS, 1, 0);<br /> This works the same as GetDlgItem(IDC_MY_BUTTON)->SetFocus(); .
PostMessage(WM_KEYDOWN, (WPARAM)VK_TAB);<br /> This strange because it moves the focus backwards, that is the focus does not follow the Layout Tab order, thats not expected. So I have changed the Tab order and now it works, but this is at odds with the tab order the user would expect
Thanks for the help , It's not quite right, but is close.
|
|
|
|
|
I wrote some useful code in my class
<br />
Class CMyListCtrl:public CListCtrl<br />
And now,I want to use these code in my new class CMyListView.
Originally,I want to inherit CMyListView from CMyListCtrl.
But I found that ListView do not inherit from ListCtrl.
So how can I use my own code for CMyListView with less modification!
Thanks a lot!
Don't look at me in that way!
|
|
|
|
|
CListView inherites from CCtrlView and eventually from CView in order to keep the documnet/view architecture whilst using a list view within your app....
in order to use your CMyListCtrl in a CListView i suggest embedding...i.e. embedd one in an other
class CMyListView : public CView
{
protected:
CMyListCtrl* m_pMyList;
}
hope this helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
you can use templates. See the source of CHTMLEditView and CHTMLEditCtrl.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
-- modified at 1:24 Tuesday 15th November, 2005
|
|
|
|
|
I am not understanding what is the diff b/w LUID and SID
where SID is unique to every user and present in access token.
It can also be present in DACL to control access during a logon session.
what is the purpose of LUID.
Pls help me.Thanx in advance
-- modified at 2:43 Monday 14th November, 2005
|
|
|
|
|
what i read just now is LUID is a log on ID for a user(or its SID).Whether it means LUID changes every time the same user(SID)log in.Is there any other purpose of LUID
Pls help me.Thanx in advance
-- modified at 3:02 Monday 14th November, 2005
|
|
|
|
|
Hey can u tell me how to create a Modelless dialogbox
in an MFC application.
Till date i was creating a ressouce of dialogbox from
resource editor , then added a class for it and later
on use to display it by usin code.
CmyDialobox dlgbox;
blgbos.DoModel();
How do make it modelless dialogbox so the user can aslo
interact with the background MDI application.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
dlgbox->Create(ID,parent);
dlgbox->ShowWindow(style);
|
|
|
|