|
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
|
|
|
|
|
I got a bug report on a program that I wrote saying that when it tries to open the file dialog that it crashes under windows 2000 professional. I used to following function to open a "file open" dialog:
BOOL DlgGetFileName(HWND hWnd,LPSTR lpszTitle,LPSTR lpszFormat,LPSTR lpszFileName,BOOL save)
{ OPENFILENAME of;
int result;
// Initialize the OPENFILENAME members
of.lStructSize = sizeof(OPENFILENAME);
of.Flags = OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_NOCHANGEDIR |
OFN_FILEMUSTEXIST | OFN_EXPLORER;
of.hwndOwner = hWnd;
of.hInstance = hInst;
of.lpstrFile = lpszFileName;
of.lpstrFilter = lpszFormat;
of.nFilterIndex = 1;
of.nMaxFile = 5120;
of.lpstrInitialDir = NULL;
of.lpstrTitle = lpszTitle;
of.lpTemplateName = 0;
of.lpfnHook = NULL;
of.nFileOffset = FileOffset;
// Display the dialog
if (save) result=GetSaveFileName(&of);
else result=GetOpenFileName(&of);
return result;
}
Does anyone have any ideas why this would crash? I will give credit for the fix if you help me out... I am thinking there must be a problem with the file open common dialog and windows 2K, maybe windows 2K uses different common dialogs that win 98 or something and my code doesn't take that into account?
Thanks for any ideas,
Jon (webmaster@compumatrix.com)
|
|
|
|
|
The OPENFILENAME struct was made bigger for the Win2K features - you'll need to check the OS at runtime and set the lStructSize accordingly: 76 for 9x/NT4 and OPENFILENAME_SIZE_VERSION_400 for Win2K. MSDN has all the details in the OPENFILENAME page.
|
|
|
|
|
I presume you are passing the correct parameters to the function?
Also, you use the flag OFN_NOCHANGEDIR , but set lpstrInitialDir to NULL. Although if the file anme contains a path, the folder containing the file should be selected, it could be your problem.
Why it should work on Win98 but not Win2K I have no idea.
|
|
|
|