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

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes



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