|
Sorry to trouble you again.
I can't find the WM_WINDOWPOSCHANGING message in the Class Wizard.so i don't know how to add the message handle function.
How can i generate the function OnWindowPosChanging?
tank you.
|
|
|
|
|
Sorry to trouble you again.
No problem
MFC Class WIzard -> Class Info tab -> Advanced Options -> Message filter -> Window
This message filter thing is IMHO a little annoying and a constant source of confusion.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Here's another way:
1. Uncheck the "Visible" checkbox from the dialog resource.
2. Construct the dialog box modelessly:
In your CWinApp-derived class, replace the code in your InitInstance (after Enable3dControlStatic) with something like this:
static CYourDlg dlg;
dlg.Create(CYourDlg::IDD);
m_pMainWnd = &dlg;
return TRUE;
Regards,
Alvaro
|
|
|
|
|
I set a hook over system to draw a button into caption area. I succeed.
And I want when I press Left Mouse BUtton on this button, it pop up a ownerdraw menu, what can i do ?
|
|
|
|
|
Hi
I have a popup-menu associated with a window, and I want to specify for each menu entry if it is enabled/disabled. So I'm wondering if my window sends some messages (similar to WM_LBUTTONDOWN for example) just before displaying a menu item? I would like to be able to intercept that message and actualize the enabled/disabled state of that item. I read something about ON_UPDATE_COMMAND_UI but my window is created with CreateWindowEx and I can't do anything with classwizard.
How can I handle this task easily
Thanks
|
|
|
|
|
Handle WM_INITMENU.
See MSDN to read about WM_INITMENU
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
I dynamically construct the popup menu when I detect a right mouse button click. This way, you can set the disabled state of individual menu items.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
That works fine, thanks
|
|
|
|
|
How to change parameters of video source: brightness, contrast and other? Not in the reference dialog box (capDlgVideoSource), by means of a movable indicator. For example, it's necessary automatically to customize all these parameters in program at startup (entering their numerical significances). Whether there are any functions, variable or something for a modification of these parameters?
|
|
|
|
|
i'd like to get string laid below mouse pointer using mouse hooking in another application.
if example source exist, let me show. thank you
have a nice day
|
|
|
|
|
If your string wants to get laid, just send it to a singles bar.
Seriously, this question gets asked over and over again here, I don't get why, but the answer is simply that to get ANY visible string you need to use screen capture and write some funky OCR stuff, to get any PARTIALLY visible string that is written (not in a bitmap) you need to use GetWindowText and GetFont to figure out the metrics of which word you are over.
Neither of these is a simple enough task to get a quick answer in a forum. I've also asked every person who asks this question and no-one has ever told me *why* they want to do it, beyond the fact that there are one or two apps about devoted to the purpose for the reason of providing tranlations between languages.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
i expect that string is not got using simple API function (GetWindowText, ...).
but when windows(OS) prints string on screen, read character code format so then i put the string in my application window. generally, using to hook TextOut or ExTextout function, it is implemented.
by the way, i want to know how to implement it in detail.
have a nice day
|
|
|
|
|
a. It is unlikely you are right, because that would require the window to be invalidated in order to redraw, and in fact you would still need to get the window using WindowFromPoint, and figure out which word in a sentence was under the mouse. Also, the commerical apps that do this use OCR, because they can read words off bitmaps. Either way, what you propse is mind numbingly more complex - why wait for a draw command once you know the window when you can just ask it directly ?
prog7584 wrote:
by the way, i want to know how to implement it in detail.
b. Like I said, you and everyone else who asks this stupid question. I propse we add to the FAQ the fact that an answer is not going to be forthcoming, anymore than an answer would be given if I asked 'How can I write a first person perspective shooting game' - the answer is build an engine, create some models and animate them with algorithms to ensure the laws of physics are obeyed. What you're asking is similarly too complex to answer in a forum, except broadly, as I have done. You have some other ideas, that's fine. Like everyone else who asks you didn't answer when I asked why you would want to do such a thing, and that's fine. But no-one is going to find an answer to your question, any more than they did the last 57 people who asked. If you have a need to do this, and an idea how, then give it a go and ask questions when you get stuck on something.
You're asking how to do something complex enough that people who have done it sell an app that does exactly what you said and no more.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
I don't know just how possible what you want is but I can point you to some APIs that may help you:
GetCursorPos -- gets the current cursor position in a POINT structure
WindowFromPoint -- gets the handle of the window at the given POINT location
GetWindowText -- gets the "window text" for a given window
The problem is that GetWindowText will ony work well if the mouse is over a title bar or an edit box. Otherwise it's not gonna be reliable.
Hope to have helped and good luck,
Alvaro
|
|
|
|
|
I am running into a problem with a Wizard that my activeX control has...The problem occurs when the user reaches the last dialog box, forgets to enter a value in one of the dialog boxes and presses finish. A message box pops up, telling the user that they must enter a value, but as soon as the user clicks OK, the Wizard and IE lose focus and the last minimized app comes on top. This does not happen in any of the previous Wizard pages. Any ideas how I can go about setting the focus back to this last page?
BTW, I have tried all kinds of setFocus variations...
This is the code in the OnWizardFinish BTW:
BOOL CAddControllerPage4::OnWizardFinish()
{
if(m_nFlag == -1)
{
m_nFlag = 0;
m_ErrorObject.PromptError(12060); // this prompt
// error using
//AfxMessageboxDirect
return 0;
}
else {
return CPropertyPage::OnWizardFinish();
}
}
thanks
|
|
|
|
|
Hi,
I’ve a application which I want to start at machine start up. I’m using Task Scheduler to schedule this application. I’ve tried sample (MSJ Feb 99)Feb99CQA.exe. Problem is even though Task Scheduler is running as interactive service; I do not see any UI. Task Manager shows my application running but it does not display any UI. I tried running notepad but the result is same. Basically I’m not getting TaskbarCreated message in my application. What else I need to do to see ui / ShellNotifyIcon? I’m aware of concept of Windows WorkStation and desktop. Is it possible at to do?
I would appreciate any suggestions regarding this.
Thanks
|
|
|
|
|
Hello. After a couple days of fitful studying of DLLs I still have one question that I can't seem to find hte answer for:
I know the functions in a .DLL can do pretty much whatever they want, but how do I let the main program (that linked to the .DLL) know that something has happened in the .DLL. Specifically I want the keytrapping hook to let the keycounting program know "a key was just pressed". Is PostMessage the answer?
-Jason
nirgle.bitdevil.com
|
|
|
|
|
Wait a second. Would it make more sense to have the .DLL increment a variable local to IT every time a key is pressed and the hook is called, and then export a function to return (and then reset) this value, so the main program can just call this func when it wants to, rather than the .DLL telling the program when it feels like it?
-Jason
nirgle.bitdevil.com
|
|
|
|
|
There are a number of ways of letting a program know that something happened. They vary in complexity and flexibility. Some of them are:
- callback functions
- posting a custom message to a window
- posting WM_COPYDATA to send data + notification
Hope this helps and that I'm not stating the obvious.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Ravi Bhavnani wrote:
posting WM_COPYDATA to send data + notification
Hey thanks for that! That's what I love about this site - you constantly pick up little scraps of information that will prove useful.
________________
David Wulff
http://www.davidwulff.co.uk
"I loathe people who keep dogs. They are cowards who haven't got the guts to bite people themselves" - August Strindberg
|
|
|
|
|
Posting (PostMessage) a WM_COPYDATA message is NOT recommended.
Use SendMessage or SendMessageTimeout instead.
--------------------------------------------------
If my messages appear curt, I apologize.
I try to be brief to save your time as well as mine.
--------------------------------------------------
|
|
|
|
|
Gert is absolutely right. Use SendMessage() instead of PostMessage() when delivering WM_COPYDATA. My mistake!
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I guess you could give the dll an interface to the main program. Just a pointer to an instance of some class with some functions to process input from the dll. This is the way 3d Studio VIZ handles plugins.
WAVK
|
|
|
|
|
I've done it a different way (but thanks to all who answered). When I call the Init function in the .DLL I pass the handle of the window of my prog. Then the key function just sends a message to the main program that a key was just pressed. I use ::PostMessage(), and if I lose a key every now and then, it won't be missed among the million-or-so other keys a month I type.
I can't wait to actually get this project going because I want to start letting the world know about it!
-Jason
nirgle.bitdevil.com
|
|
|
|
|
I'm trying to look for some tuts or sample apps that use radio buttons. Ihave 2 radio buttons on my dialog, and need to disable certain controls when one or the other is selected, depending on what is selected.
If anyone knows of any good sites that may have what I'm looking for or if anyone could provide insight or maybe a quick sample about what I'm trying to do, I would really Appreciate it.
Thanks so much in advance.
Digital Khaos
"Every problem has a solution" --unknown
|
|
|
|