|
I agree, this seems the optimum solution.
|
|
|
|
|
|
Kushagra Tiwari wrote: Or you can broadcast the message using flag WM_BROADCAST, if you have made a custom Windows message (eg. WM_SAMPLE_APP (you should have a handler for the same. Also you can internally have the code for things you wanted to do in the handler))rather than posting athread message. Doing this everry active window will recieve this message but since only your application has has handled that message you will be able to get the desired functionality
That doesn't make any sense at all.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Will you stop behaving like a child? I don't care about low votes, but not on a programming forum. Because that counts against my contributions here. Your answer was completely senseless, so how about answering only those queries that you have some clue about?
And how about accepting it when someone says you are wrong, instead of acting like a coward and low-voting them? For the record, yes, I just had to mark your answer as "Bad Answer".
You repeat this nonsense and I know where to take it.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hello Sir,
I am sorry for that , but I marked it bad by mistake , and I completely respect you . May be I wasnt able to explain my ans to the fullest . I wanted to mark ur ans as good but by wrong click marked as Bad. Plz Ignore and thre are no hard feelings
Have a very gud day 
|
|
|
|
|
Rajesh R Subramanian wrote:
And how about accepting it when someone says you are wrong, instead of acting like a coward and low-voting them? For the record, yes, I just had to mark your answer as "Bad Answer".
But that was really harsh from your side .. You could have asked first that was it by mistake or I did it intentionally .
Anyways , I think now the misunderstanding will perish .Thanks for guiding me .
Kushagra
|
|
|
|
|
Well, there's no 'harshness' - I just had to express my opinion on your act.
And I'm not sure you had to mark a reply to *you* (which isn't an answer to the OP) as good or bad. Especially, given that there are no "Good Answer" or "Bad Answer" buttons and that you have to specifically click on a number... Now I see it's changed to 5.
However, I'm over it and please don't call me "Sir".
Thank you!
PS: Deleting your message is considered rude on this forum, especially after people have replied to it.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Derive that class from CWinThread. This will provide the class with a message pump and message mapping mechanism, and then you could use PostThreadMessage to post a message to it (actually to the thread). Have a message map entry added for all the messages of your interest.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Using shared memory might be another way to do what you want to implement.
|
|
|
|
|
hi every body ....
i have some problem in my project...
i.e convertion of word(or)excel to pdf ?
this project is developed in vc++6.0
please help me.......
thanks in advance....
|
|
|
|
|
soo preety wrote: convertion of word(or)excel to pdf ?
You need a PDF library or writer; try Google, there are many options available.
|
|
|
|
|
Is this[^] helpful ?
Regards,
Paresh.
|
|
|
|
|
Hi
I am a newbie in MFC and VC++. I have a tab dialog application with five edit boxes expecting user entry. Everything works fine till the application is in focus. Once the application goes out of focus and comes back the edit boxes refuse to accept the key inputs from the user.
I will explain the procedure in which I found the issue: Application is running and user inputs numbers into the edit box - here it works. User presses Win key + D to show desktop. Application disappears since there is no task bar icon for the application, we need to restore any other window (of any other application) available and minimise it to make my application visible. This is also not desirable but then the edit boxes no longer accept the key inputs. Once i minimise the application to tray and restore, then everything works fine. I need to fix this two issues
I am not sure where to look for a bug in the code. Please help
Sorry for the long problem description.
Thanks in advance
Deepak
PS:
1. I have a pre translate message function to filter out ESC and ENTER key to avoid closing the application by these keys.
2. It has a hidden dialog to avoid showing up in the taskbar area while the application is visible in desktop.
3. It is a tray residing application.
4. All these 3 functionality codes are from CP articles. Is there chance of having an issue in these codes?
|
|
|
|
|
what do you mean about "key press missing"? can not detect chars or keys in WM_CHAR or WM_KEYDOWN? if so, use PreTranslateMessage(), MFC dialog blocks some key events - I don't know why MFC does this.
|
|
|
|
|
includeh10 wrote: what do you mean about "key press missing"?
No characters appearing in the edit field when we type something in the keyboard. My PreTranslateMessage() filters out only the ESCand ENTER characters in my app.
Thank you
Deepak
|
|
|
|
|
Hi All,
I am using a software to run a occupancy report manually by clicking a button in the software.
I would like to automate this task by writing MFC application to programatically click the button every hour. So I dont know how to activate other application's button by my program.
Could anyone please suggest me some possible solution for this?
I am not sure where to start and how to proceed. Any piece of information will help me a lot.
Thanks in advance.
Regards,
Ram
|
|
|
|
|
Ram Murali wrote: So I dont know how to activate other application's button by my program.
Why not just use a timer in the main application so it sleeps for an hour and then runs its activities? Alternatively you could probably use the Windows Task Scheduler.
|
|
|
|
|
Hi Thanx for your reply.
Timer function wise, i have no problem.
But my problem is how to activate other application's button using my own program.
I used FindWindow() method to get the other application's window handle.
But How to get the control of the button to send message to that button?
This is the biggest issue to me now.
Regards,
Ram
|
|
|
|
|
Ram Murali wrote: But How to get the control of the button to send message to that button?
I think you need to enumerate all the child windows until you find the button, then post a message to the button's HWND. However this seems a very complicated way of going about solving what is really a simple timer issue.
|
|
|
|
|
Can you please tell me the easiest way to do this?
Thanks
Regards,
Ram
|
|
|
|
|
Richard MacCutchan wrote: Why not just use a timer in the main application so it sleeps for an hour and then runs its activities?
I think it's a 3rd-party application that he's wanting to run and simulate a button click within.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Use FindWindow() and then EnumChildWindows() to find that button .Refer MSDN for both functions.That will surely help u. Mark this ans as good if u feel it helped.
Kushagra
|
|
|
|
|
okay let me give you a simpler example to explain what isnt working for me...in the following code, this is the output I get :
$ ./a.exe
Enter 10 numbers: 1 2 3 4 5 6 7 8 9 10
The biggest number right now is:1
The biggest number right now is:2
The biggest number right now is:3
The biggest number right now is:4
The biggest number right now is:5
The biggest number right now is:6
The biggest number right now is:7
The biggest number right now is:8
The biggest number right now is:9
The biggest number right now is:2281060
The real biggest number is: 2281060
THE OUTPUT I WANT IS:
Enter 10 numbers: 1 2 3 4 5 6 7 8 9 10
The biggest number right now is:1
The biggest number right now is:2
The biggest number right now is:3
The biggest number right now is:4
The biggest number right now is:5
The biggest number right now is:6
The biggest number right now is:7
The biggest number right now is:8
The biggest number right now is:9
The Real biggest number is: 10
what am i doing wrong?
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int count, biggest = 0;
int numbers[10];
cout << "Enter 10 numbers: ";
for (int i = 0; i < 9; i++)
{
count++;
cin >> numbers[i];
}
for (int r = 0; r < count; r++)
{
if (numbers[r] > numbers[r-1])
{
biggest = numbers[r];
cout << "The biggest number right now is:" << biggest << endl;
}
}
cout << "The real biggest number is: " << biggest;
return 0;
}
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
HI! i ddon' know much about c++
i had this dll using vb6 inject into another process winsock2
for tunnel. my problem is that i had the dll injected but i need a function to make dll pass host and port they going to connect into vb6 maybe like call back here is the function in dll
int WSAAPI myconnect(SOCKET s, struct sockaddr *name, int *namelen)
#define SIN(name) ((struct sockaddr_in *)(name))
{
struct sockaddr_in *paddr =(struct sockaddr_in *)name;
char *ip =inet_ntoa(SIN(name)->sin_addr);
int port =ntohs(paddr->sin_port);
return ((Pconnect)hookconnect.pTrampoline)(s, name, namelen);
}
thank you much
if you need i can send u dll source.
|
|
|
|