Exemplo n.º 1
0
        private void btnTopLevelForm_Click(object sender, EventArgs e)
        {
            DPIContextBlock context = new DPIContextBlock(GetSelectedDpiAwarenessContext());
            Form            f1      = new TopLevelWinForm(cboTemplate.Text);

            f1.Show();
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DPIContextBlock context = new DPIContextBlock(GetSelectedDpiAwarenessContext());
            TempForm        frm     = new TempForm();

            frm.Show();
        }
Exemplo n.º 3
0
        private string HwndInfoString(IntPtr hWnd)
        {
            RECT rSA;
            RECT rPMA;

            {
                DPIContextBlock saBlock = new DPIContextBlock(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
                rSA = DPIHelper.GetWindowRectangle(hWnd);
            }
            {
                DPIContextBlock saBlock = new DPIContextBlock(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
                rPMA = DPIHelper.GetWindowRectangle(hWnd);
            }

            return(String.Format("SA: {0}, {1} PMA: {2}, {3}",
                                 (rSA.right - rSA.left).ToString(),
                                 (rSA.bottom - rSA.top).ToString(),
                                 (rPMA.right - rPMA.left).ToString(),
                                 (rPMA.bottom - rPMA.top).ToString()));
        }
        private string HwndInfoString(IntPtr hWnd)
        {
            RECT rSA;
            RECT rPMA;

            {
                DPIContextBlock saBlock = new DPIContextBlock(DPI_AWARENESS_CONTEXT_SYSTEM_AWARE);
                rSA = GetWindowRectangle(hWnd);
            }
            {
                DPIContextBlock pmaBlock = new DPIContextBlock(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE);
                rPMA = GetWindowRectangle(hWnd);
            }

            return(String.Format("SA: {0}, {1} PMA: {2}, {3}",
                                 rSA.Width.ToString(),
                                 rSA.Height.ToString(),
                                 rPMA.Width.ToString(),
                                 rPMA.Height.ToString()));
        }