본문 바로가기

카테고리 없음

[User32.dll] 윈도우 위치 지정 하기



 
Created with colorer-take5 library. Type 'csharp'

using System;
using System.Windows;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;

namespace ProcessTEST
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        //user32.dll 을 임포트 한다
        [DllImport("user32.dll", SetLastError = true)]
        //MoveWindow 함수를 호출한다.
        internal static extern bool MoveWindow(IntPtr hwnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

        protected override void OnInitialized(EventArgs e)
        {
            //프로세스로 메모장을 열고 실행 한다
            Process proc = new Process();
            proc.StartInfo.FileName = "notepad.exe";
            proc.Start();

            //잠시 정지후에..
            Thread.Sleep(10);

            //위에서 실행시킨 프로세스의 윈도우 핸들을 얻는다.
            IntPtr id = proc.MainWindowHandle;
            //함수호출!
            MoveWindow(proc.MainWindowHandle, 2000, 0, 500, 500, true); 
            base.OnInitialized(e);
        }
    }
}

추가로 Process 에서 IntPtr 을 쉽게 얻을수 있는 아이디어,
  • 이전 댓글 더보기
  • BlogIcon Hollister Milano 2014.01.12 01:08

    고에Forbud mod brug af plast til udseende Gutka

    Forbud mod brug af plast til præsentation Gutka

    Sidste måned 2, havde Højesteret afslog at give mere tid til Center for lovens gennemførelse for at regulere brugen af ​​plastic til emballering cigaretter og tobaksvarer, og bad den om at meddele, at inden for to dage.

    Placering Minister Jairam Ramesh, Så igen, i dag sagde, at det er upraktisk og 우한

  • BlogIcon mbt scarpe outlet 2014.01.16 18:29

    니는How to Join a DCI Drum and Bugle Corps

    Basic overviewSo you play an instrument. You've seen/heard of/been a member of marching band, but want something bigger, and you're under 21. Where do you start?

    First of all, you have to decide which corps you want to audition for.

    You will also need to make sure the corps you want to be in accepts your gender. If you're a girl, don't try out for Ma런는

  • BlogIcon Ralph Lauren Nederland 2014.01.18 21:43

    리있Volkslauf obstacles not a problem

    But for the group of women who last week practiced scaling the "Stairway to Heaven," a giant, 35 foot tall ladder, it was clear the biggest obstacle is already behind them.

    Obstacle is a good metaphor for the 170 participants in the Total Woman Volkslauf training group who pulled on running shoes last July with only the slightest notion they might actually s에리

  • BlogIcon G Star Online Shop 2014.01.19 01:42

    데던les parents décrivent bas

    Un technicien de bombe d'application de la loi s'éloigne supra pas cher après la préparation de l'explosion contrôlée d'un objet suspect lors d'une recherche d'un suspect dans l'attentat du marathon de Boston, à Watertown, Massachusetts 19 Avril 2013. (Crédit: Lucas Jackson / Reuters)

    Makhachkala, Russie (AP) Les parents de Tamerlan Tsarnaev insisté dimanche qu'il e부하

  • BlogIcon hollister roma 2014.01.19 01:42

    가다Nike Shox Monster Vit Svart höst

    När Nike Shox Monster började att främja detta nya koncept, långsamt, skulle vissa människor överväga att gå till nattklubbar som en slags sport. Så de bar och tenderade att klä upp sporten. I denna tid, skulle försäljningen av Nike Shox Monster öka och detta är verkliga syftet för Nike Shox Monster.? Med tillräckligt många strategier, nästa har en serie av matc마메

  • BlogIcon mbt sko tilbud 2014.01.19 09:30

    관기Firebaugh California California hoteles

    A Bonanza Birding de su vehículo: Prados del Oeste del Condado de Merced

    Los Banos, CA (Excursiones Naturaleza) Aproveche esta oportunidad única para disfrutar de uno de los más importantes del Valle Central lugares de observación nike free de aves de nike air jordan su vehículo. Ver pastizales literalmente acudieron con gansos blancos, multitudes de p버일

  • BlogIcon nike free 2014.01.19 16:17

    뉴들Easton mand busted på narkotika

    Easton mand busted på narkotika

    Capt, en talsmand for, at man modtog et opkald fredag ​​fra lederen af ​​på Lake Avenue Extension om en hindring i en af ​​sine rooms.Wendel sagde politiet tvunget åbne døren og placeret kvinden, 39, fuldt påklædt, Siden, 53, Akin til Easton, Moderat påklædt. Wendel tilføjede, at har været flere små poser af kokain på en nat sta비는

  • BlogIcon 匿名 2014.07.28 02:11

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon 匿名 2014.08.19 14:26

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon 匿名 2014.09.11 12:19

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon moncler canada 2014.09.12 05:02

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon 匿名 2014.09.21 23:10

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon 匿名 2014.09.28 14:39

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon moncler sale usa 2014.09.29 17:11

    이용약관위배로 관리자 삭제된 댓글입니다.

  • BlogIcon moncler jackets mens 2014.09.29 17:11

    이용약관위배로 관리자 삭제된 댓글입니다.

  • 匿名 2015.01.07 17:46

    이용약관위배로 관리자 삭제된 댓글입니다.

  • 匿名 2015.02.06 14:13

    을정永恒之塔服务端传奇服务端密传-服务端QQ西游私服务端天堂1私服务端

    千年服务端蜀门服务端征途服务端机战服务端神泣服务端醉西游服务端

    天堂I服务端挑战OL服务端剑侠情缘-服务端奇侠XIAH服务端挑战服务端


    传世开私服一条龙服务-

    传奇开私服一条龙开区服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    魔兽世界sf开服一条龙服务-


    客服咨询QQ(企鹅扣扣)1285574370

    Email:1285574370@qq.com

    更多商业版本免费开放下载




    天恒科技1.95皓月终极12星座道士加强升级版



    天恒科技1.85荣耀必杀极限之地广寒宫泡点元素PK版



    天恒科技1.85无特戒无英雄轻中变魔神唯我独尊麻痹宝宝



    天恒科技独家1.85恶魔世界装备分身15转八钻靓装元素中变版일련

  • BlogIcon chemise homme burberry 2015.03.27 21:10

    마리l'empereur Qianlong, le Premier Ministre Zhou Enlai sauf polyvalent, Lucangyong ermite Sima de liaison. il a une vie aussi large de la politique de bienveillance et de médecine ou de la pharmacie. " mon "Zhang br Hall" Neuvième génération "Qijia art public, par ventilation, dans l'examen des services du droit pénal et ainsi de suite un traitement différent알이

  • BlogIcon trench burberry pas cher 2015.03.31 00:04

    서관URL aIci,trench burberry homme pas cher相关的主题文章:다런

  • 匿名 2015.04.08 09:20

    일단and even better news is that their greatest extent EVER!Beautiful flowers and fittings add a touch of tartan jackets that unmistakable feminine essence, while injections of red.



    Purple and orange make this the biggest ever range of colors.Barbour waxed jackets, Barbour International Quilt Jacket, Jackets Barbour Polar Quilt .


    Discounts are popular with all and sundry across the world n되료