|
Im having probs programming a traceroute program using visual C++...i wonder if anyone is willing to help me with the codes..thank you...
|
|
|
|
|
OK, so I hook this function with a global hook like I would any other and I test it out with a program I made some time ago a client-server app that I knew used this function and it worked like a charm. All it had to d owas show me in a message box what was in the socket.
But then I tryed it with two bulk mailing programs that I had and it crashed both of them.
then I tryed it with outlook express and it didnt' say nothing.
What is wrong?
Why does the hook only work some of the time?
Also I found on a delphi programming site(I hate Delphi) the source of a program that attempted to do just what I was doing, but instead of using a system whide hook they somehow injected the dll into the virtual memory of Outlook and then the dll also made a hook but I don't know if it was global or not cause I don't have the source to their hooking object cause they are selling the source and I don't know Delphi that good either.
What I don't understand is how they expect to actually get the dll to work because they don't seem to be calling any function from it just loading the dll with LoadLibraryA.
I took a shot at translating the code to C and here it is but when I try this method that they(on the site) say works I get nothing(of course I am doing it in C as I don't have a Delphi compiler and with my own hooking class since they won't give me theirs)
void InjectLib(HANDLE hProcess, char *szLibPath)
{
//Vars
char szDLLPath[256];
LPVOID lpBuffer;
HANDLE hThread;
DWORD dwBytesWritten, dwThreadID;
LPTHREAD_START_ROUTINE lpModule;
strcpy(szDLLPath, szLibPath);
//Get LoadLibraryA
lpModule = (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("KERNEL32.DLL"), "LoadLibraryA");
//The Magic Happens Here!
lpBuffer = VirtualAllocEx(hProcess, NULL, sizeof(szDLLPath), MEM_COMMIT, PAGE_READWRITE);
WriteProcessMemory(hProcess, lpBuffer, szDLLPath, sizeof(szDLLPath), &dwBytesWritten);
hThread = CreateRemoteThread(hProcess, NULL, 0, lpModule, lpBuffer, 0, &dwThreadID);
WaitForSingleObject(hThread, 1000); //INFINITE
VirtualFreeEx(hProcess, lpBuffer, 0, MEM_RELEASE);
//The DLL Is Now Injected, Yay!
//Close Handles
CloseHandle(hThread);
CloseHandle(hProcess);
}
|
|
|
|
|
This Article will help you to load the Dll in Memory space of other Application
http://www.codeproject.com/threads/winspy.asp
"I Think this Will Help"
Alok Gupta visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi,
We need to acquire some research data in Europe with our software and then get the data sent over here (East coast US) for analysis. We tested to run the acquistion on a laptop with the time zone set to the place in Europe, but when burned/copied the data to a local-time-zone win2k machine, the time stamp got changed to the local time based on the difference of time zones. Since we want to keep the europe timestamp (or at lease being able to figure out that), I wonder how the time stamp info is stored in the file. Is there any existing function to simply get the local time of the file creation? I searched this forum and found the function SystemTimeToTzSpecificLocalTime(), but that would require us to tell the software that the data was acquired in a specific time zone, it would be the best if that time zone can be read out from the file directly.
An interesting note, when we copied the burned file to a winnt machine, the time stamp was kept; when we copied the data from the winnt machine back to win2k, the time stamp was still kept, instead of getting swtiched based on local time zone. So somehow, the time zone info was lost when the file was copied to Winnt. Any explanations on this?
Thanks a lot.
|
|
|
|
|
About what kind of partitions are you talking? FAT or NTFS.
Wout Louwers
|
|
|
|
|
NTFS.
And the CD used CDFS.
|
|
|
|
|
Hello,
I encountered a strange error when using the following code to rename tables in an Access database using DAO
BOOL CTableDlg::RenameTable(CString strOldName, CString strNewName)
{
UpdateData(TRUE);
OpenDatabase();
CString sqlCmd;
sqlCmd.Format("RENAME TABLE %s TO %s;", strOldName, strNewName);
db.Execute(sqlCmd);
CloseDatabase();
UpdateData(FALSE);
return TRUE;
}
The error I get is: "The Microsoft Jet database engine cannot find the input table or query 'RENAME TABLE table_old TO table_new;'. Make sure it exists and that its name is spelled correctly."
The table name is correct and a table named "table_old" exists so what am I doing wrong?
|
|
|
|
|
First, the calls to UpdateData() are unnecessary in this context. Second, have you tried the RENAME TABLE... command directly from within Access?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am placing an Edit ctrl on my dialog resource alongwith few buttons .
This dialog is created by the CMainFrame class in my SDI application .
I am able to click the buttons , but unable to enter text into the edit control. All i can see is that the "I" mouseIcon is displayed when i try to enter text inside the textbox. I was wondering if anyone has experienced something like this , why this happens and what is the workaround .
|
|
|
|
|
act_x wrote:
This dialog is created by the CMainFrame class...
Is the dialog modal or modeless? How is it created?
act_x wrote:
...but unable to enter text into the edit control.
Is it read-only or disabled?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
This dialog is created by the CMainFrame class...
Is the dialog modal or modeless? How is it created?
Modeless
...but unable to enter text into the edit control.
Is it read-only or disabled?
No
|
|
|
|
|
Hi,
I have a serious problem with the tooltip. I have created a Dialog based Application. I have to display different tooltips at different location on the Dialog BOx. I am handling PreTranslateMessage() of Dialog to show the tooltip. I am able to see the tooltip but at certain locations at Dialog Box tool tip continously flickers.
please help me to solve this problem.
Thanks in Advance.
your buddy,
Deliver
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
Show the code.
Are you using MFC? Are you using CToolTipCtrl?
"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 All,
I was wondering if anyone had some advice regarding a z-ordering issue I'm having with my application. For some background, part of my app's functionality if video playback, and the app has a modeless 'VCR' dialog, that allows users to skip forward a frame at a time, play, pause, skip to the end, etc etc.
I wanted to keep this dialog above the video windows, so I followed Nish's advice in http://www.codeproject.com/dialog/dlgboxtricks.asp (Making your dialog stay on top), and added the appropriate SetWindowPos( &wndTopMost, .....) call in the VCR dialog's InitDialog().
This worked great, but I've now noticed a problem. When the app shows modal dialogs (a preferences dialog, for example), they are shown underneath the VCR dialog. However, because the preferences dialog is modal, I can't move the VCR dialog out of the way because it won't get focus.
So my question is, what's the best way to ensure that modal dialogs are shown ABOVE the modeless VCR dialog, while video windows, etc are shown below it. Do I need to add SetWindowPos() calls to OnInitDialog() for every modal dialog in the application, or is there a way of specifying that the VCR control is shown ABOVE regular windows but below modal dialogs?
Any advice would be greatly appreciated.
Cheers,
Pete
|
|
|
|
|
|
I am currently undertaking a project on number plate recognition and ocr, i am using image magick library, but i am having extrem difficulty in doing image segmentation of the characters from the image, even finding the roi in the image is proven difficult is there any one out there to help some source code would be savage.
Thanks
|
|
|
|
|
I'm wanting some input from some of the seasoned programmers out there on a project that I am currently working on.
I am writing an app that from the main app creates a certain number of client socket connections. I'm getting the ip address, a connection id (char[4]), the index from the list control on the main app inwhich they reside (int), and port number passing these to the threads as each thread is created but stopped then resuming that thread.
I want each thread to communicate back to the main app when they have connected to each of their socket server. Currently i'm doing that by passing the index number and connection id and the status back to the main app thru the WM_COPYDATA message.
I just read that it's important not to write over the memory block by another thread because you can loose the information that was there before you wrote it out. I'm afraid that the thread will connect so fast that this may happen and i'll loose out on the status of each thread as it connects.
So what is the best and easiest way to communicate between threads?
I want to be able to tell my thread to shut down if the users presses the disconnect all button....I figure I send a message to all to do that. But what if my end user wants to shut down a specific thread?
And how do my threads tell my main app to update the status of that thread?
ARGGGGG!! I'm learning but at the same time, my brain is either getting bigger and it hurts or I'm getting a tumor.
Thanks for the input.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
Tom Wright wrote:
I want each thread to communicate back to the main app...thru the WM_COPYDATA message.
Shouldn't you be using PostMessage() instead, preferably with a message registered via RegisterWindowMessage() ?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi all.
There is a way to retrieve the last Windows XP crash time?
In other words, the latest time Windows has been running?
Thanks,
Yaakov
|
|
|
|
|
|
I wonder if Windows logs these values somewhere. i.e. I want to get rhe previous uptime.
Thanks.
|
|
|
|
|
You could take a look at the System Event Log. The entries from the eventlog service tell a lot about when a system starts and shuts down...
Wout Louwers
|
|
|
|
|
I am trying to add a new class to my project, I enter the class name, hit enter, and it hangs! I have tried it several times, tried restarting etc, without any luck. Anybody face this problem before?
Thanks,
Aristotel
|
|
|
|
|
Probably one or more of the files Visual Studio uses to keep track of things has gotten messed up. Exit Visual Studio. In the folder containing your project, try deleting project.NCB, project.APS, and project.SUO (if any of them exist). These files contain IntelliSense, resource editor, and solution option information, respectively. They can be deleted safely, and Studio will recreate them as needed.
Software Zen: delete this;
|
|
|
|
|