|
-
April 3rd, 2005, 07:10 PM
#1
button press recognized when window moved
when I click on the title bar and drage my window to a new location, once it left go of the mouse buton it thinks I've hit the sutek button:
Code:
long FAR PASCAL WndProc (HWND myhwnd, UINT message, WPARAM wParam, LPARAM lParam)//Message Handling
{
switch (message)
{
case WM_CHAR:
if (wParam == 27)
PostQuitMessage(0);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
if((LOWORD(wParam) == StopB)&&(message == BN_SETFOCUS))
windowswitch = 0;
switch (LOWORD(wParam))
{
case CancelB://if wParam is == button then the button associated was clicked
PostQuitMessage(0);
break;
case AdverB:
if(windowswitch!=1)
windowswitch = 1;
break;
case BankB:
if(windowswitch!=2)
windowswitch = 2;
break;
case BlockB:
if(windowswitch!=3)
windowswitch = 3;
break;
case SutekB:
if(windowswitch!=4)
windowswitch = 4;
break;
case StopB:
DestroyWindow(H);
windowswitch = 0;
break;
}
return(DefWindowProc(myhwnd,message,wParam,lParam));
}
In C, you merely shoot yourself in the foot.
In C++, you accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical care is impossible, because you can't tell which are bitwise copies and which are just pointing at others and saying, "That's me, over there."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|