Click here to Skip to main content
15,887,436 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to get icon from other applications Pin
ThatsAlok5-Jun-06 23:22
ThatsAlok5-Jun-06 23:22 
QuestionMFC Excel charts with VC++ Pin
BuckBrown5-Jun-06 11:00
BuckBrown5-Jun-06 11:00 
AnswerRe: MFC Excel charts with VC++ Pin
BuckBrown6-Jun-06 12:02
BuckBrown6-Jun-06 12:02 
Questioncode for display multiple waveform in multiple channels of the same time base [modified] Pin
mrby1235-Jun-06 10:50
mrby1235-Jun-06 10:50 
QuestionMsn Messenger Pin
YaronNir5-Jun-06 10:39
YaronNir5-Jun-06 10:39 
AnswerRe: Msn Messenger Pin
ThatsAlok5-Jun-06 23:18
ThatsAlok5-Jun-06 23:18 
QuestionVS 2005 and GDI+ Pin
Van Court5-Jun-06 9:57
Van Court5-Jun-06 9:57 
AnswerRe: VS 2005 and GDI+ Pin
uusheikh5-Jun-06 17:59
uusheikh5-Jun-06 17:59 
There are a lot of examples of GDI+ in MSDN Visual Studio 2005. Try looking there.
Here's an example i took,

#define UNICODE<br />
#include <windows.h><br />
#include <gdiplus.h><br />
using namespace Gdiplus;<br />
<br />
VOID OnPaint(HDC hdc)<br />
{<br />
   Graphics graphics(hdc);<br />
   Pen      pen(Color(255, 0, 0, 255));<br />
   graphics.DrawLine(&pen, 0, 0, 200, 100);<br />
}<br />
<br />
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);<br />
<br />
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)<br />
{<br />
   HWND                hWnd;<br />
   MSG                 msg;<br />
   WNDCLASS            wndClass;<br />
   GdiplusStartupInput gdiplusStartupInput;<br />
   ULONG_PTR           gdiplusToken;<br />
   <br />
   // Initialize GDI+.<br />
   GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);<br />
   <br />
   wndClass.style          = CS_HREDRAW | CS_VREDRAW;<br />
   wndClass.lpfnWndProc    = WndProc;<br />
   wndClass.cbClsExtra     = 0;<br />
   wndClass.cbWndExtra     = 0;<br />
   wndClass.hInstance      = hInstance;<br />
   wndClass.hIcon          = LoadIcon(NULL, IDI_APPLICATION);<br />
   wndClass.hCursor        = LoadCursor(NULL, IDC_ARROW);<br />
   wndClass.hbrBackground  = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
   wndClass.lpszMenuName   = NULL;<br />
   wndClass.lpszClassName  = TEXT("GettingStarted");<br />
   <br />
   RegisterClass(&wndClass);<br />
   <br />
   hWnd = CreateWindow(<br />
      TEXT("GettingStarted"),   // window class name<br />
      TEXT("Getting Started"),  // window caption<br />
      WS_OVERLAPPEDWINDOW,      // window style<br />
      CW_USEDEFAULT,            // initial x position<br />
      CW_USEDEFAULT,            // initial y position<br />
      CW_USEDEFAULT,            // initial x size<br />
      CW_USEDEFAULT,            // initial y size<br />
      NULL,                     // parent window handle<br />
      NULL,                     // window menu handle<br />
      hInstance,                // program instance handle<br />
      NULL);                    // creation parameters<br />
	  <br />
   ShowWindow(hWnd, iCmdShow);<br />
   UpdateWindow(hWnd);<br />
   <br />
   while(GetMessage(&msg, NULL, 0, 0))<br />
   {<br />
      TranslateMessage(&msg);<br />
      DispatchMessage(&msg);<br />
   }<br />
   <br />
   GdiplusShutdown(gdiplusToken);<br />
   return msg.wParam;<br />
}  // WinMain<br />
<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, <br />
   WPARAM wParam, LPARAM lParam)<br />
{<br />
   HDC          hdc;<br />
   PAINTSTRUCT  ps;<br />
   <br />
   switch(message)<br />
   {<br />
   case WM_PAINT:<br />
      hdc = BeginPaint(hWnd, &ps);<br />
      OnPaint(hdc);<br />
      EndPaint(hWnd, &ps);<br />
      return 0;<br />
   case WM_DESTROY:<br />
      PostQuitMessage(0);<br />
      return 0;<br />
   default:<br />
      return DefWindowProc(hWnd, message, wParam, lParam);<br />
   }<br />
} // WndProc

GeneralRe: VS 2005 and GDI+ Pin
Van Court6-Jun-06 10:32
Van Court6-Jun-06 10:32 
QuestionInterview Questions ... Please Answer! [modified] Pin
AryaSoft5-Jun-06 9:49
AryaSoft5-Jun-06 9:49 
AnswerRe: Interview Questions ... Please Answer! Pin
Chris Losinger5-Jun-06 10:14
professionalChris Losinger5-Jun-06 10:14 
GeneralRe: Interview Questions ... Please Answer! [modified] Pin
AryaSoft5-Jun-06 10:37
AryaSoft5-Jun-06 10:37 
GeneralRe: Interview Questions ... Please Answer! [modified] Pin
Zac Howland5-Jun-06 10:45
Zac Howland5-Jun-06 10:45 
AnswerRe: Interview Questions ... Please Answer! Pin
Zac Howland5-Jun-06 10:21
Zac Howland5-Jun-06 10:21 
AnswerRe: Interview Questions ... Please Answer! Pin
ThatsAlok5-Jun-06 23:11
ThatsAlok5-Jun-06 23:11 
GeneralRe: Interview Questions ... Please Answer! Pin
AryaSoft7-Jun-06 11:24
AryaSoft7-Jun-06 11:24 
Questionstatus bar Pin
LCI5-Jun-06 8:57
LCI5-Jun-06 8:57 
AnswerRe: status bar Pin
led mike5-Jun-06 9:18
led mike5-Jun-06 9:18 
AnswerRe: status bar Pin
Zac Howland5-Jun-06 9:25
Zac Howland5-Jun-06 9:25 
QuestionTrackPopupMenu() blocks message engine Pin
LeeeNN5-Jun-06 8:50
LeeeNN5-Jun-06 8:50 
AnswerRe: TrackPopupMenu() blocks message engine Pin
Zac Howland5-Jun-06 9:14
Zac Howland5-Jun-06 9:14 
GeneralI did not make myself clear? Pin
LeeeNN5-Jun-06 9:20
LeeeNN5-Jun-06 9:20 
GeneralRe: I did not make myself clear? Pin
Zac Howland5-Jun-06 9:29
Zac Howland5-Jun-06 9:29 
GeneralRe: I did not make myself clear? Pin
LeeeNN5-Jun-06 9:43
LeeeNN5-Jun-06 9:43 
GeneralRe: I did not make myself clear? Pin
Zac Howland5-Jun-06 10:11
Zac Howland5-Jun-06 10:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.