Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JerzyPeter

@JerzyPeter
About
Posts
29
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Accessing methods/properties in the initial form...
    J JerzyPeter

    Or do this: MainContainer mc=(MainContainer)(this.theTopMenu.ParentForm) Then: mc.SomeMethod() mc.AnotherMethod() Jerzy

    C# visual-studio csharp com help question

  • Accessing methods/properties in the initial form...
    J JerzyPeter

    Just cast to you class: (MainContainer )(this.theTopMenu.ParentForm).SomeMethod() Jerzy

    C# visual-studio csharp com help question

  • Using OCX controls in .NET
    J JerzyPeter

    Agree, but what about using other OCXes, or using DLLs or unsafe code. Should we totally avoid using them and stick only with managed code? Jerzy

    .NET (Core and Framework) csharp com question

  • Using OCX controls in .NET
    J JerzyPeter

    MS Toolbar Control in mscomctl.ocx has a HotImageList property where as the .NET ToolBar doesn't. Are there any disadvantages or problems using the MS Toolbar Control, or any other COM Components and distributing the mscomctl.ocx with my .NET application? Jerzy

    .NET (Core and Framework) csharp com question

  • Using OCX controls in .NET
    J JerzyPeter

    MS Toolbar Control in mscomctl.ocx has a HotImageList property where as the .NET ToolBar doesn't. Are there any disadvantages or problems using the MS Toolbar Control, or any other COM Components and distributing the mscomctl.ocx with my .NET application? Jerzy

    C# csharp com question

  • Can I play MPEG in Video for Windows?
    J JerzyPeter

    Is there any way to play MPEG file in vfw (Video for Windows)? Jerzy

    C / C++ / MFC question

  • Can I play MPEG in Video for Windows?
    J JerzyPeter

    Is there any way to play MPEG file in VFW (Video for Windows)? Jerzy

    C / C++ / MFC question

  • How to get the width and height of a window? (MFC)
    J JerzyPeter

    CRect rect; GetWindowRect(&rect); int nWidth=rect.Width(); int nHeight=rect.Height(); Jerzy

    C / C++ / MFC c++ tutorial question

  • Adding Menus to Dialog Boxes
    J JerzyPeter

    Create a menu. Right-click on your dialog box. Select Properties. You will see Menu: combobox. Select ID of your menu. That's all Jerzy

    C / C++ / MFC c++ tutorial

  • How do I disable system menu buttons
    J JerzyPeter

    To disabled the maximize button do this in PreCreateWindow() BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { if( !CFrameWnd::PreCreateWindow(cs) ) return FALSE; // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style&=~WS_MAXIMIZEBOX; return TRUE; } To disable system menu do this: cs.style&=~WS_SYSMENU; Jerzy

    C / C++ / MFC question

  • About SDK programming
    J JerzyPeter

    Use this line: #define _WIN32_WINNT 0x0500 Should work, Jerzy

    C / C++ / MFC help c++

  • Autocomplete
    J JerzyPeter

    I think it's enough to delete XXX.ncb file Jerzy

    C / C++ / MFC help question

  • Scroll Bars
    J JerzyPeter

    m_List.SetExtendedStyle(m_List.GetExtendedStyle()|LVS_EX_FLATSB); Jerzy

    C / C++ / MFC tutorial question

  • Adding CStatic Icon to a dialog box
    J JerzyPeter

    Add CStatic myStatic in your class. In OnInitDialog(): myStatic.Create(_T("my static"), WS_CHILD|WS_VISIBLE|SS_ICON|SS_CENTERIMAGE, CRect(10,10,150,50), this); myStatic.SetIcon(::LoadIcon(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_QUESTION)));

    C / C++ / MFC question

  • Adding CStatic Icon to a dialog box
    J JerzyPeter

    You can do that this way: 1. Insert a picture control on your Dialog. 2. In properties of this control enter Type: Icon and Image: IDI_QUESTION. Jerzy

    C / C++ / MFC question

  • Change background color of Static control
    J JerzyPeter

    Why creating a brush doesn't accept high colors (only pure 16 colors)? This will create a red brush: m_rcBackColor=RGB(255,0,0); Cbrush br(m_rcBackColor); or br.CreateSolidBrush(m_rcBackColor); But this will create a gray brush: m_rcBackColor=RGB(254,0,0); Cbrush br(m_rcBackColor); A high color is changed to the closest pure color. I'm trying to put some text (as Static Control) on the main window and I want the text to have the same background as the window. If window has a pure color like white, or gray, or red, there's no problem. But if my window has a background set to, let's say, RGB(255,0,100), the text is displayed in gray background. Static control uses, by default, color of Dialog's background. Any ideas? Jerzy.

    C / C++ / MFC help question

  • How to dynamically modify menu in MDI app
    J JerzyPeter

    Hi Tomek, Thank you very much for this tip. It works. I had to only call DrawMenuBar() to refresh the menu. Without this call the menu was updated only when the mouse was over the menu. (This is only when the application starts). When all documents were closed and then I opened a new one the menu was shown correctly. Dziekuje, Jerzy :)

    C / C++ / MFC tutorial question

  • How to dynamically modify menu in MDI app
    J JerzyPeter

    Hi Tomek, Thanks for the solution. It works - it ataches a new popup to IDR_XXXTYPE menu. But the problem is that I don't know where this code should be placed. If I put it in OnCrete() of ChildFrm, then the new popup is atached as many times as ChildFrm frames were created. MSDN says something that this menu is loaded during the construction of the document templates. Can I override this? Thanks for any suggestions. Jerzy

    C / C++ / MFC tutorial question

  • How to dynamically modify menu in MDI app
    J JerzyPeter

    Hi, I don't know what you mean to use GetSubMenu()? This code is working, it ataches a new popup to the main menu. The problem is that it ataches this submenu to the IDR_MAINFRAME menu (after main frame is created). I need to do the same for IDR_VIEWTYPE menu. I don't know in what moment that menu is created. If I use this code in that moment, the new popup would be attached to IDR_VIEWTYPE menu. Jerzy

    C / C++ / MFC tutorial question

  • How to dynamically modify menu in MDI app
    J JerzyPeter

    Hello everybody! I´m writing a MDI app. Application Wizard generates two menus: One (IDR_MAINFRAME), which is displayed when no document is open, the other (IDR_XXXTYPE) when there is at least one document opened. This code below (from CMainFrame::OnCreate) modifies the first menu. I want to do the same modification to the other menu. How to do that? Thank you for any comments. Jerzy CMenu PopupMenu; PopupMenu.CreateMenu(); for(int i=0;i<3;i++) { CString str; str.Format("Item %d",i); PopupMenu.AppendMenu(MF_STRING,IDM_ITEM+i,str) ; } CMenu *m=GetMenu(); m->AppendMenu(MF_POPUP¦MF_STRING,(UINT)PopupMenu.m_hMenu,"&Items"); PopupMenu.Detach();

    C / C++ / MFC tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups