|
You'll need to subclass CEdit and handle the WM_CUT, WM_COPY, and WM_PASTE messages.
|
|
|
|
|
Erik,
Thanks for your response.
I have CEdit subclassed already and I can trap the WM_COPY/CUT/PASTE messages there if I needed to in ::WindowProc. But I want to disable the menu items in the first place.
In a nutshell what I am trying to do is have a custom 'read-only' state in the edit control.
So I would like to be able to disable the Cut/Delete/Paste items of the default CEdit context menu when my control is 'read-only'. That way the user doesn't even have the option of selecting it.
The only thing I can think of is to create my own pop-up menu and look for a right click or that other windows key. Which is do-able, but I'd rather just be able to enable/disable the default context menu items at will.
Any ideas?
Byron
|
|
|
|
|
|
Well, I'd like to know how to disable the focus when
I'm using the arrows key in a dialog box.
If my buttons are "disabled", there is no focus and I
can get the "OnKeyUp" event, but if one or more is enabled,
There is no more "OnKeyUp" event!
Someone has got an idea?
|
|
|
|
|
Handle the PreTranslateMsg function, and check the msg structure for a WM_KEYUP or WM_KEYDOWN event.
|
|
|
|
|
The problem is that I'm using MFC and there is no
PreTranslateMsg function in the App...
Another idea?
|
|
|
|
|
Yes there is. Every window has a PreTranslateMessage virtual function which you can override. It's even in ClassWizard.
|
|
|
|
|
Has anyone have an idea if there is a Windows API to use in order to Enable/Disable the "Start->Shut down ..." menu in the windows task bar.
In my application, to use it, the user have to enter a code or have an access right.
Thanks
|
|
|
|
|
The only way I know of to do this is to use group policies, but I don't think you can change them without logging off and back on.
|
|
|
|
|
If I have a char string that reads, for example: bttlxe\gfx\image.bmp; how do I shorten this so I just have the file name at the end?
I have tried things like split/makepath, but I can't get it to work without a drive. I have also tried reversing the string, finding the first occurance of \\ and then copying to a new string the last 'x' characters, but this aslo doesn't work reliably.
How would you do it? (in C only)
Thanks for any help,
David
|
|
|
|
|
Try this:
char *p;
p = strrchr(YourString, '\\');
if (p) p++;
p is a pointer to string containing a file name.
|
|
|
|
|
You'd locate the last backslash with strrchr() and just copy all chars starting after the backslash to the beginning of the string. Untested code follows.
TCHAR str[] = "bttlxe\\gfx\\image.bmp";
TCHAR* pFrom;
TCHAR* pTo = str;
pFrom = _tcsrchr(str, '\\');
if ( NULL == pFrom )
return; /* didn't find a backslash */
pFrom++; /* skip past the backslash */
/* copy chars up to and including the terminating null */
while ( *pTo++ = *pFrom++ )
{ }
|
|
|
|
|
Hi,
Is there is a reason that i can't see any tool tip appear on a CComboBoxEx.
I create the tool tip with CToolTipCtrl or by sending TTM_ADDTOOL message to combo.
Help me please
|
|
|
|
|
When I create a simple ATL in C++ and use it in an application in Visual Basic, it works fine if I use the "new" statement to create de object. But, if I use "CreateObject"instead of "new", a message appears showing that it's not possible to create the instance.
I tried the "Ole View" tool and saw that the interface was created properly but there wasn't any object.
What's going on?
|
|
|
|
|
Hi,
what is UI element in controlpanel / display properties.
there four tabs back ground, screen saver etc. what is that
UI element?
Thanks,
Koteswara
|
|
|
|
|
That's a property sheet. Each tab is a property page.
|
|
|
|
|
Hello gurus,
How to add one tab (like menu tab) to controlpanel display applet.
like Back ground, screen saver.
Mecaffe3.1.4 version adds one tab to display applet
or window (screen scan). I want to know how to add one tab.
Thanks in advance,
koteswara rao.
|
|
|
|
|
Write a property sheet handler (see my shell extension series for a tutorial on doing this). In your IShellPropSheetExt::AddPages() method, you add whatever page(s) you want.
The additional registration step is to add your handler under:
HKLM\Software\MS\Win\CV\Controls Folder\Display\shellex\PropertySheetHandlers
|
|
|
|
|
Since #define cannot define other preprocessor directives..
eg. #define SOME_MACRO #ifdef something // no way
I suppose I have to preprocess the file before passing it to the C preprocessor, something like m4 on gnu.
Does anyone know of macro processing tool similar for VC++ or how can the above be done??
|
|
|
|
|
Hello,
I have an ATL ActiveX Composite Control dialog. On this dialog I've got a plain old Button. Now I need to know when the user moves the mouse over this button. I've overriden WM_MOUSEMOVE for the dialog, I get only a notification that the mouse is over the button, when the button is disabled.
Please note that in the Composite Control dialog I don't have PreTranslateMessage at disposition (or at least I wouldn't know how to implement it).
I'm pretty sure that there is some fantastically easy solution and I'm just not seing it. Since I'm having "hair-on-fire" mode, every help is highly appreceated.
Thanks a lot.
Matthias
|
|
|
|
|
Hi
I'm only a guru-wannabe so i can't help. You might get some clues from http://www.codeproject.com/miscctrl/subclassdemo.asp
|
|
|
|
|
Hi All :
Not a single one who can give me information about RDS programming with VC++.
Any references or good articles / books . i know there is MSDN and Microsoft.
|
|
|
|
|
How can I simply get the information - handle, etc. of any window under the cursor even if it belongs to another application.
Thanking you in advance.
Happy programming!!
|
|
|
|
|
WindowFromPoint
The WindowFromPoint function retrieves a handle to the window that contains the specified point.
HWND WindowFromPoint(
POINT Point // point
);
Parameters
Point
[in] Specifies a POINT structure that defines the point to be checked.
Return Values
The return value is a handle to the window that contains the point. If no window exists at the given point, the return value is NULL. If the point is over a static text control, the return value is a handle to the window under the static text control.
Remarks
The WindowFromPoint function does not retrieve a handle to a hidden or disabled window, even if the point is within the window. An application should use the ChildWindowFromPoint function for a nonrestrictive search.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.
From MSDN ;0)
|
|
|
|
|
Hello people,
I am using MCI commands to play AVI movies and
I would like to draw the frames on a specific region in the window using its device context (HDC of the window).
I know that we can use the Window handle of the target windows as a parent handle for the video, but in my case using the Device Context would be better.
Does someone know if MCI commands can solve this problem?
Thank you for your attention.
Atlus_
Is there any way to perform an AVI playback using the device context (HDC) of a Window. The way I know
|
|
|
|