|
I am looking for a way to send a lbuttondown message to another app, when i hit the ENTER key, at the coordinates that the mouse is at. I already have the hook set up, so would i use the SendMessage function to send this information, and what parameters would i pass to it?
|
|
|
|
|
mouse_event may be what you're looking for. It's used for synthesizing mouse motion and button clicks. There's also SendInput function, but it's not available on Windows 95.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi, I am working on a free Internet program that is almost done. I have only one problem that keeps hunting me. I need to find a way to make this program bullet proof. The way this software works is that the user installs a piece of software on there computer. When the user wants to use free internet he starts the program and the program dials a local phone number. The software then displays a banner window on the screen where banners are rotated every 35 seconds.
I have implemented a system where the user cannot use cntrl-alt-dlete keys to get rid of the software. But this is not good enough since there is a software called system properties that allows one to view all the processes in windows and also kill them.
My problem is when the banner window is killed the connection stays alive. It is not also killed together with the software. I use windows dial up networking to make the connection.
To counter this I have implemented a DLL that monitors if the banner window is running or not. If the DLL senses that the banner window is not running then it will kill the connection.
The DLL checks the bannerwindow every 2 to 4 minutes.
What happens now is that this DLL is making the banner window act very slow. When a user clicks on an advertisers banner it opens up the window after 55 seconds. I have also some buttons with direct links on the bannerwindow. When the user clicks on these it will open the banner window also in 55 seconds.
I would like to get rid of this DLL and look for a different solution.
Does anybody know how to keep a program alive (when it has been end tasked from the task manager) enough time so the program can send a string to the modem to kill the connection together with the program?
Or does anybody know of any other solution?
That will have the same effect. Thus killing the connection when the program is being ungracefully killed also. So, banner window and connection must be killed together.
Thanks in advance,
Raymond
|
|
|
|
|
Hello, the codegurus around the world.;)
If I am on the same situation, I try to use Timer rather than Thread.
Timer is easier than Thread.
1) Main program is always checking if the banner window is opened.
(Timer and CWnd::FindWindow() )
2) If the banner window doesn't exist, try to open the banner window again.
(Well, in my sense, the user can kill the banner window, but show this ASAP and connect ISP by the modem. )
At the same time, the banner window is always checking if the main window is opened?
BTW, I sometimes use NetZero, and if I close the banner window, the connection is also closed.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Ok, so you imply me to use a seperate Dll to check if the banner window is open?
I have done this and I have run in a performance problem with the banner window.
When user click on it it reacts very slow to the users clicks, it sometimes takes 30 to 40 seconds for the advertisers page to open.
I am using a seperate DLL to check if the banner window is running.
Do you know of any Dll source code that does the some job but without affecting the performance?
Thanks in advance,
Raymond Bnetoera
|
|
|
|
|
Hi there again and thanks for your reply.
BTW, Do you know how Netzero implemented to kill the connection after the bannerwindow was disabled?
If you have more info on how NetZero was programmed please forward this to me.
Thanks in advance,
Raymond Bentoera
|
|
|
|
|
You could write a loader program. All it would do is run you free internet application, and monitor its status. If your program gets killed, the loader program would close the internet connection.
-Ben
"Its funny when you stop doing things not because they’re wrong, but because you might get caught." - Unknown
|
|
|
|
|
I'm writing a Win32 Console Application and I'm using the getline() function for the input of strings. Each time getline() is executed the user has to press enter twice after entering any data. I've tried using several different combinations of cin, cin.get(), cin.ignore, and getline(). The best combination is cin.ignore() followed by getline(). The only problem is having to press enter twice. If anyone knows how to fix this let me know.
|
|
|
|
|
flush fixes this, from memory.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
How will my app check every second if I'm connected to the internet (in MFC)!?
/*
BETA
*/
|
|
|
|
|
Try this: InternetGetConnectedState
|
|
|
|
|
How can I disable a menu during runtime?
The Unknown Nobody
|
|
|
|
|
Process the WM_INITMENU or WM_INITMENUPOPUP and disable the items you want.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
What i need is that if you press a button, a menu/submenu is disabled.
Thank you for your help
SSR
|
|
|
|
|
I don't find response about that in the French web, therefore I try here...
I can move the components with the mouse in the dialog box editor, of course, but I would like to manage to specify my picture position (x,y) with the code.
With Delphi, it's MyPicture.Left=x and MyPicture.Top=y, and with Builder C++, it's MyPicture->Left=x; and MyPicture->Top=y; but with Visual C++ I don't find the members Left and Top for the my Control CStatic...
Do you know ?
Thanks...
|
|
|
|
|
Hi Pierrick,
You have to use MoveWindow() method of CStatic class. Refer MSDN for a arguments of this method.
Best regards,
-----------
Igor Soukhov (Brainbench/Tekmetrics ID:50759)
igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru
|
|
|
|
|
Thank-you !
|
|
|
|
|
Hi all.
I want to know what is Encoder and Decoder in MPEG softwares ???
And how can i use of it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi, you are either the worlds most amazing programmer, or you ask a lot of questions about things you don't go on to use
I'm not sure if I've read the question right, but an MPEG codec will encode a video/audio stream into an MPEG format ( live DVD, VCD, &tc ), and decode it to allow it to be played. For example, if you were to get hold of my music video collection, it would not play until you installed the DivX codec. You can use it to write video capture software - to write a player you can use Media Player as a COM object. My encoder of choice is a free ware open source thingy called Virtua Dub. I'd suggest getting the source if you want to know more about video work.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Thanks,
I get my answer of your reply.
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello,
I created several Edit Controls with semi-transparent bitmap image
background. It uses "WM_CTLCOLOREDIT" with returning prefer Bitmap brush.
( Also setting Font, SetBrushOrg in CTLCOLOREDIT )
It works perfectly on WinNT/2000.
But on the Win9X, SetBrushOrgEx() seems doesn't work in WM_CTLCOLOREDIT
And I can't try to CreatePatternBrush() for whole my-app-window,
because it's large. So I'm using each Edit-Control brush method.
Do you know how to control Brush Origin at Edit Control or WM_CTLCOLOREDIT?
I'm sorry I'm not good to say in English.
Many thanks in advance.
|
|
|
|
|
Hello,
I have a dialog box that I reuse to enter and modify information in my program. What I would like to accomplish is to have the focus placed on a certain control when the dialog is being used to enter information and another different control when it is being used to modify information. How would I go about doing this? I've been searching through the MSDN but haven't had any luck figuring out how to move the focus at all. Right now it's just defaulting to the first tab stop on the dialog. I really appreciate any help. Thanks!!
Joseph LeBlanc
unixd0od@hotmail.com
|
|
|
|
|
Hello, the codegurus around the world.
In order to change the input focus on Dilaog,
we can use CWnd::SetFocus() or CDialog::GoToDlgCtrl(CWnd*) member functions.
However, if you validate some data in some control, and change the input foucs,
you have to write your own code.
Issue is when the application will change the input foucs to the conrol?
When the user push enter key, or some control loses its own focus...
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hi Onishi.
If i using SDI and CFormView in my program, so how can i set the focus for controls ?
*** Please write code ***
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello, the codegurus around the world.;)
If you add "Please" to your message, someone else may help you more.
"Write your own code" means that we sometimes work more than we expect.
SetFocus() doesn't work correctly if we figure out the order of the input foucs.
Your question is this example.
One control should be on CMyFormView.
I try to set the input foucs to the edit box called IDC_ZIP after I close
Sort dialog if I open Sort Dialog by clicking the menu item.
void CSortDialog::OnCancel()
{
CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();
ASSERT(pFrame);
CMyFormView* pView = (CMyFormView*)(pFrame->GetActiveView());
ASSERT(pView);
pView->GetDlgItem(IDC_ZIP)->SetFocus();
pView->m_bSetFocusToZipCode = TRUE;
CDialog::OnCancel();
}
void CMyFormView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView)
{
if (bActivate && m_bSetFocusToZipCode) {
GetDlgItem(IDC_ZIP)->SetFocus();
m_bSetFocusToZipCode = FALSE;
}
CDaoRecordView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}
Hum, in fact, this code seems not to be practical since we have to add all BOOL flag
to change the input foucs to all controls on FormView.
But, now we understand that SetFocus() doen's work if we misunderstand how the input foucs
is executed in the process of Window message.
In this case, the tab order of the control on FormView seems to overwrite the code of
void CSortDialog::OnCancel() to set the input focus.
Have a nice day!
-Masaaki Onishi-
|
|
|
|