|
You can't stop the form from being submitted. You are responding to a notification that the form *has* been submitted.
|
|
|
|
|
As Terry has already pointed out, an event signalizes in this case that something has already taken place, and you cannot influence the trigger of the event in the past.
However there is a workaround, and it is called API hooking/hijacking/monitoring.
Internet Explorer uses the Wininet functions to communicate with the internet. If your user clickes the "go" button with some url in the address bar, the appropriate Wininet functions, like HttpOpenRequest and HttpSendRequest are called inside IE's code. The same applies to when the user submit a form.
If you hook into the WinInet functions from your BHO, then you will be able to monitor and "authorize" IE's actions.
Example: if your user clicked a Submit button on a form with POST action then HttpOpenRequest is called with the second parameter lpszVerb being "POST". You can take any action including stopping the process.
If a form with "GET" action is concerned, your job is a bit more difficult because the verb in this case does not differ from "ordinary" page requests. You could then take into account the url from your form, and compare it with lpszObjName (3. param of HttpOpenRequest)
If you are unfamiliar with API hooking, check out this article:
http://www.codeproject.com/useritems/api_monitoring_unleashed.asp
Peter Molnar
|
|
|
|
|
hi!
i use one pc to connect to the internet. all other pcs connect over a proxy (janaserver) to the internet-pc to get into the inet.
i try to code an small instant messanger like icq for my business. localy everything works fine! but how do i connect from my app to the internet over the proxy? it only works (of course) if i run the messanger-app on my server...
i use 2 CAsyncSockets - one for sending, one for listening. i actually use port 80 for send/listen (its easyer to handle while developement).
anyone has an idea?
sorry for my bad english. not my native language.
cheers,
vertex
|
|
|
|
|
I am not familiar with the backend of a proxy server. Nonetheless, it should not be difficult since your proxy already works. Now just allow access to the internet IP instead of the LAN IP.
Kuphryn
|
|
|
|
|
the point is, that my client/server app has to listen, if any connection comes in from the inet. but if there is a message sent from outside my lan, the message is sent to the ip of my dailup-pc. he does not know, that a client pc on the lan is waiting for the message...
|
|
|
|
|
Check this
http://www.codeproject.com/internet/casyncsocketex.asp
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
yes, found that too, but it can only receive information over proxy. but it can´t start a listening socket (a server).
im still wondering how icq makes that possible?!
i could connect to a script on an http-server and check every second, if new messages arrive - but if more than 10 users check every sec. for new msgs: - wouldn´t be a real instant messanger... hm...
but thank you anyway... (
|
|
|
|
|
Hi,
I wrote this code on CMessDlg : public CDialog
but the cursor type is not changing
What can be the reseon?
Thank you in advance,
Seval YILMAZ
OnSetCursor is trigeret on ON_WM_SETCURSOR()
HCURSOR hcrs;
BOOL CMessDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
hcrs = AfxGetApp()->LoadCursor(IDC_NODROP);
CWinApp* pApp = AfxGetApp();
SetCursor( hcrs );
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
|
|
|
|
|
Did you try to set the cursor AFTER the call to the base class?
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I have an application with a CListCtrl. Items are continuously being added to this list. When I scroll the box of the CListCtrl to the end of the scrollbar I want the list to autoscroll.
To accomplish this I retrieve the scrollbar position (GetScrollPos) and compare this to the scrollbar limit (GetScrollLimit). If there is a match is call EnsureVisible after adding an item. However when I slowly drag the box of the scrollbar, the scrollbar position will never match the scrollbar limit. It seems the limit is updated during dragging and the position is not. Anyone knows a solution for this problem?
|
|
|
|
|
Hello,
I am desperately looking for a solution in MS Chart whereby I can plot different X,Y data on a single chart. All I could figure out from various sources is different Y can be plotted for the same X axis data.
Help in any form greatly appreciated. Code snippet most welcome.
Thanks to all in advance.
|
|
|
|
|
Hi,
I need to build an app to open some kind of file (it kan be any kind: .exe .html .txt .hex --> really everything) as a binary (or hexadecimal file), after that I need to convert this file to a hexadecimal file with checksums.
I know how to do the last thing, but I could use some help in opening files as binaries!
|
|
|
|
|
If you are using MFC:
CFile MyFile;
unsigned char nByte;
if( MyFile.Open(TEXT("somefile.txt"), CFile::modeRead | CFile::shareDenyNone | CFile::typeBinary) )
{
while(MyFile.Read(&nByte,1))
std::cout<<nByte<<std::endl;
MyFile.Close();
}
I Dream of Absolute Zero
|
|
|
|
|
Hi all.
Why my Visual Studio dont want to inter into source code of MFC by F11 key,alfought formerly all be fine.May bee i change some setting by chance or my VC break down???
Thanks.
|
|
|
|
|
it generally happens when you pass the function call as a parameter to some other function.
for instance
outer_func(inner_func());
when the control reaches on this line and you press F11 the control enters the source code for inner_func(), but if inner_func() doesn't return a correct value then the control won't enter the source code for outer_func().
never say die
|
|
|
|
|
Hi!
I'm trying to build a speech application with Visual C++ using Microsoft Speech SDK 5.1 in Spanish but the Lhtts engine for this language sounds as C3PO and I need it sounds like people more or less. I only should use few words so, does anybody know what could I do to use my voice in .wav or .mp3 to read what the user writes?
Thanks a lot!!
I don't know anything...But I'm trying
|
|
|
|
|
Hi All,
I could not see the contents of CComboBox when I try to create in the heap.
Cany one give me the soultion.
Thanks,
|
|
|
|
|
When creating a combobox dynamically ,you need to define the drop list height.
Otherwise, clicking on the drop button won't open the drop list.
The way to do this is by calling
SetWindowsPos(NULL,0,0,cx,cy,SWP_NOMOVE | SWP_NOZORDER);
Goodluck,
Dudi
|
|
|
|
|
I'm using a library in my MFC application and i'm having some memory problems with allocations and deallocations, some memory allocations/deallocations causes a crash but only if it is not running on debug-mode. In debug-mode the application runs perfectly. Here's my lib configurations:
engine.lib ( Non-MFC Code ):
. Configuration Properties:
----. General:
------. Configuration Type: Static Library ( .lib )
------. Use of MFC: Use Standard Windows Libraries
----. C++:
------. Code Generation:
---------. Runtime Library: Multi-Threaded Debug ( /MTd )
editor ( MFC Code ):
. Configuration Properties:
----. General:
------. Configuration Type: Application ( .exe )
------. Use of MFC: Use MFC in a Static Library
----. C++:
------. Code Generation:
---------. Runtime Library: Multi-Threaded Debug ( /MTd )
------. Precompiled Header:
---------. Create/Use Precompiled Header: Automatically Generate( /YX )
----. Linker:
------. Command Line: /NODEFAULTLIB:LIBCD.LIB
Noticed anything wrong ? Any tip ?
Thanks
|
|
|
|
|
It is nothing to do with your configuration. It very likely cause by your code.
The reason it won't crash in debug mode is that your linker allocates more storage space for each memory blocks in your program for debug purposes. So, even if your program leaks, the extra space storage save you from crash. This is not going to happen when you are in release mode as when your linker allocate exact storage space for your program.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi
does ne1 know the best way to do a http post ?
thanks
simon
|
|
|
|
|
Use CHTMLView (MFC) or use IE COM object.
Or look for low level http protocol helper class in codeproject.(if any)
Hope this helps
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
Check out HTTP 1.1 protocol.
http://www.w3.org/Protocols/rfc2616/rfc2616.html
Kuphryn
|
|
|
|
|
I need to create a CBitmap using data buffer. To insert into a image list
|
|
|
|