|
Rhina wrote:
I have looked at several obvious ways like execl,spawn,createprocess and winexec.
Actually, you missed the obvious choice: ShellExecute() . The others will work, but with a tad more effort.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
ShellExecute()is the one you want.
John
|
|
|
|
|
|
Hi,
I want to access the logical drives of a particular PC in LAN. How can I do that?
Drushti
|
|
|
|
|
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.
|
|
|
|