Click here to Skip to main content
15,908,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Error in put_text Pin
Mike Dimmick6-Feb-05 23:29
Mike Dimmick6-Feb-05 23:29 
GeneralDifferent fonts in CTreeView Pin
bilas6-Feb-05 23:16
bilas6-Feb-05 23:16 
GeneralRe: Different fonts in CTreeView Pin
Mike Dimmick6-Feb-05 23:23
Mike Dimmick6-Feb-05 23:23 
GeneralRe: Different fonts in CTreeView Pin
bilas6-Feb-05 23:33
bilas6-Feb-05 23:33 
GeneralRe: Different fonts in CTreeView Pin
bilas7-Feb-05 0:40
bilas7-Feb-05 0:40 
GeneralCreateWindow fails Pin
Member 14932146-Feb-05 23:01
Member 14932146-Feb-05 23:01 
GeneralRe: CreateWindow fails Pin
ThatsAlok6-Feb-05 23:19
ThatsAlok6-Feb-05 23:19 
GeneralRe: CreateWindow fails Pin
Member 14932147-Feb-05 0:35
Member 14932147-Feb-05 0:35 
I have 2 File
CreateWindow.cpp (Containing MainWndProc,WinMain & HelpDialogProc)
The Second File(Main.cpp) Contains Main::Main ( The Construtor) and a Reference to MainWndProc

MainWndProc --- (CreateWindow.Cpp)
LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
the_app->update_HWND(hWnd);
RECT rec;
POINTS ClientA;
POINTS ClientZ;
HDC hdc = GetDC(hWnd);
PAINTSTRUCT ps;
int rval;
static std::list<points> _pts;
list <points> :: iterator p;

switch (msg)
{
case WM_DESTROY:
the_app -> Destroy();
break;
case WM_LBUTTONDOWN:
ClientA = MAKEPOINTS(lParam);
_pts.push_back(ClientA);
MoveToEx(hdc,ClientA.x,ClientA.y,NULL);
break;
case WM_MOUSEMOVE:
if (wParam & MK_LBUTTON)
{
ClientZ = MAKEPOINTS(lParam);
p = _pts.end();
p--;
if ((p->x > 0) && (p->y) > 0)
LineTo(hdc,ClientZ.x,ClientZ.y);
else
MoveToEx(hdc,ClientZ.x,ClientZ.y,NULL);
_pts.push_back(ClientZ);

}
// Track Mouse Event. THis has been parenthsized because the c++ doesn't allow any declaration within teh case
{
TRACKMOUSEEVENT tme;
tme.cbSize = sizeof(TRACKMOUSEEVENT);
tme.dwFlags = TME_LEAVE;
tme.hwndTrack = hWnd;
tme.dwHoverTime = HOVER_DEFAULT;
TrackMouseEvent(&tme);
}
break;
case WM_MOUSELEAVE:
case WM_LBUTTONUP:
POINTS tmp;
tmp.x = 0;
tmp.y = 0;
_pts.push_back(tmp);
break;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_FILE_EXIT:
MessageBox(NULL,"You are exitting","Ganesha",MB_OK);
DestroyWindow(hWnd);
break;
case ID_HELP_SHOW:
if (!IsWindow(hHelpDialog))
{

hHelpDialog = CreateDialog(the_app->hInstance,"Dialog1",hWnd,HelpDialogProc); // HelpDialogProc is another Proc
ShowWindow(hHelpDialog, SW_SHOW);
}
break;
}
break;
case WM_PAINT:
{
int flag = 0;
hdc = BeginPaint(hWnd,&ps);
for (p = _pts.begin();p != _pts.end();p++)
{
if (p->x > 0 && p->y > 0)
{
if (flag){
LineTo(hdc,p->x,p->y);
}
else
{
MoveToEx(hdc,p->x,p->y,NULL);
}
flag = 1;
}
else
{
flag = 0;
}

}
EndPaint(hWnd,&ps);
break;
}
default:
return DefWindowProc( hWnd, msg, wParam, lParam );
}
return 0;

}
GeneralUpdateCommandUI problem Pin
Ro_land6-Feb-05 22:38
Ro_land6-Feb-05 22:38 
GeneralRe: UpdateCommandUI problem Pin
Roger Allen7-Feb-05 3:59
Roger Allen7-Feb-05 3:59 
GeneralRe: UpdateCommandUI problem Pin
Ro_land7-Feb-05 19:00
Ro_land7-Feb-05 19:00 
GeneralLSP Problem Pin
X20406-Feb-05 21:32
X20406-Feb-05 21:32 
GeneraljosephSDK Listview Pin
tijo_joseph@rediffmail.com6-Feb-05 21:31
susstijo_joseph@rediffmail.com6-Feb-05 21:31 
Generalport on/off checking after my program is slow Pin
vc-programmer-6-Feb-05 21:06
vc-programmer-6-Feb-05 21:06 
GeneralRe: port on/off checking after my program is slow Pin
Tom Wright7-Feb-05 11:43
Tom Wright7-Feb-05 11:43 
GeneralRe: port on/off checking after my program is slow Pin
vc-programmer-7-Feb-05 16:12
vc-programmer-7-Feb-05 16:12 
GeneralRe: port on/off checking after my program is slow Pin
Rick Crone9-Feb-05 11:12
Rick Crone9-Feb-05 11:12 
GeneralRe: port on/off checking after my program is slow Pin
vc-programmer-9-Feb-05 20:43
vc-programmer-9-Feb-05 20:43 
GeneralXML creation in vc++ using MSXML Pin
cj_rahul6-Feb-05 20:19
cj_rahul6-Feb-05 20:19 
GeneralRe: XML creation in vc++ using MSXML Pin
ThatsAlok6-Feb-05 20:43
ThatsAlok6-Feb-05 20:43 
General[Q] ActiveX -&gt; MFC control... Pin
rbid6-Feb-05 19:33
rbid6-Feb-05 19:33 
QuestionHow to add Modes in Display setings on windows98 Pin
Anonymous6-Feb-05 18:26
Anonymous6-Feb-05 18:26 
GeneralOpen with... Pin
Anonymous6-Feb-05 17:49
Anonymous6-Feb-05 17:49 
GeneralRe: Open with... Pin
2249176-Feb-05 18:20
2249176-Feb-05 18:20 
GeneralCCommandLineInfo cmdInfo; Pin
Member 9009876-Feb-05 16:12
Member 9009876-Feb-05 16:12 

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.