Quantcast
Channel: SendMessage
Viewing all articles
Browse latest Browse all 10

SendMessage

$
0
0

Hi Igor
I have got one more question. The program consists of two windows, main window
in the background and sub window in the foreground initially. When I tap on
the main window in the background, it brings it to the foreground. This gets
EN_UPDATE, EN_CHANGE, and EN_SETFOCUS sent away in [Q 1]. But I don't see
WM_PAINT sent away three times in [Q2], but just once (the subwindow appears
to have received the message three times though). Is it normal?
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Function for our Sub Window Proc
LRESULT CALLBACK SubWindowPro(HWND _hWnd, unsigned int _unMsg, WPARAM _wParam, LPARAM _lParam)
{
    static int x=0;

    switch (_unMsg)
    {
    case WM_DESTROY:
        PostQuitMessage(0);
        return 0;
 //default:
[Q1]case WM_LBUTTONUP://Tap on the touchpad on the dialogue window.
 {cout<<"I am the king in Subwindow: "<<king<<" queen: "<<queen<<"\n";      x=x+10;
        cout<<"x = "<<x<<"\n";
[Q2] InvalidateRect(_hWnd,NULL,FALSE);//Sends WM_PAINT when the update region is not empty &
                                //there are no other messages in the app queue for that window.
                                //The update region is the portion of the window's client
                                //area that must be redrawn.

         }
         return 0;
 
[Q 3] case WM_PAINT:
        {  cout<<"chong king in WM_PAINT: "<<king<<" queen: "<<queen<<"\n";
     cout<<"(LOWORD) "<<LOWORD(_wParam)<<"\n";
   PAINTSTRUCT ps;
   HDC hdc;

      if (x<1){ps.rcPaint.left=(LONG)100;ps.rcPaint.top=(LONG)600;ps.rcPaint.right=(LONG)700;
                  ps.rcPaint.bottom=(LONG)10;}
       hdc= BeginPaint(_hWnd, &ps);//BeginPaint() works only in WM_PAINT handler.
       FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+x));//Fills the rectangle in
                               //COLOR_WINDOW++x. Comment this & see the differernce.
                        //Uncommented, it is the same as 'InvalidateRect(_hWnd,NULL,TRUE)'.
       TextOut(hdc, x ,x , L"2nd console", wcslen(L"2nd console"));
       TextOut(hdc, x+100 ,x+100 , L"Chong is completed", wcslen(L"Chong is completed"));
       EndPaint(_hWnd, &ps);
          return 0;}
     case IDOK:// cout<<"Chong\n";

     return 0;
    }
    return DefWindowProc(_hWnd, _unMsg, _wParam, _lParam);
}


Regards
Chong


Viewing all articles
Browse latest Browse all 10

Latest Images

Vimeo 11.10.1 by Vimeo.com, Inc.

Vimeo 11.10.1 by Vimeo.com, Inc.

Doodle Jump 3.11.36 by Lima Sky LLC

Doodle Jump 3.11.36 by Lima Sky LLC

CHECKPOINT RULES

CHECKPOINT RULES

Trending Articles


Vimeo 11.5.1 by Vimeo.com, Inc.


PreSonus FireBox - handly interfaccia


Top 100 Tagalog Love Quotes Collections Online


Top 2014 Tagalog Love Quotes


Papa Jack Tagalog Love Quotes and Advice for you


Re: lwIP PIC32 port - new title : CycloneTCP a new open source stack for...


Vimeo 3.17.0 by Vimeo Inc


Vimeo 3.21.0 by Vimeo Inc


Vimeo 11.8.2 by Vimeo.com, Inc.


Vimeo 11.9.2 by Vimeo.com, Inc.


Vimeo 11.7.0 by Vimeo.com, Inc.


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Long Distance Relationship Tagalog Love Quotes


Tagalog Broken Heart Quotes


Vimeo 3.16.0 by Vimeo Inc


FORECLOSURE OF REAL ESTATE MORTGAGE


Vimeo 11.6.1 by Vimeo.com, Inc.


Vimeo 11.9.1 by Vimeo.com, Inc.


Vimeo 11.9.3 by Vimeo.com, Inc.



Latest Images

Vimeo 11.10.1 by Vimeo.com, Inc.

Vimeo 11.10.1 by Vimeo.com, Inc.

Doodle Jump 3.11.36 by Lima Sky LLC

Doodle Jump 3.11.36 by Lima Sky LLC

CHECKPOINT RULES

CHECKPOINT RULES

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>