I am writing an application that will provide the feature of "taking" a pixel color from any other window, currently displayed. When the user right clicks with the mouse on the desktop, taskbar, or the system tray for example, the color (RGB) of the pixel he has clicked on must be obtained.
Do you have any idea how this functionality could be implemented?
The real question is how could I obtain another window's DC (from which I could get the pixel), and the mouse coordinates when the user presses the right button on another window...
Thank you in advance.
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
ok, to add columns to the list control, make sure that you create the control with the LVS_REPORT style.
then call CListCtrl::InsertColumn() to add a column and then CListCtrl::InsertItem() to add items. I saw a post that already indicated this.
Now to the problem of sizing the control to the size of your dialog:
In the dialog class, handle the WM_SIZE message, call GetClientRect() to get the current client rectangle of the dialog and then just call CListCtrl::MoveWindow() to size the list control to the size of the dialog.
Pazzuzu wrote: How will I create a Listbox control
used the "m_ListBox.Create"- How will I pass the cDialog class as I have to pass a "pParentWnd parameter" which expects a CWindow object
Unless you absolutely have to, it's easier to create the control at design-time rather than at run-time. As to your question about the Create() method, the third parameter would be the this pointer. For example:
I just started developping with Visual .Net in C++ (unmanaged).
I'm facing a strange behavior in the debugger : if I go step by step in my code (F10), the debugger just step over many lines of code, and the variables viewer let me see that the object I'm debugging is in a very strange state, many member variables being uninitialised (which was supposed to be done in my constructor).
Did you already had such a strange behavior ? Is it possible to solve it ?
If my understanding of your problem is correct, you are trying to use a modeless dialog to look as if its a "pane" within your application. If this is correct, read on:
1. Make the dialog a CHILD dialog
2. In the parent window, handle the WM_SIZE message and then merely resize the child dialog.
For example (a WTL eg): void OnSize(UINT uiCode, CSize sz)
if ( ::IsWindow(m_MyChildDialog.m_hWnd) )
// do some manipulation on the rect if needed...
rect.DeflateRect(10,10,10,10); // here I'm just decreasing the overall size of the rect
That should be all you need to do.
Let me know if I've missed your question completely.
I know how to run a VB exe file from VC++6.0 but have been trying to read the contents of the exe from VC++. Like if the VB application has ODBC coding in it then I would like to read the kind of API calls that it is making through VC++ application. Is it possible to do like that?. Is it possible to intercept an exe program and know what all objects it is accessing? If yes then how do I do that?
hello evry one , i'm treing to craete for my app a main window whitch part of the window( the left part ) will be a permanent dialog box ( not anything fency - just some buttons) , but i want the dialog box to be a part of the window , meaning if we resize or move the main window the dialog box will still be in the bounderis of the main window with the same size ratio . i'm working in a win32 and on visual c++ , my code is genarally in C , any help or reading metarial about this subject will be very helpfull . thanx alot
The easiest way i can think of using MFC is to watch for WM_MOUSEMOVE in the parent window's PreTranslateMessage() function. You won't get any information on what HTML element the mouse is over though, so if you need that then do it Rama's way.
I have an application with several dialogs, all have logical Tab-Ordering.
Everything was great up until a month ago when suddenly, the tab order began changing. Some dialogs presented a reverse tab-order and some a very puzzling tab-order.
I've checked my resources with the built-in resource-editor in VC, checked the .rc file, used an external viewer and the order looks like it's suppose to look, but my application decides to twist it.
What could cause this sort of behaviour ?
Where should I look for the causes of this problem ?
Is it possible that the dynamic creation of controls can cause this kind of behaviour ?
How are dynamically created controls treated with tab-ordering (I'm asking although my dynamic-controls do not have the WS_TABSTOP style) ?
I'm student and I'm doing my training course. I'm developing a software within Matlab environment.
the aim of my software is to synchronise 2 applications (video and graphs). I use an activeX to read my movies. my problem:
I want just to know how we can recuperate the callback of the play
button of the activeX AMOVIE.ActiveMovieControl.2 ???
this activeX allow to read an avifile with the command "play, pause,
any help will be appreciate,
thanks in advance
Last Visit: 31-Dec-99 18:00 Last Update: 24-Sep-16 20:57