|
show ur code what u exactly doing?
|
|
|
|
|
I'm rewriting my C++ dll in MFC so that I can add some more functionality. If I add in the same exact entry points will I have issues with the apps that are calling this dll? Will I need to recompile them?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote: If I add in the same exact entry points will I have issues with the apps that are calling this dll? Will I need to recompile them?
Have a Try
"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
|
|
|
|
|
Hey, that's a great idea! How is it that you are so wise in the ways of the world?
Thanks...I did and it worked.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote: How is it that you are so wise in the ways of the world?
"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
|
|
|
|
|
i posted a message last night about help retrieving the conversation from a msn messenger windows using the clipboard and searching in the child elements for a RichEdit20W or RichEdit20A and copying the text but user ThatsAlok replied me that msn messenger doesn't use those kind of controls as i'm new in this kind of app's i'll take his word on that
so i was wondering if there could be a way to make a list of all the child elements of the conversation windows and try to retrieve the text from the new textbox element whichever it is now
i already have coded a way to retrieve all the windows titles and put them in a list so i think there might be a way to retrieve all the elements that make that window as i select it from the list
OnInitDialog(){<br />
...<br />
EnumWindows(EnumWindowCallBack, (LPARAM)::GetDlgItem(m_hWnd, IDC_LIST_RUNNING));<br />
...<br />
}<br />
<br />
static BOOL CALLBACK EnumWindowCallBack(HWND hwnd, LPARAM lParam)<br />
{<br />
HWND hWnd = (HWND)lParam;<br />
CString strTitle;<br />
DWORD wndPid;<br />
<br />
if (IsWindowVisible(hwnd))<br />
{<br />
GetWindowThreadProcessId(hwnd, &wndPid);<br />
CWnd::FromHandle(hwnd)->GetWindowText(strTitle);<br />
strTitle.TrimRight();<br />
if (!strTitle.IsEmpty())<br />
{<br />
CListBox *pListBox = (CListBox *)CWnd::FromHandle(hWnd);<br />
pListBox->AddString(strTitle);<br />
if((strTitle.Find("- Conversation",0))!=-1){<br />
::MessageBox(hWnd,"Found","MSN",MB_OK);<br />
EnumChildWindows(hWnd, ChildWndProc,0);<br />
}<br />
}<br />
}<br />
<br />
return TRUE;<br />
}
i think you have to use EnumChildWindows and EnumChildProc but i don't have a clue on how to use them. actually i have a hard time writing the above code so if anyone could help me with this or tell me where to find some good examples on this subject i'll really appreciate it
other way i was told i could retrieve the conversations from msn messenger was making a hook for msn messenger events and using that data to make a log. if someone knows something about this plz TELL ME!! cuz i got to have this app running by december and all the other apps and examples i have found in internet just doesn't work with the new versions of msn messenger
i'm using Visual C++ SP6, W2K and MSN Messenger 7.0
|
|
|
|
|
smargada wrote:
i posted a message last night about help retrieving the conversation from a msn messenger windows using the clipboard and searching in the child elements for a RichEdit20W or RichEdit20A and copying the text but user ThatsAlok replied me that msn messenger doesn't use those kind of controls
I'm using Windows Messenger v4.7 and, using Spy++, confirmed that RichEdit20W is indeed the control that is used.
Try this:
HWND hWndParent = ::FindWindow(_T("IMWindowClass"), NULL);
if (hWndParent != NULL)
{
HWND hWnd = FindWindowEx(hWndParent, NULL, _T("RichEdit20W"), NULL);
if (hWnd != NULL)
{
hWnd = FindWindowEx(hWndParent, hWnd, _T("RichEdit20W"), NULL);
TCHAR szText[1024];
if (::SendMessageW(hWnd, WM_GETTEXT, sizeof(szText), (LPARAM) szText) > 0)
...
}
}
"Take only what you need and leave the land as you found it." - Native American Proverb
-- modified at 9:33 Tuesday 18th October, 2005
|
|
|
|
|
smargada wrote: ThatsAlok replied me that msn messenger doesn't use those kind of controls as i'm new in this kind of app's i'll take his word on that
Buddy, Ohh I believe you are creating Chat spy type Application... I had created such type of application in past for some company but I am sorry DUE to NDA, I can't disclose you to exact implementation I have done there.. But I can tell you some way to achieve it.
#1 you can go to protocol level i.e. hook WinSock.dll to retrieve actual text coming and going through MSN messenger, as MSN messenger don't encrypt the Message before sending it.
This link will help: -
HOOKING WinSock DLL[^]
MSN Protocol[^]
#2 Try Searching MSDN site for MSN messenger Com API's
"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
|
|
|
|
|
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.
|
|
|
|