|
Max++ wrote: I'm making the VC++ project to create and edit the data (*.mdb) with SQL server.
Why?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am developing a MFC app (Windows Explorer style).
How can I control window's resizing behavior?
I want to make treeview and listview invisible and when they are
invisible the window size should be automatically reduced.
I am trying OnSize() but it's not working...
|
|
|
|
|
To get that kind've behavior, with adaptable frames, you could go all out and use a Docking control bar. Their more flexible than splitters since they are not attached to the view.
Docking[^]
|
|
|
|
|
In GDI i can draw rounded rectangle by pDC->RoundRect(...) method.
But i need to draw same using GDI+.
Please help.
|
|
|
|
|
GDI+ is just build on top of GDI.
If you look at the Graphics object, it has a GetHDC member, so you can do:
::RoundRect (pGfx->GetHDC(), ....)
or (maybe)
::RoundRect (*pGfx, ....);
I can't be bothered to check, but I think it has a HDC operator functiom, which means you can use it anywhere you can use a HDC.
Iain.
|
|
|
|
|
Iain Clarke wrote: GDI+ is just build on top of GDI.
In general this isn't the case. Here's an except from MSDN (underlines are mine):
Microsoft Windows GDI+ is a class-based API for C/C++ programmers. It enables applications to use graphics and formatted text on both the video display and the printer. Applications based on the Microsoft Win32 API do not access graphics hardware directly. Instead, GDI+ interacts with device drivers on behalf of applications. GDI+ is also supported by Microsoft Win64
GDI+ talks to the display driver using an interface know as DCI.
Steve
|
|
|
|
|
I knew it had some side paths - but I learn new things every day. Thanks for filling in the gaps I left.
Iain.
|
|
|
|
|
In addition to Iain's reply....
Make sure to call Graphics::ReleaseHDC() when you're done with the DC.
Any calls using the Graphics object will fail until you do
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If your using antialiasing, then the ideas posted about using GDI may look kinda funny alongside your other graphics primitives.
I've tried it before and ones eyes tend to get upset if you mix blurry antialiased with edged drawing primitives from GDI. It's best to be consistent within a certain space. Having standard menus with antialiased graphics in the client area of the view seems to work without giving one a headache.
There is an article about RoundRects in GDI+ here on CP. It's a roll your own implementation but it seems that it's a common approach for those seeking that functionality while allowing GDI+ antialiasing.
An approach to RoundRect by Mr. Graus[^]
|
|
|
|
|
Add a round rectangle to a GraphicsPath object and then pass that object to the Graphics::DrawPath() function. Here is a code to add a round rectagle to a graphics path
void GetRoundRectPath( const CRect& rect_i, int nRad_i, Gdiplus::GraphicsPath& path_o )<br />
{<br />
int nX1 = rect_i.left;<br />
int nY1 = rect_i.top;<br />
int nX2 = rect_i.right - 1;<br />
int nY2 = rect_i.bottom - 1;<br />
int nDia = nRad_i * 2;<br />
<br />
path_o.AddArc( nX1, nY1, nDia, nDia, 180, 90 );<br />
path_o.AddArc( nX2 - nDia, nY1, nDia, nDia, 270, 90 );<br />
path_o.AddArc( nX2 - nDia, nY2 - nDia, nDia, nDia, 0, 90 );<br />
path_o.AddArc( nX1, nY2 - nDia, nDia, nDia, 90, 90 );<br />
path_o.CloseFigure();<br />
}
|
|
|
|
|
Following code is copied from Ms HtmlHelp.h
//============================================
enum {
HHACT_TAB_CONTENTS,
HHACT_TAB_INDEX,
HHACT_TAB_SEARCH,
HHACT_TAB_HISTORY,
HHACT_TAB_FAVORITES,
HHACT_EXPAND,
HHACT_CONTRACT,
HHACT_BACK,
HHACT_FORWARD,
HHACT_STOP,
HHACT_REFRESH,
HHACT_HOME,
HHACT_SYNC,
HHACT_OPTIONS,
HHACT_PRINT,
HHACT_HIGHLIGHT,
HHACT_CUSTOMIZE,
HHACT_JUMP1,
HHACT_JUMP2,
HHACT_ZOOM,
HHACT_TOC_NEXT,
HHACT_TOC_PREV,
HHACT_NOTES,
HHACT_LAST_ENUM,
};
typedef struct tagHHNTRACK
{
NMHDR hdr;
PCSTR pszCurUrl; // Multi-byte, null-terminated string
int idAction; // HHACT_ value
HH_WINTYPE* phhWinType; // Current window type structure
} HHNTRACK;
//======================================================
My Q is:
how to use the struct tagHHNTRACK in HtmlHelp() function?
the constant HHACT_EXPAND sounds good for my use.
thx.
|
|
|
|
|
Hi,
Can I use the listctrl of the windows explorer in my application? I mean I want to use the explorer window, but only need that listctrl in which the files and folder are displayed.
Thanks in advance.
- NS -
|
|
|
|
|
Why exactly would you want/need to do this? Can't you just add a list control to your application and code it up to do what Explorer's does?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I was just intended to avoid extra coding. I am not sure whether it is possible or not.
- NS -
|
|
|
|
|
There's an article here on CP about doing that in Vista. It mentions that it's possible (although harder) in previous OSes as well.
|
|
|
|
|
|
Thanks
- NS -
|
|
|
|
|
Thanks for the hint. I shall ofcourse try...
- NS -
|
|
|
|
|
Hello. How can I determine whether a directory is shared? I thought that traditional FindFirstFile and WIN32_FIND_DATA would provide me the answer, but it doesn't.
Thanks in advance.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
|
Thanks!
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
You can use NetShareEnum API
AJay
|
|
|
|
|
I have created a custom message for one of my windows. For the sake of argument lets call it CUSTOM_MESSAGE. So I use the sendmessage code as follows:
char *text;
SendMessage(hwnd, CUSTOM_MESSAGE, 0, (LPARAM)text);
In the destination window's message procedure, I want it to set the value of text (the LPARAM value), and make this value availible to the previous bit of code, as shown below
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
...
switch(msg)
{
...
case CUSTOM_MESSAGE:
//Set the value of the LPARAM and allow the previous bit of code to receive and use this value
break;
...
}
...
}
So, once SendMessage() has been called, the other bit of code can use the text variable, which has been set by the destination window's window procedure, as shown:
char *text;
SendMessage(hwnd, CUSTOM_MESSAGE, 0, (LPARAM)text);
MessageBox(NULL, text, "Message", MB_OK);
How would I go about doing this?
Thanks for your help!
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
You should allocate memory for the LPARAM parameter before sending message,because you can't access to NULL pointer.
char *text;
SendMessage(hwnd, CUSTOM_MESSAGE, 0, (LPARAM)text);//text==NULL
|
|
|
|
|
Good point. Thanks
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|