docs.microsoft 링크


public class TestWndProc : Form

{

    private const int WM_ACTIVATEAPP = 0x001C;

    bool appActive;


    protected override void WndProc(ref Message m)

    {

        // Listen for operating system messages.

        switch (m.Msg) {

            // The WM_ACTIVATEAPP message occurs when the application

            // becomes the active application or becomes inactive.

            case WM_ACTIVATEAPP:

                // The WParam value identifies what is occurring.

                appActive = (int)m.WParam != 0;

                // Invalidate to get new text painted.

                Invalidate();

                break;

        }

        base.WndProc(ref m);

    }

}

반응형