|
Larsson wrote:
...disable a user to install a program if you only are a user?
What do you mean by this? Are you trying to run an installation program as a "user" but it is not letting you? Please elaborate.
Larsson wrote:
Is there not a way to check if you are about to install a program...
No, because as far as the OS is concerned, a program is being started, period. What that program does is no different than what any other program does.
Larsson wrote:
Is there not a way to check if you are...about to download a program from internet?.
Possibly, but I am not an expert in networking protocols so I can't say for sure.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
No im not trying to install any program as a user but if you only have a basic user account you cant install new sofware.
So there should be a check if you are a basic user if you are about to install any program so if that is the case you should be able to check if you are trying to install a new program.
Well this is what I want to do!...
If you are about to install a new program or trying to download something I want to check it so I can aprove it.
And I don't want to change so the user's become basic users.
It seems like I have a big problem if you not are able to check if you are about to install a new program.
I hope you anderstand what I meen!)
\Larsson
|
|
|
|
|
Larsson wrote:
...if you only have a basic user account you cant install new sofware.
Only because the account on the domain, or a group on the domain to which the account belongs, has been set up that way. But just because you are a "basic user" does not also mean you can't install new software. They are mutually exclusive things.
Larsson wrote:
If you are about to install a new program or trying to download something I want to check it so I can aprove it.
So is your program some sort of background process or a service of some kind that just sits around and monitors stuff?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
Ok say theres a tree like this:
US
Virgina
Richmond
Danvile
NC
Raliegh
Durham
How would I write the function so that if I were trying to find if the NC item existed under the US parent?
Heres my attemt, obviously falled, but CTreeCtrls are not my strength:
HTREEITEM IsItemInTree(CString m_strText, HTREEITEM hElement)
{
//Variables
//Date: 8 2 04
HTREEITEM hNextItem=hElement;
while (m_cHistoryTree.GetNextItem(hNextItem,TVGN_NEXT)!=NULL)
{
hNextItem=m_cHistoryTree.GetNextItem(hNextItem, TVGN_NEXT);
MessageBox(m_cHistoryTree.GetItemText(hNextItem));
if (m_cHistoryTree.GetItemText(hNextItem)==m_strText)
{
MessageBox("it exists");
return hNextItem;
}
}
return NULL;
}
returns null everytime
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
TVGN_NEXT is to get the next sibling item. Somewhere in the loop you want to use TVGN_CHILD to get the first child item.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Is that in the first go through of the while loop?
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
This untested code should go through the tree, starting at the supplied HTREEITEM, looking for the first occurance of the text.
HTREEITEM MyTree::FindItem (CString text, HTREEITEM start)
{
HTREEITEM child = NULL;
while (start && GetItemText(start) != text)
{
child = GetChildItem(start);
while (child && GetItemText(child) != text)
{
child = FindItem(text, child);
if (!child)
child = GetNextSiblingItem(child);
}
if (child)
break;
start = GetNextSiblingItem(start);
}
if (GetItemText(start) == text)
return start;
return child;
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Hi there,
I would like to know how a derived class from CEdit can receive command notifications directly? By directly I mean without having to be listening to messages in the parent window.
Can someone please drop me a line?
Thanks,
David
|
|
|
|
|
Check out the ON_CONTROL_REFLECT and ON_CONTROL_REFLECT_EX macros.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Ohhh! Thanks for the reply PJ! I was beginning to feel desperate...
So it is true then... the stupid commands are sent to the parent window and cannot be listened anyother way, can they?
Can I also ask: how can I make my CEdit -derived class know when the content (the input text) of the control has changed? Is there a better way of knowing this without having to use message_reflection techniques?
Again, thanks a million!!
David
|
|
|
|
|
If you want the your control class to handle it's own messages then you have to use message reflection.
dNimrod#X wrote:
how can I make my CEdit-derived class know when the content (the input text) of the control has changed? Is there a better way of knowing this without having to use message_reflection techniques?
No, you have to use message reflection. Handle either the reflected EN_UPDATE or EN_CHANGE message to handle text changes in your edit control.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks a lot PJ!!
You have been very helpful indeed!
dNimrod#X
________________________
|
|
|
|
|
Is it possible to check if something is downloding from internet?
I Need to check from my MFC App if somthing is downloding from internet.
Please help me someone.
\Larsson
|
|
|
|
|
On a global scale, I'd use a proxy. Since a user can download using FTP,HTTP etc.I would need to make a proxy for each. However, an app can also copy a file using it's own "protocol". zso, there is no easy way to get notified of every type of download.
Bikram Singh
|
|
|
|
|
yes
a pretty hard way:
if you know api hooking you can hook urldownloadtofile function you can find it in urlmon.dll and when something downloads you can display a message box on the screen and you can allow the download by letting it return what it wants or make it return a error and thus end the download before it begins. But of course they might still be downloading throught plain winsock instead of urldownloadtofile and you should probably try to hook some functions like recv also.
a even harder one wich I never did just heard about:
if you don't you can write a driver with the use of the winddk that acts just like a driver but filters connections.
I know no other ways but there might be lots
for more info on api hooking search here on codeproject a article by a russian person and also one by a chinese person but I forgot their names sorry.
One article is something about disabeling ctrl alt del and contains a very good api hooking class.
you should look at that.
|
|
|
|
|
Thanks,
I will look in to this and I hope it will work, If you have any more information please feel free to help me.
|
|
|
|
|
Hi everyone,
Hot to show two dialogs simultaneously from a CMainFrame class?
I hope that they help me.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
As long as the dialog boxes are modeless I guess you could just make two calls to Create and position the dialogs in a tiled fashion so neither overlaps the other???
Cheers
How do I print my voice mail?
|
|
|
|
|
|
Hi all, I'm writing an expression parser using Baur and Zamelzon algorithm, but it seems that it can't handle unary minuses correctly What shall I do, does anybody know some algorithm that can parse unary minuses correctly ? Don't offer reverse notation, it has the same problem
|
|
|
|
|
I dont know if this is the right place to post this .
Using Chris Maunder's MFC Grid control 2.25
I need to use it in an SDI application .
and I need to create it dynamically .
I didnt know how to do this .
Plus I need the Grid in a class that is already derived from CWnd
CSCreen(derived from CWnd)
^
|
|
CMyNewClassWithMFCGrid
Has anybody have any tips on doing this ?
Thanks
|
|
|
|
|
I have a win32 dll which is called by a GUI app . Once the dll is called, a whole ton of work is done in it and then it returns, and the app is done. This takes a long time and since my dll is not an mfc one, I dont have any progressbar window popping up. (Actually I dont even know if you can have guis in a dll). How do I indicate the progress in my dll? The main app has absolutely no idea of how long things will take.
Thanks,
sb
|
|
|
|
|
ns wrote:
(Actually I dont even know if you can have guis in a dll)
Yes you can.
ns wrote:
How do I indicate the progress in my dll?
How you do it (thie GUI) is completely dependent on the nature of the long operation
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
The right (imho) approach to solving this common problem is to make the GUI an "observer" of the "worker" DLL. The worker notifies its observers of various "events" (typically progress) as it does its thing. The observer can choose to ignore these events or respond to them in any way it sees fit.
An "event" is anything that describes an action - it can be as simple as an int or as complex as a class containing several members such as event type, percentage progress, and other information describing the worker's current state.
An observer is nothing but an interface that exposes a method like:
bool handleEvent
(Event* pEvent);
The observer returns false if it wants the worker to stop further processing. Using this simple design pattern, you could implement a user-friendly task timer/progress dialog as described in this[^] article. What could be cooler?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|