Hello All, I am using a CListCtrl created in a dialog window. This CListCtrl displays thumbnail images. I want a notification when a user double clicks an image in list. The OnLButtonDblClk function only works when user double clicks in the dialog window. It does not catch the event when a user double clicks in the list control window, probably because the dialog treats list control as a separate window. Can anyone please let me know how do I write a event handler to to catch the event when an image in CListCtrl is double clicked. Thanks in advance for your reply. Abhijit Deshmukh
asdeshmukh
Posts
-
Event handler for double click in CListCtrl -
views in dialogHi, I have created a CWnd in a CPropertyPage. I want to display some drawing inside the CWnd. How can this be achieved? I tried the following approaches but did not succeed: 1) Tried creating CWnd object in the CPropertyPage class and then override the OnInit function to draw . I used the GetDC() to get the CDC and then the GetSafeHandle() function to get the HDC. I used this handle to render my drawing. The CWnd was created but the drawing is not displayed. 2) According to a suggestion from a colleague, I tried creating separate class for the CWnd object. This was to let me override the OnPaint function of the CWnd object. My code in OnPaint function is as follows: PAINTSTRUCT ps; CDC * dc = this->BeginPaint(&ps); //draw function takes in the CDC * dc obtained in fuction above draw(); this->EndPaint( &ps ); Then I created a object of this class in CPropertyPage class. I tried calling the create function in the constructor and OnCreate function of the property page. Here again I could at the most get my window displayed but no drawing. Any suggestions on how to achieve this? Also, does MFC basically support GDI in CWnd objects when created as child window of a dialog or property page? P.S. to make sure that the code to draw is working correctly, I tried testin that by having the rendering in a document using the view class. It works correctly i.e. I can get the display in a document window but cannot get it in dialog window or to be precise CWnd instance. Thanks in advance for your help. Regards, Abhijit Deshmukh
-
access data in dialog from win32 applicationHi, This question is related to win32 user interface programming. I need to use Single threaded runtime library and cannot use MFC. Thus I am using win32. I have designed a dialog that should take three float values as input. How do write the code to do data exchange so that values entered by the user are available to me in some local variable after the user has clicked "OK" on the dialog after entering some values. I can do this in MFC and but do not know how to do this using win32. I could create file open dialog using GetOpenFileName but did not find any similar function for writing data exchange code. Any help would be great as I am stuck and want to get this done asap. :) Thanks in advance for your help. Regards, Abhijit