1 / 8

Presentation On

Presentation On. Visual C ++ Programming Presented To: Ma’am Sadaf Sial Presented By: Muhammad Shoaib Shera Roll No#08-05 Bs(I T) 5 th Semester Deptt Of Information Technology

Download Presentation

Presentation On

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PresentationOn Visual C ++ Programming Presented To: Ma’am SadafSial Presented By: Muhammad ShoaibShera Roll No#08-05 Bs(I T) 5th Semester Deptt Of Information Technology B Z University Multan

  2. Program No#09 How can I check which element (like say, Title bar, Close button, Menu bar, Maximize button, System menu, Scroll bar, etc.) of the nonclient area has been clicked? #include<afxwin.h> #include resource.h Class myframe : public CFrameWnd { Public: myframe() { Create(0,”A HittsetExample”,WS_OVERLAPPEDWINDOW] WS_HSCROLL| WS_VSCROLL,rectDefault, 0, MAKEINTRESOURCE (IDR_MENU1)); } Void OnLButtonDown (UNIT flag,Cpoint Pt) { MessageBox(“This is Client area”, “HITTEST”); } Void OnNcLButtonDown (UNIT hittest,Cpoint pt)

  3. Switch (hittest) { Case HTCAPTION: MessageBox (“This is caption bar”, ”HITTEST”); Break; Case HTCLOSE: MessageBox(“This is Close button”, “HITTEST”); DestoryWindow(); Break; Case HTGROWBOX: MessageBox(“This is Restore button”, “HITTEST”); Break; Case HTHSCROLL: MessageBox(“This is horizontal Scroll bar”, “HITTEST”); Braek; Case HTMENU: MessageBox(“This is Menu”, “HITTEST”); Break; Case HTREDUCE: MessageBox(“This is Minimize button”, “HITTEST”); Break; Case HTSYSMENU:

  4. MessageBox(“This is System menu”, “HITTEST”); Break; Case HTVSCROLL: MessageBox (“This is Vertical Scroll bar”, “HITTEST”); Break; Case HTZOOM: MessageBox (“This is Maximize button”, ”HITTEST”); Break; Case HTTOP: MessageBox(“This is Top Border”, “HITTEST”); Break; Case HTBOTTOM: MessageBox(“This is Button Border”, “HITTEST”); Break; Case HTLEFT: MessageBox (“This is Left Border”, “HITTST”); Break; Case HTRIGHT: MessageBox (“This is Right Border”, “HITTEST”); Break; } } DECLARE_MESSAGE_MAP() };

  5. BEGIN_MESSAGE_MAP (“myframe, CframeWnd”) ON_WM_LBUTTONDOWN() ON_WM_NCLBUTTONDOWN() END_MESSAGE_MAP() Class myapp : public CWinApp { Public : Int Intlnstance() { Myframe*p; P=new myframe; P->ShowWindow(1); m_pMainWnd=p; Return 1; } }; Myapp a;

  6. Program No# 10 How do I close an application if the user clicks twice on the caption bar? #include<afxwin.h> Class myframe : public CframeWnd { Public: myframe() { Create (0,”DoubleClick on The Caption Window”); } Switch (hittest) { Case HTCAPTION:

  7. DestroyWindow(); } Countinue……………………………….

  8. The End

More Related