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
  1. Home
  2. General Programming
  3. Visual Studio
  4. MSVC 2003 GUI Help

MSVC 2003 GUI Help

Scheduled Pinned Locked Moved Visual Studio
csharpvisual-studiohelpc++graphics
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    c code101
    wrote on last edited by
    #1

    Hello, I'm very new to programming but have learned allot over the past few months. Here's my problem. I have a program that I'm working on. It's written in C not C++ and it is GDI based. I'm using MS Visual Studio 2003. I have the ability to edit everything that is in the .rc file under the project such as dialogs, menus and ext. What I don't have the ability to edit is the items below the menu such as the pens and other visual designs that are contained within the main window of the program. It's not like VB or C# where you can just edit the main window from the IDE. I have no ability whatsoever to change the overall visual design or feel of the main body of the program other than manual editing of the code, for example: // draw check box // We select the brown pen anyway to make sure we have a valid value // for hOldPen for later calls to SelectObject() hOldPen = SelectObject( hDC, lpe->hBlackPen ); if ( !lpe->tracks[i].bData ) { pts[0].x = pts[3].x = pts[3].x = ((hx[1]+1)/2 - 4) - lpe->dx; pts[1].x = pts[2].x = pts[0].x + 12; pts[0].y = pts[1].y = pts[4].y = rc.top + 1; pts[2].y = pts[3].y = rc.top + 13; Polyline( hDC, pts, 5 ); } if ( lpe->tracks[i].bChecked && !lpe->tracks[i].bData ) { SelectObject( hDC, lpe->hBlackPen ); pts[0].x += 3; pts[0].y += 3; pts[1].x = pts[0].x + 2; pts[1].y = pts[0].y + 3; pts[2].x = pts[1].x + 8; pts[2].y = pts[1].y - 8; Polyline( hDC, pts, 4 ); pts[0].x += 1; pts[1].x = pts[0].x + 2; pts[1].y = pts[0].y + 3; pts[2].x = pts[1].x + 8; pts[2].y = pts[1].y - 8; Polyline( hDC, pts, 4 ); } SelectObject( hDC, hOldPen ); } SetBkMode( hDC, oldBkMode ); SelectObject( hDC, hOldFont ); EndPaint( hWnd, &p ); } The code above is for displaying a simple checkbox for selecting items displayed within the main window. I have been able to modify the code to an extent but it takes allot off time and pulling out of hair Really what I would like to do is be able to change these things at least as easy as I can make changes in the .rc file under the MSVC resource editor. There has to be an easier way to make changes or additions besides what I'm now doing. Unfortionally, I'm not the original author of this program so I don't know what editor they used to compose the GUI. Better yet, I would like to spice up my main window from the generic look it has now to something better as well as be able to add to it. Are there any libraries out there that would easily integrate into this GDI application? I really like the new Office 2003 look and feel.

    D 1 Reply Last reply
    0
    • C c code101

      Hello, I'm very new to programming but have learned allot over the past few months. Here's my problem. I have a program that I'm working on. It's written in C not C++ and it is GDI based. I'm using MS Visual Studio 2003. I have the ability to edit everything that is in the .rc file under the project such as dialogs, menus and ext. What I don't have the ability to edit is the items below the menu such as the pens and other visual designs that are contained within the main window of the program. It's not like VB or C# where you can just edit the main window from the IDE. I have no ability whatsoever to change the overall visual design or feel of the main body of the program other than manual editing of the code, for example: // draw check box // We select the brown pen anyway to make sure we have a valid value // for hOldPen for later calls to SelectObject() hOldPen = SelectObject( hDC, lpe->hBlackPen ); if ( !lpe->tracks[i].bData ) { pts[0].x = pts[3].x = pts[3].x = ((hx[1]+1)/2 - 4) - lpe->dx; pts[1].x = pts[2].x = pts[0].x + 12; pts[0].y = pts[1].y = pts[4].y = rc.top + 1; pts[2].y = pts[3].y = rc.top + 13; Polyline( hDC, pts, 5 ); } if ( lpe->tracks[i].bChecked && !lpe->tracks[i].bData ) { SelectObject( hDC, lpe->hBlackPen ); pts[0].x += 3; pts[0].y += 3; pts[1].x = pts[0].x + 2; pts[1].y = pts[0].y + 3; pts[2].x = pts[1].x + 8; pts[2].y = pts[1].y - 8; Polyline( hDC, pts, 4 ); pts[0].x += 1; pts[1].x = pts[0].x + 2; pts[1].y = pts[0].y + 3; pts[2].x = pts[1].x + 8; pts[2].y = pts[1].y - 8; Polyline( hDC, pts, 4 ); } SelectObject( hDC, hOldPen ); } SetBkMode( hDC, oldBkMode ); SelectObject( hDC, hOldFont ); EndPaint( hWnd, &p ); } The code above is for displaying a simple checkbox for selecting items displayed within the main window. I have been able to modify the code to an extent but it takes allot off time and pulling out of hair Really what I would like to do is be able to change these things at least as easy as I can make changes in the .rc file under the MSVC resource editor. There has to be an easier way to make changes or additions besides what I'm now doing. Unfortionally, I'm not the original author of this program so I don't know what editor they used to compose the GUI. Better yet, I would like to spice up my main window from the generic look it has now to something better as well as be able to add to it. Are there any libraries out there that would easily integrate into this GDI application? I really like the new Office 2003 look and feel.

      D Offline
      D Offline
      Don Clugston
      wrote on last edited by
      #2

      You can only edit the GUI using the IDE if it is a dialog box. (C# and VB use Forms which are basically dialog boxes as well). If it is a plain window, everything has to be drawn from scratch -- or you can create child windows. The code you've shown is very strange. I haven't seen that sort of thing for more than a decade. You would not normally program Windows that way, even with raw SDK programming. You'd normally create a checkbox as a child window. My guess is that it's a DOS program which was ported to Windows, that didn't take advantage of Windows features. Sounds like a maintenance nightmare. You have my sympathy. -Don.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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