|
By "logical" do you mean like C: and D:?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
|
Then I concur with John's suggestion.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
What about UNC and administrative shares? Is this an option.
\\MachineName\c$
\\MachineName\d$
John
|
|
|
|
|
This about the 10th time I've posted this and still haven't gotten any definitive answer.
I have two classes, and one from CWinApp and one from CFrameWnd. All I want to do is print "abc" initialized in the constructor in random colored letters.
Could someone provide an moethod to accomplish this?
I alredy know GetAt() and CString str[i]... etc, but have been unsuccessful in getting the CString in anything but one color. I need an ALGORITHIM- thanks
|
|
|
|
|
SkunkedWorks wrote:
This about the 10th time I've posted this
And the 10th time you expect to get a definitive answer!?
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
SkunkedWorks wrote:
This about the 10th time I've posted this and still haven't gotten any definitive answer.
I guess it helps to ask the right question.
CString strText = "Hello World";
COLORREF color = 0;
pDC->SetTextAlign(TA_UPDATECP);
for (int x = 0; x < strText.GetLength(); x++)
{
pDC->SetTextColor(color);
color += 1525201;
pDC->TextOut(0, 0, strText.Mid(x, 1));
}
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
To get random value, do this
// initialize the random number generator
srand( (unsigned)time(NULL) );
// get random value
color += rand();
Hope this is what you are asking about.
|
|
|
|
|
xianwuluo wrote:
Hope this is what you are asking about.
No, but perhaps SkunkedWorks might be interested.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi,
My mdi application has a CDialogBar window (say child) in it. i need to show some message when the mouse is moved over the child. I tried 'GetCursorPos' but it is giving co-ords relative to the screen and so when i resize MDI i dont get the actual co-ords.
I tried OnMouseMove too. I gets message when mouse focus is on the child but i need to get notified when window loses the focus.
Do you know how to do this ?
Thankx,
abintom
|
|
|
|
|
isn't it possible to create a message handler for WM_MOUSEMOVE?
Don't try it, just do it!
|
|
|
|
|
|
Also note that it is easy to convert coordinates. For screen to client coordinates call ScreenToClient. This can be done for any desired window.
|
|
|
|
|
Hi,
Hei Alex, Blake and Bill.. Thankx for the tips.
I did it with the help of TRACKMOUSEEVENT and OnMouseLeave.. Thanks all,
cheers,
Abin
|
|
|
|
|
i have created a modal window using MFC, as soon as ENTER key is pressed the window is destroyed. what to do to avoid this?
|
|
|
|
|
Add a function to the dialog class
virtual void OnOK();
void CMyDlg::OnOK()
{
}
hope this helps and get a good MFC book
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Add a handler for the Ok and Cancel buttons and remove the call to OnOk() and OnCancel() in these functions.
|
|
|
|
|
I prefer to override PreTranslateMessage and handle the CR myself
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
{
if ((pMsg->message == WM_KEYUP) || (pMsg->message == WM_KEYDOWN))
{
if (pMsg->wParam == VK_RETURN)
{
<p></p>
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Hi All,
I have a requiremnt in vc++ where i have to check for the user currently logged in(Administrator OR normal User). If it is normal user then i should be able to set previleges to create file in "C:\ProgramFiles" and do some other things.
please send me the code if possible.
regards,
Prax
|
|
|
|
|
use this api to detect IS LOGGED ON USER IS ADMINISTRATOR or NOT?
NetUserGetInfo(ServerName,UserName,UEERINFO_1,BUF_PTR)
and to get Current USername ->
GetUserName()
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Whilst this is true, this is not a valid way to determine if the user logged on is the Administrator account on the computer, since you can rename the Administrator account using the Group Policy Editor.
--
Andrew.
|
|
|
|
|
A normal user (or more accurately a "restricted user") account doesn't have write access to the Program Files tree. Such an account also can't change the DACL on the directory, for security reasons. The right thing to do is fix the program so it doesn't write to Program files - the \Documents and Settings\All users\Application Data dir exists to hold data files.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
Thanks to Alok & Michael...
regards
Prax
|
|
|
|
|
Hi All, I am carrying out a simple localization project. I have a dialog based application and the target language is Hebrew. I would like to know how to Right-Align the texts which apppear in the MessageBoxes. I am able to Right-justify text messages, by using the option MB_RTLREADING. There is an option called MB_RIGHT. However this does not work. Please advise
|
|
|
|
|
hello, i know i can get a function pointer into a function by declaring the function as:
setfunction(double (*funcPointer)(double)); // for example
but i'm having difficulty returning funcPointer from an accessor. for eg do i declare the accessor as:
double (*)(double) getfunction(); // should return the function pointer
unfortunately this does not work, and i cannot see where i am going wrong.
any help would be great!
|
|
|
|