|
u got right what i have to do!!!!, it's my college final project that they gave to me in order to graduate in december
actually i coded a chat like app in java last semester and i was thinking there would be some way to listen to the traffic coming and going from the nic or modem in c++. i thought on doing that but i had the idea that the text would have some kind of encryption and it would be a problem to find out how to decode it.
i'll work on the material you recommended me since i still have about 6 weeks to finish it and i think it's enough time to code the project
THANKS!!!!
|
|
|
|
|
smargada wrote: THANKS!!!!
Mention Not! sorry not much of your HELP
"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
|
|
|
|
|
Hello,
I need to be able to detect a user that could be logged into the machine - by which I mean:
1. NOT the user returned by GetUserName/Ex, because this returns who the current thread is running as, NOT the user that is logged in.
2. NOT by OpenProcess and OpenProcessToken, because this only works when the process doing this is running as NT AUTHORITY\SYSTEM
I am currently grabbing the module name of the shell that should be running, and searching for that process. I then use that process to try to figure out what user the shell is running as - this should let me know what user is logged in. I am currently trying to use GetKernelObjectSecurity on a process handle, and then using GetSecurityDescriptorOwner to get the SID. This seems to work nicely on Windows XP, but it gives different results in Windows 2000. In Windows XP, I usually get the actual user name that is running the process, but in Windows 2000, it often gives a group as the owner (such as BUILTIN\Administrators).
I also considered trying to grab the process's environment block and reading the USERNAME and USERDOMAIN environment variables from there. I could not find a way to do this.
I know this problem is solvable - Process Explorer does it, for example.
Any suggestions? Thank you for your time!
PS. Yes, this must be done using Win32 API/MFC, this can not use .Net stuff.
-- modified at 13:12 Monday 17th October, 2005
|
|
|
|
|
Xori wrote: I need to be able to detect a user that could be logged into the machine - by which I mean:
1. NOT the user returned by GetUserName/Ex, because this returns who the current thread is running as, NOT the user that is logged in.
How about NetWkstaUserGetInfo() ?
Xori wrote: I also considered trying to grab the process's environment block and reading the USERNAME and USERDOMAIN environment variables from there. I could not find a way to do this.
See here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
NetWkstaUserGetInfo won't work for me because it must be called in the context of the currently logged on user. The code I am writing here maybe running as SYSTEM or as an administrator - and the administrator isn't necessarily the one that is logged on.
Thanks for the PEB information.
|
|
|
|
|
How about NetWkstaUserEnum() ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Xori wrote: The code I am writing here maybe running as SYSTEM or as an administrator - and the administrator isn't necessarily the one that is logged on.
I believe you are creating Service.. Right.. then you have to write your custom Winlogon notification DLL :-
Taking Advantage of the winlogon Notification Package [^]
"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,
I've written a snipplet (application B) that sends keystrokes to a application A when i press a button in application B.
My application (B) gets focus.
i reset focus with SetActiveWindow(NULL) , which effectively resets the focus to the last application that was active/focused.
I send a keystroke:
keybd_event(VkKeyScan('a'), 0, 0, 0);<br />
keybd_event(VkKeyScan('a'), 0, KEYEVENTF_KEYUP, 0);
so, the "a" is effectively sent to the application. A problem however is applications that automatically select all text in a window(widget) when they get focus.. explorer for example has this "feature". If i want to enter the location: "aaa":
1) Explorers locationbar is active.
2) I press the button to send the "a". My app gets focus, recents focus and sends the keystroke.
3) Explorer receives the "a".
4) When i want the second "a" Explorer looses focus for an instant. When i set the focus back to it it automatically selects the "a" i previously wrote, and in turn makes my app overwrite it.
etc.
Is there any way i could prevent my application from getting focus at all when i click on it?
Thanks in advance!
-- modified at 13:05 Monday 17th October, 2005
|
|
|
|
|
maybe use a modeless dialog? can you have JUST a modeless dialog? i dont know!
|
|
|
|
|
How to get the right URL before navigating the web page in the CHtmlView?
Class CHTMLControl derived from CHtmlView, and over load the virtual function OnBeforeNavigate2.
I Navigate an URL as following:
CHTMLControl* pHTMLControl;
…
pHTMLControl->Navigate2(strURL);
In the opened web page, there is a link whose html code is below:
<A href='javascriptclickProcess("search");'>Free Search</A>
After clicking on this link in the html view, the following function is called
void CHTMLControl::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel)
But in this function, the value of lpszURL is "javascriptclickProcess("search");"
How can I get the right URL of the next page before navigating it?
Thanks
-- modified at 11:52 Monday 17th October, 2005
|
|
|
|
|
hi,
i want to set the colour of the text set throught setwindowtext in a static control is it posible if yes then how,and wat is the font type that mfc uses to display the text in the static text or any control(default).
Thanx in advance
Farpointer
|
|
|
|
|
See the "Extras" section of this article.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi Friend,
I am using early binding for getting the data from the store procedure in C++ COM DLL. All the data bind properly expect boolean value. I am doing
{
ADO_FIXED_LENGTH_ENTRY(5,ADODB::adBoolean,_rsFlag,_rsFlagStatus,FALSE)
BOOL rsFlag;
ULONG rsFlagStatus;
}
can you please help me in getting proper boolean value from store procedure.
Thanks
|
|
|
|
|
Hi,
I am creating one folder under C:\Documents and Settings\All Users\Application Data say for example "Temp".
This "Temp" folder has some default security like Administrator,power users,Everyone etc which are all inherited from parent folder.
Here in "Everyone" group it has only 3 permission like Read & Execute,List folder contents and Read.
Could anyone help me how i can add other permissions to "Everyone" group like full control,write etc through programatically?
If possible could anyone explain me with some sample code or please provide me link where i can get help in solving this problem.
Regards,
Shiva
|
|
|
|
|
I'm running into a problem contstructin a class. I'm trying to inherit the CObList class. So far I just added a default constructor and a struct. Here's the code:
#ifndef FAF_H
#define FAF_H
class CFAFList : public CObList
{
protected:
struct FAFRecord
{
CString name;
CString address;
CString HomePhone;
CString WorkPhone;
CString CelPhone;
CString FaxNumber;
}m_FafRecord;
public:
CFAFList();
};
#endif
And here's the source code for my new class:
#include "FAFList.h"
CFAFList::CFAFList()
{
m_FafRecord->name = "";
m_FafRecord->address = "";
m_FafRecord->HomePhone = "";
m_FafRecord->WorkPhone = "";
m_FafRecord->CelPhone = "";
m_FafRecord->FaxNumber = "";
}
My problem is, when I try to compile this, I get p:\findafolk\faflist.cpp(17) : fatal error C1010: unexpected end of file while looking for precompiled header directive as an error. How do I fix this?
Danny
The stupidity of others amazes me!
|
|
|
|
|
before the #include "FAFList.h" , #include "stdafx.h" header...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Remove the #include "stdafx.h" line at the top of your faflist.cpp file
-- modified at 10:54 Monday 17th October, 2005
Mmmhh, sorry . It was adding the file not remove it .
A second solution is to specify that this file don't use precompiled headers.
|
|
|
|
|
Thank you both.
Danny
The stupidity of others amazes me!
|
|
|
|
|
Hi again
I have a problem with a dialog that I have written that includes CMSFlexgrid. When I copy the application over to my target machine, it wont run. I have used Dependency Walker to find out which DLLs are used, and copied those accross (16 of them), but still no luck.
I have written a couple of other applications that have used CMSFlexgrid and had the same problem. The only way I could find around this was to install Visual Basic 6.0 into the target machine (this is where the Flexgrid control has come from.
Anybody got some clues? Both machines are running XP Pro; a list of the required DLLs that I have copied is shown below. Thanks for your Help
69 Bay
c:\windows\system32\WINMM.DLL
c:\windows\system32\NTDLL.DLL
c:\windows\system32\USER32.DLL
c:\windows\system32\GDI32.DLL
c:\windows\system32\KERNEL32.DLL
c:\windows\system32\ADVAPI32.DLL
c:\windows\system32\RPCRT4.DLL
c:\developement\scheduler\INPOUT32.DLL
c:\windows\system32\MFC42D.DLL
c:\windows\system32\MSVCRTD.DLL
c:\windows\system32\SHELL32.DLL
c:\windows\system32\MSVCRT.DLL
c:\windows\system32\SHLWAPI.DLL
c:\windows\system32\COMCTL32.DLL
c:\windows\system32\MSVCIRTD.DLL
c:\windows\system32\MFCO42D.DLL
|
|
|
|
|
An activeX require an OCX file to be installed and registered on the target computer. (I don't remember the file for the FlexGrid...)
|
|
|
|
|
Hi
Thanks Cedric,
I have just registered msflxgrd.ocx on my target machine using regsvr32 and my application now works - yippee!
Normally, when I install programs, I do it very crudely with a batch file which will copy all my required files to the correct places. Can I do this with '.ocx' files and register them by includeing "regsvr32 xyx.ocx" in the batch file (where xyz is the name of my ocx file?
Thanks again for your help
Mike
|
|
|
|
|
When _gcvt() returns string in decimal format and when in exponential format?
I need the string only in decimal format but sometimes it returns in exponencial.
<br />
char buff=[128];<br />
double dbl = 0.60000000;<br />
CString str = _gcvt( dbl, 4, buff);<br />
<br />
but
<br />
char buff=[128];<br />
double dbl = 0.06000000;<br />
CString str = _gcvt( dbl, 4, buff);<br />
<br />
|
|
|
|
|
|
toxcct wrote: sprintf(str.GetBuffer(), "%d", dbl);
Why don't you just use CString::Format() ?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
gloops, you're right, i wasn't fully in the post when i answered it... thank you for the correction !!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|