|
Send the edit box a WM_ENABLE message with the WPARAM parameter set to either TRUE or FALSE .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Or see the EnableWindow() SDK function
Bikram Singh
|
|
|
|
|
Hello,
I'm working on Visual Studio 7.0 (.NET). I wanted to add a menu and OK; VS adds a menu with ID IDR_MENU3. I've tried about everything to change this id to something representative, but no luck so far.
Has anybody any idea on how to change the id?
(maybe I should add it manually in the rc file, but I do not like that option).
Tnx in advance!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hi,
There seems to be something wierd with menu resources and Visual Studio .NET. I noticed that when you right click on the menu resource in the Resource Editor window, the resulting context menu does not list a "Properties" option. I think it should, but you can get around this by doing the following:
1) Make sure the IDR_MENU3 is highlighted in the Resource Editor.
2) Go to the "View" menu in VS.NET
3) Click "Properties Window"
Somewhere in the VS.NET program a properties window should appear. One of the items listed in the properties window says "ID". Its corresponding value should read "IDR_MENU3". Click on the text to get a cursor in order to change it. Hit Enter when finished and it should work.
Hope that helps!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
It worked !! tnx a lot!!
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
#define _WIN32_WINNT 0x0500
#include <windows.h>
Lib:kernel32.lib
when I compile my codes,compiler shows a link error:
error LNK2001: unresolved external symbol __imp__CreateTimerQueueTimer@28
and My OS is windows 2000 server,how two resovle this link error,thanks a lot
|
|
|
|
|
Try including windows.h.
Kuphryn
|
|
|
|
|
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
it doesn't work,it is a link error,I think maybe I miss some .lib file,what to do next?
|
|
|
|
|
I have done all that you said,but failured
|
|
|
|
|
Do you have the latest Platform SDK? If not download it from msdn.microsoft.com[^]
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I downloaded it only two months ago and include directory is set correctly(new directory is on the top of all .h files path)
|
|
|
|
|
yingkou wrote:
and include directory is set correctly
What about the lib directory?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
haha,I have forgotten set the .lib directory. thanks everyone
|
|
|
|
|
Hi,
I need a command that will bring my application to the top of the Z order. I'd have thought this task would be fairly simple, but apparantly not: I've tried using
AfxGetMainWnd()->BringWindowToTop() and also
AfxGetMainWnd()->SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); Neither of these techniques seem to work at all. Can anyone advise me as to what I'm doing wrong?
Joel Holdsworth
|
|
|
|
|
Joel, SetWindowPos() works for me. It's how I implement the "Always on top" feature in my apps.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Joel Holdsworth wrote:
Neither of these techniques seem to work at all.
So what do they do then?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
They don't seem to do anything at all!
Joel Holdsworth
|
|
|
|
|
What does SetWindowPos() return? Have you tried stepping into each to see their behavior?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Correction: BringWindowToTop seems to work once - the first time i call it in application's session, after that it becomes totally ineffective!
Joel Holdsworth
|
|
|
|
|
Hi,
I'm in the process of writing a button control that has "dead man" behaviour. The button will be used to control some machinery, and the customer has asked for this button control that will only allow activity to happen while the mouse button is pressed on it.
I'm making a control that intercepts messages WM_LBUTTONDOWN and WM_LBUTTONUP so that it can notify the backend when the user presses/releases the button. My question is this: Is there is any chance (even the slightest most skinny chance) that delivery of the WM_LBUTTONUP message might fail? I'd imagine that there might be a 1 in a million chance. So does anyone have any advice for implementing this safely?
Joel Holdsworth
|
|
|
|
|
Try pressing the mouse button over the control, moving the mouse away and then releasing the button.
I think this can cause problems but I think you might have to put it over a larger conrol and catch the mouse movements on the larger control, thus the larger control acts as a 'guard rail'.
It's many years since I saw this issue so can't give more info off hand.
Elaine
The tigress is here
|
|
|
|
|
Even having a "guard rail" larger control might not work if the user moves the mouse entirely outside of the application window and then releases the button. The best way to deal with that is to use the SetCapture() function so that the necessary window receives mouse events even if they occur outside the window.
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
A better way to set up the "Guard Rail" would be to restrict the mouse cursor using the ClipCursor function. See ClipCursor and GetClipCursor in MSDN.
"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!
|
|
|
|
|
Good point. ClipCursor will prevent the mouse from even going outside the boundary. For allowing the user to bring the mouse outside the boundary and still handling messages you would use SetCapture .
Thanks for the tip.
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|