|
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.
|
|
|
|
|
Hi
Does anyone know how to access the video memory portion that contains the desktop screen? Does anyone know if it's possible to access this surface directly using CreateSurface in DirectDraw or I definitely have to use GDIs?
Thank you very much for your time!
Susan
|
|
|
|
|
only way I know is:
CWnd * pDesktop = GetDesktopWindow();
CDC * pDC = pDesktop->GetWindowDC();
...
//Mess around with DC
...
pDesktop->ReleaseDC(pDC);
I suppose you could create a copy in memory before BitBlt'ing it back? I'm sure someone else on here has a *much* better way....
|
|
|
|
|
How to get path to application execuable file???
Please send me solution on my email;
piopawlu@interia.pl;
|
|
|
|
|
I just get the value stored in
CWinApp::m_pszHelpFilePath
and do a CString::Replace(".HLP", ".EXE");
e.g
in CWinApp::InitInstance(...)
...
CString strPathExe = m_pszHelpFilePath;
strPathExe.Replace(".HLP", ".EXE");
...
It can't be the best way, but it's always worked for me.
|
|
|
|
|
Does anyone know of any "AOL like Instant Messenger" software that I could integrate into a custom designed application. It doesn't need to work with AOL (or any other proprietary type system). I would just like to give my users the ability to quickly send messages to other users that are logged on. Maybe a simple ICQ chat would do? Any suggestions?
|
|
|
|
|
I seem to remember someone posting a socket-based IM program either here or on CodeGuru.
AlsI think there are a number of OpenSource IM programs, although I don't know which to recommend. Sorry!
|
|
|
|
|
Does anyone know of a revision control system that I could easily integrate into a custom designed application? My users need to be able to check in/out text files and view past revisions. I would like to be able to setup a document server and then add simple menu button to my application to give my users access to the files. All of the revision control systems that I have seen are either a) standalone systems without any integration, b) expensive when you need a site license, or c) bloated with features that my users don't need. Can anyone offer any suggestions?
|
|
|
|
|
Yes, you can use GNU RCS, which comes with source code. However, since it's GPL'd you'll also have to release your source with it.
The other things you can do is simply use RCS standalone executables and just call them from within your program.
|
|
|
|