|
Setting capture brings many problems, starting with how to maintain it. Parent window is a modal dialog; setting capture makes it unusable.
|
|
|
|
|
Not at all, it DOES mean you need to pass the messages on to your child windows. It's not pretty, but if the window doesn't inform you of click messages to itself, then it may be the only solution.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Hello, the codegurus around the world.;)
We can use PreTranslateMessage to capture WM_LBUTTONDBLCLK == message
and use GetFocus func to get which control is now get the input focus.
But, WM_LBUTTONDBLCLK may be a little ambigours since
one clicking the mouse is sometimes generated if we try to click the mouse twice?
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
One less inelegant way to do it (compared to a nightmare of maintaining the capture) would be to handle MCN_SELECT notification in dialog class, and to check the time elapsed between subsequent notifications on the same date.
If a dialog receives two MCN_SELECT notifications selecting the same date within an time interval less than GetDoubleClickTime() milliseconds, it can be considered as a double click and dialog can be closed.
|
|
|
|
|
Hi,
No flames please, any idea how I can get a menu in a CMDIChildWnd frame? (Must be done for a customer.)
Thanks,
Old Simon HB9DRV
|
|
|
|
|
Hi,
I have an nested hierarchy of c++ objects that I am managing with stl containers. Consequently I have implmented the proper copy contructors and operators overrides that I need to add, delete, compare objects etc.
My question is, if I have classes that derive from a base class, how should I manage this in the copy constructor for the derived class?
I have implmented the copy constructor for the base class. Do I need to do any extra work in the derived class's copy contructor, other than copying the data members of the derived class?
I know that this is not strictly VC++, but any help appreicated.
Matthew
|
|
|
|
|
You have to explicitly call the base copy c'tor in the initialization list after the colon - but you already know that, don't you?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hi all,
I wish to programmatically determine the monitor frequency (in Hz), the video card name and its manufacturer and version. Any one has any clue? Is there anything similar to GetDeviceCaps...? (Where's the GetDeviceCapsEx when you need it!? )
If you're saying WMI, then please show me how to use it cause I stumped big time...
/T
|
|
|
|
|
WMI code is fairly complex and involved. It is too complicated to make up a solution for this problem. There are numerous examples of WMI usage on code project, code guru and in MSDN. I have some code I used to interrogate system performance data, but it is quite different from what you will need.
Here's a start from MSDN:
Use this provider first:
class Win32_VideoSettings : CIM_VideoSetting
{
Win32_VideoController ref Element ;
CIM_VideoControllerResolution ref Setting ;
};
Then interogate for the specific controller:
class Win32_VideoController : CIM_PCVideoController
{
uint16 AcceleratorCapabilities[] ;
string AdapterCompatibility ;
string AdapterDACType ;
uint32 AdapterRAM ;
uint16 Availability ;
string CapabilityDescriptions[] ;
string Caption ;
uint32 ColorTableEntries ;
uint32 ConfigManagerErrorCode ;
boolean ConfigManagerUserConfig ;
string CreationClassName ;
uint32 CurrentBitsPerPixel ;
uint32 CurrentHorizontalResolution ;
uint64 CurrentNumberOfColors ;
uint32 CurrentNumberOfColumns ;
uint32 CurrentNumberOfRows ;
uint32 CurrentRefreshRate ;
uint16 CurrentScanMode ;
uint32 CurrentVerticalResolution ;
string Description ;
string DeviceID ;
uint32 DeviceSpecificPens ;
uint32 DitherType ;
datetime DriverDate ;
string DriverVersion ;
boolean ErrorCleared ;
string ErrorDescription ;
uint32 ICMIntent ;
uint32 ICMMethod ;
string InfFilename ;
string InfSection ;
datetime InstallDate ;
string InstalledDisplayDrivers ;
uint32 LastErrorCode ;
uint32 MaxMemorySupported ;
uint32 MaxNumberControlled ;
uint32 MaxRefreshRate ;
uint32 MinRefreshRate ;
boolean Monochrome ;
string Name ;
uint16 NumberOfColorPlanes ;
uint32 NumberOfVideoPages ;
string PNPDeviceID ;
uint16 PowerManagementCapabilities[] ;
boolean PowerManagementSupported ;
uint16 ProtocolSupported ;
uint32 ReservedSystemPaletteEntries ;
uint32 SpecificationVersion ;
string Status ;
uint16 StatusInfo ;
string SystemCreationClassName ;
string SystemName ;
uint32 SystemPaletteEntries ;
datetime TimeOfLastReset ;
uint16 VideoArchitecture ;
uint16 VideoMemoryType ;
uint16 VideoMode ;
string VideoModeDescription ;
string VideoProcessor ;
};
Hope this helps,
Bill
|
|
|
|
|
Hi Bill,
I'm trying to get started with WMI, but I'm stuck.
How do I start? Have you tried it or can you maybe point me to a working code sample somewhere?
/T
|
|
|
|
|
http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/msdn-files/027/001/566/msdncompositedoc.xml
Download the WMI sdk, its full of samples. You will need to do some reasearch on your own and learn about WMI and how it works. Try using the search engine on this site, codeguru and others. Learning to research a problem will server you well in the future.
Thanks for the help,
Bill
|
|
|
|
|
Hey...I need to put "rollover buttons" into my program. It's in Win32 API. How and where would I start to learn how to do this? Thanks - Dave
|
|
|
|
|
I dunno if you can do this without subclassing the button yourself.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Am trying to add more than 32,767 items to a CListBox using AddString ( or even InsertString), and it's not working on Windows 98 although it works on Windows NT and Windows 2000, so what is the solution for this problem knowing that i want to use the CListbox class in my solution ......
|
|
|
|
|
You can't overcome this listbox limit on Win9x. Even if you could, it's not a very good idea to present the user with thousands of items.
Anyway, seems that you'll have to switch to CListCtrl, and probably use LVS_OWNERDATA style.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
The old User controls (like the listbox) still have legacy 16-bit limitations, thus the 32K items limit (32K is the max value for a signed 16-bit int).
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Store your own array of items, then use a small list box to display a selected number of them. Use your own slider control and fill the 10 or 20 or however many you are displaying from an index into your own array. Its probably faster anyway.
--Mark Terrano
|
|
|
|
|
(I want to know everything about how to handle them!!)
How to use the CheckRadioButton(..) method?
I don't understand what they mean in MSDN Libray with the parameters!
But if I say how I want to use them: I want to set the radio button to be checked, and I want to know if the radio is checked!!
HEEEELP!!
------------------------------
CodeCracker - That's me!
------------------------------
|
|
|
|
|
look up the following in MSDN
CButton::SetCheck
CButton::GetCheck
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
CheckRadioButton is fairly simple to use.
The first parameter is the first Radio button ID in the group of Radio buttons. If you had three radio buttons in a group, IDC_CHOICE1,IDC_CHOICE2,IDC_CHOICE3 then the first parameter would be IDC_CHOICE1. The second parameter would be the last one in the range IDC_CHOICE3. The last parameter is the id of the button that you want checked.
You can use IsDlgButtonChecked to find the selected button,
hope this helps,
Michael
|
|
|
|
|
Hi,
to set a radiocontrol checked: m_RadioName.SetCheck(1);
value 1 = checked
value 0 = unchecked
if you want to test the status: if (m_RadioName.GetCheck()==1){...}
|
|
|
|
|
Like this
Use CheckRadioButton(hDlg,IDC_RADIO1(id checked),IDC_RADIO1(start group),IDC_RARIO5(end group))
When you want to know if the button checked use IsDlgButtonChecked(hDlg,IDC_RADIO1)
Bye.
|
|
|
|
|
I have dll that wrote in vc and its exported function declared so:
extern "C"
{extern int WINAPI func(int num)}
How have I declare that function in my project(client program) if I want to use it as imported function ?
|
|
|
|
|
|
This should do what you need:
HINSTANCE DLLhInstance = LoadLibrary("PathToFile.DLL") ;
typedef int (*FUNC)(int) ;
FUNC function = NULL ;
if (DLLhInstance != NULL)
{
function = (FUNC)GetProcAddress(DLLhInstance, "Func") ;
int value = function(value_to_pass) ;
FreeLibrary(DLLhInstance) ;
function = NULL ;
DLLhInstance = NULL ;
}
Any other queries?
Roger Allen the man
|
|
|
|