|
See this article for funky nonclient area drawing tricks.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks! That might be what I'm looking for.
|
|
|
|
|
i have a 1 to many dialog
i show one record of many and have a list showing all.
i would like have the list hilight the current record while either browsing or editting the current one.
So my actual question is:
Is there a way to hilight a row on a listcontrol without having focus?
|
|
|
|
|
|
i have tried that but the row is only hilighted with the control has focus.
as soon as focus is lost the hilight also goes away.
would be greatful for anyother suggestions. thank you.
|
|
|
|
|
Do you have 'Show selection always' option set in the dialog editor?
If you're creating list control dynamically, use LVS_SHOWSELALWAYS style.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
that is exactly the problem. thank you very much.
|
|
|
|
|
Hi ,
I am trying to create an editor similar to MS VisualStudio's
Resource Editor for Dialog.
In this I need to create a Label, which would contain Text
and be dragged around and also be resized.
Can some one tell me how it can be done.
Thanks,
Sansky
|
|
|
|
|
Howdy,
I think you would need to override several mouse functions in your Label class to do the following:
OnLButtonDown: Track when the user clicks and if they have the left button down so that you can know what to do when they move the mouse
OnLButtonUp: Again, use this to remember the mouse button state
OnMouseMove: Inside here test to find out if the mouse button is down and if so, use MoveWindow to move your window to the same coordinates as the mouse is moving to
I think that should do it, but this is just a guess. Hope it gives you a good direction to start looking...
Dave
|
|
|
|
|
Hi,
Thanks, What I need is, how do I create, display ,move and
resize Label
Also I might need to display the Label in the CView, as I
am not sure if I could drag and resize objects in CDialog.
Any suggestions
Regards,
Sansky
|
|
|
|
|
Is there a way to use something like the Internet Explorer "Save as" method in my own programs? I want to save a webpage including the images...
Is there a method / macro to use or do i have to do it all manually ( extracting the tags etc..)?
Thanks for your help...
|
|
|
|
|
Hello,
My application need during execution
to dinamically load a driver (.sys).
How can I do this programatically?
Also, how can I use Visual C++ to
compile a driver? I search in MSDN
and fount at visual c++ linker options
"Use the /DRIVER linker option to build a Windows NT kernel mode driver. ". But how should I use this? I can't figure myself.
Thanks
|
|
|
|
|
Don Miguel wrote:
Also, how can I use Visual C++ to
compile a driver?
You'll need a DDK. DDK is the acronym for Driver Development Kit. http://www.microsoft.com/ddk/ has the details. AFAIR, DDK for Win2000 is even available as a free download.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
You can set up a driver project in VC, though its a good idea to look at what build.exe does first. For the linker, the /subsystem:NATIVE,400 /driver settings will be needed. Compiler switches will vary based on language (c or c++). The NTDDK libs (int64.lib ntoskrnl.lib hal.lib) want _stdcall calling convention.
On NT, you can dynamically load a driver using the service control manager, calling CreateService with SERVICE_KERNEL_DRIVER as the service type, then StartService . This doesn't work on Win9x though - not sure if its possible without user interaction (can u say PnP?).
|
|
|
|
|
Hello Tim,
Thanks a lot for the tips with linker.
Those are exactly what I need.
Best regards,
Miguel
|
|
|
|
|
Hello Don,
To dynamically load a device driver in your (win32 USER-MODE) application, you would use the CreateFile() API. For example :
hDriver = CreateFile
(
"\\\\.\\Omron",
GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
0, // Default security
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED, // Perform asynchronous I/O
0
);
Notice that the format of the first parameter. A device driver is named using the convention "\\.\<Device name>".
You can get the list of names of devices when you look up the Control Panel's Services applet.
After a successful call to the CreateFile() API, you will be returned a handle to the device driver (hDriver as in the above example). You communicate with the device driver via the DeviceIoControl() API. For example :
bReturnCode = DeviceIoControl
(
hDriver,
IOCTL_OMRON_WRITE,
&lWriteCode, sizeof(lWriteCode),
&byReturnByte, sizeof(byReturnByte),
&dwBytesReturned,
&ov
);
The second parameter specifies the control code for the operation that the device is supposed to perform. The technical manual (or SDK) for your device should supply your with these information.
The other parameters are for transferring data to and from the device driver. Look up the API documentation for details.
As for compiling a device driver, the traditional way is to install DDK as mentioned by Thomas in his mail.
Hope the above helps, Don.
Best Regards,
Bio.
|
|
|
|
|
Hello Bio,
Thanks a lot for your help,
you bring many light in my project.
Thanks also for pointing to me
difference between USER-MODE and
KERNEL-MODE, I was on a wrong way in my
judgement about my task.
Best regards,
Miguel
|
|
|
|
|
How do i make the VC++ compiler to generate a exe ith a new file version evrytime it compiles
Thanks in advance - Vijay
|
|
|
|
|
Visual C++ won't do it for you, so you need to pick up a macro or add-in which does it every time you build your project. There are a bunch of those here on CodeProject. Take a look at this link: Visual C++ Macro's and Add-Ins and on that page there are a bunch. For instance, here's the URL for one of them: Auto-Incrementing Build Numbers in Visual C++.
Hope that helps!
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
I have a program derived form CMemDC. It can work perfectly in Win98, but it doesn't work in win2k.
What's the problem and how to solve it?
class CMemDC : public CDC
{
private:
CBitmap m_bitmap;
CBitmap* m_oldBitmap;
CDC* m_pDC;
CRect m_rect;
public:
CMemoryDC(CDC* pDC, CRect rcClip) : CDC(), m_oldBitmap(NULL), m_pDC(pDC)
{
CreateCompatibleDC(pDC);
pDC->GetClipBox(&m_rect);
IntersectRect(m_rect, rcClip, m_rect);
m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height());
m_oldBitmap = SelectObject(&m_bitmap);
SetWindowOrg(m_rect.left, m_rect.top);
}
~CMemoryDC()
{
m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(), m_rect.Height(),
this, m_rect.left, m_rect.top, SRCCOPY);
SelectObject(m_oldBitmap);
}
CMemoryDC* operator->() { return this; }
operator CMemoryDC*() { return this; }
};
Usage:
{
CWnd * pWnd = GetDlgItem (IDC_MY_PANEL);
CDC * pDC = pWnd->GetDC();
CMemDC MemDC(pDC, m_rcDest);
MemDC.FillSolidRect(&m_rcDest, RGB(255, 255, 255));
MemDC.DrawText("Display here", rectDest, DT_SINGLELINE|DT_NOCLIP|DT_CENTER|DT_VCENTER);
......
pWnd->ReleaseDC(pDC);
}
Windows2000 SP2, VC++ 6.0 SP5
|
|
|
|
|
This has nothing to do with your problem, but why are you implementing operator-> and operator CMemoryDC* ?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Maybe the problem is that you write to window DC after it was released:
pWnd->ReleaseDC(pDC);
// now destructor CMemoryDC executes BitBlt
|
|
|
|
|
Thank you vrey much!
I have solved it!
|
|
|
|
|
How to set minimal dialog size (width and height) ?
NodeX
|
|
|
|
|