article search result of 'WPF' : 2

  1. 2011.02.01 [XNA , WPF] XNA 에서 코드레벨로 WPF 생성하기 (165)
  2. 2011.01.25 [Shell32.DLL] *.LNK , *.URL 분석하기 (84)

[XNA , WPF] XNA 에서 코드레벨로 WPF 생성하기




필요한 레퍼런스는
 
System.Windows.Presentaion
System.Xaml
PresentationCore
PresentationFramework

이고  필요한 using 은

using System.Threading;
using System.Windows;
using System.Windows.Controls;

되겠다.


Created with colorer-take5 library. Type 'csharp'
XNA , Game1.cs 중 일부

        Texture2D tex;
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            tex = Content.Load<Texture2D>("logo2");
            this.Window.Title = "currentThread :" + Thread.CurrentThread.ManagedThreadId;
            
            //[0] 새로운 wpf 어플을 생성하기 위해 새로운 스레드 생성 , 스레트타입은 STA
            Thread t = new Thread(startThread);
            t.ApartmentState = ApartmentState.STA;
            t.Start();
        }
        void startThread()
        {
            //[1] Application 객체를 선언하고 생성
            Application app = new Application();
            //[2] StartUp 이벤트를 건다.
            app.Startup += new StartupEventHandler(app_Startup);
            //[3] 그리고 시작!
            app.Run();
        }

        void app_Startup(object sender, StartupEventArgs e)
        {
            //[4] 새로운 윈도우를 생성한다
            Window win = new Window();
            win.Width = 300;
            win.Height = 300;
            win.Title = "currentThread :" + Thread.CurrentThread.ManagedThreadId;
            //[5] 새로운 윈도우를 표시한다
            win.Show();

            Button bt = new Button();
            bt.Content = "XNA 에서 WPF 생성��기";
            win.Content = bt;
        }

역시나 윈도우폼과 마찮가지로 STA 타입의 스레드가 필요하다.
그러나 윈폼과 Application 의 사용법이 다른점에 주의! (그냥 Application.Run 하면 안된다.)

또한 닷넷4.0의 경우 System.Xaml 을 필히 참조 시켜줘야 겠다. 
Yamecoder 야매코더_
XNA 2011. 2. 1. 16:03

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon cheap mont blanc pens 2015.01.09 03:41  수정/삭제  댓글쓰기

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

  3. BlogIcon furla purses outlet 2015.01.09 06:45  수정/삭제  댓글쓰기

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

  4. 匿名 2015.01.14 18:27  수정/삭제  댓글쓰기

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

  5. 匿名 2015.01.14 18:29  수정/삭제  댓글쓰기

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

  6. 匿名 2015.01.15 12:22  수정/삭제  댓글쓰기

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

  7. BlogIcon mont blanc pen 2015.01.31 14:00  수정/삭제  댓글쓰기

    일에Saints big underdogs in Cup final vs

    David Corner of Sunderland in action during the 1985 League Cup final against Norwich City at Wembley Stadium in London. Sunderland boss Gus Poyet even fears his team could even be embarrassed if they play as poorly as they did in their recent 4 1 loss to Arsenal.

    Sunderland though have enjoyed some success against City, including winning their last four 그마

  8. BlogIcon louis vuitton outlet 2015.02.06 02:38  수정/삭제  댓글쓰기

    법에The most effective 10 The majority of well-known New york Artists

    Expenses Martin Fran,tory burch outlet online, also known as the particular "Piano Man,louis vuitton store, in . was made inside Brooklyn in addition to raised on Extended Tropical isle. Just like a usually informed pianist,louis vuitton handbags, singer in addition to composer, Fran is really valued regarding their own Usa indiv메일

  9. 匿名 2015.02.11 14:03  수정/삭제  댓글쓰기

    마메骑士服务端天上碑服务端美丽世界服务端科洛斯服务端石器时代服务端

    完美世界服务端烈焰服务端洛汗服务端新魔界服务端绝对女神私服务端

    征服服务端传说45服务端天之炼狱服务端天堂II私服务端墨香私服务端


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

    天龙八部开私服一条龙服务-


    传奇广告代理-

    IDC服务器以及空间租用-

    魔域私服开区一条龙服务-


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

    Email:49333685@qq.com

    后浪科技更多商业版本免费开放下载




    后浪科技科技仿官神武血魔版服务端



    后浪科技石器时代VIP最新V10纯金开区端



    后浪科技热血江湖3.5宠门武勋开区端



    后浪科技剑侠情缘X2.0商业版本服务端



    后浪科技v2.07已开5区七转神台天降横财八卦玄阵血魄技려지

  10. BlogIcon gucci sneakers 2015.02.12 03:10  수정/삭제  댓글쓰기

    습어Extend Miracle jingle bell band

    We have arrived at the final build from the Louisville Jewellery Examiner's "12 Times associated with Xmas Jewellery Projects associated with 2012. inch Hopefully a person loved the final fourteen days associated with Xmas projects as well as ideas. It had been certainly a larger task compared to We believed prior to We required this upon,authentic burberry outle할선

  11. BlogIcon tory burch reva shoes 2015.02.18 23:10  수정/삭제  댓글쓰기

    되메Worldwide Account with regard to Pet Well being Selects HEWLETT PACKARD

    HEWLETT PACKARD these days introduced how the Worldwide Account with regard to Pet Well being (IFAW) gucci outlet online offers selected HEWLETT PACKARD Converged National infrastructure to aid it's procedures within 15 workplaces all over the world along with enhanced technologies overall performance to satisfy needs assoc일리

  12. BlogIcon louis vuitton handbags 2015.02.20 13:58  수정/삭제  댓글쓰기

    지습Steps to make Angling Fishing lures

    Producing your personal angling fishing lures could be enjoyable,gucci ouelt, satisfying,tory burch outlet, as well as helpful simply because they perform capture seafood really effectively. It's affordable to create all of them and you will make use of wood blanks for example broom deals with or even discard wooden you'll find almost anyplace. Angling fishin려히

  13. BlogIcon fulinglasses review 2015.03.05 17:04  수정/삭제  댓글쓰기

    되메in line with the Mayo Clinic 4out of fiveindividuals within the U.S. will experience low back pain once or more through their lives.

    Back pain is a quite common complaint. it's among the most typical causes for individuals to overlook work or make a visit to the doctor's office,tiffany co sunglasses.

    there's a bright side. maximumback pain can also be prevented and when back pain treatme다로

  14. BlogIcon louis vuitton handbags 2015.03.07 16:31  수정/삭제  댓글쓰기

    한단Chevrolet HHR LS 07 chev hhr rear brakes how do you take shoes

    Refer to Vehicle Lifting,gucci oulet. Remove the tire and wheel assembly. Remove the adjuster assembly (2) from the brake shoes

    Position the hook end of the J 38400 (1) under the universal spring and lightly pull the universal spring end out of the shoe web hole,tory burch outlet. Hold the universal spring while removing the trai한를

  15. BlogIcon new balance womens running shoes 2015.03.19 01:00  수정/삭제  댓글쓰기

    리어Horse soring is really subject related to lively N

    CALIFORNIA Witnesses together with considerably numerous views concerning the level related to dog improper use inside the walking horse company showed up before the congressional cell Thurs, leaving behind several our elected representatives unclear items to believe.

    "It's as you are usually via nfl jerseys wholesale two numerous attributes법어

  16. BlogIcon chaussure louis vuitton homme 2015.03.20 11:08  수정/삭제  댓글쓰기

    리지Disturbance Acrylics,ray ban outlet

    Polymer fresh paint is probably probably the most flexible associated with press,cheap ray bans, it may be diluted along with drinking water as well as used within the type of watercolor or even utilized directly from the pipe in order to imitate essential oil paints. As soon as dried out the actual fresh paint is actually water-resistant and therefore severa를네

  17. BlogIcon chemise burberry femme 2015.03.27 21:10  수정/삭제  댓글쓰기

    분서l'&eacute;tiquette comme une chose importante,Lac de la proximit&eacute; de la surface de Liu Zhuang trois Nord.| | Wei (155 - 220), au d&eacute;but de la guerre de l'Union sovi&eacute;tique, Yang a dit: "il y a un objet,D'autres. Hangzhou femme normale permet de echarpe burberry homme pas cher lire, sa m&egrave;re et sa m&egrave;re l'imp&eacute;ratrice Wu.Tu n'as pas laiss&eacute; la partie r&eac일이

  18. BlogIcon burberry purses 2015.03.29 14:59  수정/삭제  댓글쓰기

    마를film to show Sunday at 2013 QFilm Festival in Long Beach

    LONG BEACH >> Sergio Romero furla outlet knew it would be difficult for his mother to accept that the 37 year old was gay, but it still shocked and hurt him to learn she preferred her son to be an active gang member than to be gay.

    her, I was louis vuitton handbags more of a man as a gang member than being gay, said Romero as he sat in메마

  19. BlogIcon burberry trench sale 2015.04.03 22:10  수정/삭제  댓글쓰기

    가지Report On Magical Realism Warns Of Increased Incidences Of Women's Tears Flooding The Entire World

    NEW YORK that such occurrences pose a grave threat to the global economy and millions of human lives, a report presented Thursday at a United Nations summit on magical realism highlights an alarming increase in incidences in which the whole world is completely flooded by the tears of a grieving wo에관

  20. BlogIcon michael kors wallet sale 2015.04.04 19:55  수정/삭제  댓글쓰기

    마메Proven brutality key to being North Korea's heir apparent

    To be a credible candidate for the leadership of North Korea, a man needs plenty of blood on his hands.

    Overt ruthlessness and a penchant for gratuitous violence are seen as essential leadership qualities in a country whose political culture is founded on the notion that North Korea is under a permanent state of siege by the United St는없

  21. BlogIcon furla online 2015.04.04 21:31  수정/삭제  댓글쓰기

    없부I've the S320 using the tranny within,furla handbags online

    Client: How do i Realize that I have to lso are check out? Basically realize properly,gucci sneakers, I've understand method of understanding in the event that cleaning the actual PCB had been successfull unless of course We obtain an additional check out since the vehicle won't walk out sagging setting by itself? Is actually which pro로비

[Shell32.DLL] *.LNK , *.URL 분석하기





/**************************LNK파일 모양******************************/
L        ?      F?       ?|邂栗S執네??|邂栗 t                    W P???i↖ +00? /E:\                   l 1     ?? PROGRA~1  T 絶?뢒??*   퉠                   P r o g r a m   F i l e s   ( x 8 6 )   X 1     ?? ARTHRO~1  @ 絶????*  
                   A r t h r o p o d   d 2  t ??  ARTHRO~1.EXE  H 絶????*   U
                  A r t h r o p o d . e x e      d            4       c         Kd끘   새 볼륨 E:\Program Files (x86)\Arthropod\Arthropod.exe  (      ?   1SPS?XF퍵8C샜?쁬?        `     쟚       uf15-pc                         V솝??? $?^                V솝??? $?^   
/********************************************************************/



/*********************URL 파일 모양 ***********************************/
[DEFAULT]
BASEURL=http://cafe.naver.com/gosusi.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=4109
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://cafe.naver.com/gosusi.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=4109
IDList=
IconFile=http://cafe.naver.com/favicon.ico
IconIndex=1
/**********************************************************************/


처럼 LNK는 바이너리 타입이고 URL은 텍스트타입이다.

코드를 보면,




Created with colorer-take5 library. Type 'csharp'

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
using Shell32;
using System.Reflection;

namespace LnkASMB2
{
    public partial class MainWindow : Window
    {
        TRACE_Lib.TRACE.TRACE_DELE trace = TRACE_Lib.TRACE.getTrace;
        public MainWindow()
        {
            InitializeComponent();

            //[0]
            this.AllowDrop = true;
            this.Drop += new DragEventHandler(MainWindow_Drop);
        }

        void MainWindow_Drop(object sender, DragEventArgs e)
        {
            //[1]
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                //[2]
                string[] files = e.Data.GetData(DataFormats.FileDrop, true) as string[];
                FileInfo info = new FileInfo(files[0]);
                
                //[3]
                if (info.Extension == ".lnk" || info.Extension == ".LNK")
                    AssembleLNK(files[0]);
                else if (info.Extension == ".url" || info.Extension == ".URL")
                    AssembleURL(files[0]);
                else
                    MessageBox.Show("모르는파일입니다.");
            }
        }

        //[4]
        void AssembleLNK(string _path)
        {
            //[5]
            Shell shl = new Shell();
            //[6]
            Folder dir = shl.NameSpace(System.IO.Path.GetDirectoryName(_path));
            //[7]
            FolderItem item = dir.Items().Item(System.IO.Path.GetFileName(_path));

            //[8]
            List<object> itemPis = new List<object>();
            itemPis.Add(new { str = "단축아이�� 바이너리" });
            itemPis.Add(new {item.Application});
            itemPis.Add(new {hash = item.GetHashCode()});
            itemPis.Add(new {item.IsBrowsable});
            itemPis.Add(new {item.IsFolder});
            itemPis.Add(new {item.IsLink});
            itemPis.Add(new {item.Path});
            itemPis.Add(new {item.Name});
            itemPis.Add(new {item.Parent});
            itemPis.Add(new {item.Size});
            itemPis.Add(new {item.Type});

            //[9]
            ShowText(itemPis);
        }

        //[10]
        void AssembleURL(string _path)
        {
            TextReader tr = new StreamReader(_path);
            String tempLine = null;
            String result = null;
            while ((tempLine = tr.ReadLine()) != null)
            {
                //[11]
                if (tempLine.IndexOf("URL=") > -1)
                {
                    result = tempLine.Substring(4);
                }
            }
            //[12]
            textBox1.Text = "";
            textBox1.Text = "인터넷바로가기" + Environment.NewLine + result;
        }

        void ShowText(List<object> itemPis)
        {
            textBox1.Text = "";
            foreach (var o in itemPis)
            {
                textBox1.Text += o.ToString() + Environment.NewLine;
            }
        }
    }
}

 
주석
[0] : 드래그 드롭 설정과 이벤트
[1] : 만약 드롭파일의 유효성검사
[2] : 드롭된 파일위치 검출 과 FileInfo 생성
[3] : 확장자 식별과 예외처리
[4] : LNK 분석 (바이너리)
[5] : System32 폴더에서 Shell32.dll 을 가져와 참조추가 하여 사용
[6] : 디렉토리 검출
[7] : FolderItem 검출
[8] : 속성들의 리스트화
[9] : 출력
[10] : URL 분석 (텍스트)
[11] : 해당 줄에 "URL=" 검출 <*>
[12] : 출력!


주석 [11]은 윈도우의 경우이고 , MacOS계열에서 넘어오는것은 그냥 ( http://www.abc.com )꼴이다.
Shell32.dll 을 이용하면 윈도가 생성한 대부분의 파일을 분석할수 있다.
하지만 COM 객체라서 그런지 기본코드레벨로 리플렉션을 할수 없어 해당 속서을 파악할수 없다( PropertyInfo[] )
[ 파일속성관련 포스트 :  http://www.scripter.co.kr/entry/any ]
Yamecoder 야매코더_
C# 2011. 1. 25. 13:43

댓글을 달아 주세요

  1. 이전 댓글 더보기
  2. BlogIcon nike free 2014.01.19 16:17  수정/삭제  댓글쓰기

    가방Genererer penge til afghanske præsidents kontor

    Skibe kontante midler til afghanske præsidents kontor

    KABUL: I over et årti, pakket vælter sig i yankee dollars i kufferter, Skoletasken og nu og igen har Plastic indkøbsposer været faldt hver måned eller deromkring på kontorerne for Afghanistans præsident høflighed af den centrale data Agency. Til den taget formandsposten kontanter, for at nuv드있

  3. BlogIcon new era 2014.01.19 16:18  수정/삭제  댓글쓰기

    지한Smid din smarte løbesko

    Dr. Eric Cobb, skaberen af ​​Z-Health ydeevne Solutions System kan lide at stille spørgsmålet: hvorfor toms sko gør vi lader vores fødder er lavet af forskellige ting end resten af ​​vores krop?

    I sine klasser, spørger Dr. Cobb: vi designet en hals tandbøjle, som indvirkede på vores evne til at flytte vores hals, og vi havde at skinne 12-15 timer i døgnet næsten hver 가메

  4. BlogIcon 匿名 2014.03.09 02:14  수정/삭제  댓글쓰기

    되마Adult dating email lists로하

  5. BlogIcon 匿名 2014.03.09 02:14  수정/삭제  댓글쓰기

    지마broadcast email marketing에할

  6. BlogIcon MBT outlet Italia 2014.03.13 03:49  수정/삭제  댓글쓰기

    어방hollister versuchen, eine neue gesunde Lebensmittel

    Ich glaube, er hatte Art des Trainings in dieser erhalten. Habe ich schon erwähnt, dass zwischen dem Zeitpunkt er sein Abitur und absolvierte seine College-Abschluss er bei den Marines angeworben? Er tatsächlich eine Tour über in Viet new era snapback Nam und ich erzählte er im Bein wurde Nike Air Max Danmark von einem Scharfschützen verwundet어리

  7. BlogIcon 匿名 2014.07.28 02:11  수정/삭제  댓글쓰기

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

  8. BlogIcon 匿名 2014.08.19 14:26  수정/삭제  댓글쓰기

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

  9. BlogIcon 对焊凸法兰 2014.08.31 11:06  수정/삭제  댓글쓰기

    일그








    24-210-840型琉璃瓦机
    ,新建文章 9,全自动闭口楼承板机,安装不锈钢;
    压型钢板型号 24-210-840 用途
    有效覆盖宽度(mm) 840
    展开宽度(mm) 1000 屋面板、墙面板
    波高(mm) 24
    板厚(mm) 0.3-0,概述新型彩.8


    ,管帽;











    来源:우지

  10. BlogIcon 匿名 2014.09.21 23:10  수정/삭제  댓글쓰기

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

  11. BlogIcon 匿名 2014.09.28 14:40  수정/삭제  댓글쓰기

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

  12. 匿名 2015.01.14 18:27  수정/삭제  댓글쓰기

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

  13. 匿名 2015.01.15 12:20  수정/삭제  댓글쓰기

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

  14. 匿名 2015.01.19 10:54  수정/삭제  댓글쓰기

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

  15. 匿名 2015.02.06 14:13  수정/삭제  댓글쓰기

    일네大话西游服务端凡人修真服务端大话西游服务端页游服务端问道服务端

    跑跑卡丁车服务端英雄远征服务端幻灵游侠私服务端洪荒神话私服务端

    完美世界服务端烈焰服务端洛汗服务端新魔界服务端绝对女神私服务端


    魔兽私服开区一条龙服务-

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


    传奇广告代理-

    IDC服务器以及空间租用-

    魔域开区sf一条龙开区服务-


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

    Email:1325876192@qq.com

    商业版本免费开放下载




    紫川科技最新毁灭天下1.85狂雷独家合击热血复古三职业新装传奇服务端



    紫川科技20星大极品良装+80麒麟锻造中变传奇服务端



    紫川科技独家轻变1.89奥妙转生神龙锻造珍珑元素版传奇服务端



    紫川科技独家九转1.85四皇冠加倍装备特戒龙卫습있

  16. 匿名 2015.02.11 14:03  수정/삭제  댓글쓰기

    단지剑侠情缘服务端密传服务端街头篮球服务端A3私服务端破天一剑服务端

    魔域服务端魔兽世界服务端天龙八部服务端RF服务端传奇归来私服务端

    风云雄霸天下服务端天之炼狱一条龙大话西游服务端精灵复兴私服务端


    传奇世界私服开服一条龙服务-

    魔兽私服开区一条龙服务-


    IDC服务器以及空间租用-

    魔域开区sf一条龙开区服务-

    传奇广告代理-


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

    Email:1292124634@qq.com

    商业版本免费开放下载




    前沿科技1.80怀旧复古赤月终极烟花教主淘宝秒杀商城升级版



    前沿科技1.76雄霸特色大极品+50元素倚天辟地狂风连击传奇



    前沿科技3D真彩无英雄中变靓装元素傲天朱雀神龙毒血斩



    前沿科技至尊中变1.89无英雄元素立法之殿版

    있메

  17. 匿名 2015.03.01 14:22  수정/삭제  댓글쓰기

    을있大话西游服务端凡人修真服务端大话西游服务端页游服务端问道服务端

    跑跑卡丁车服务端英雄远征服务端幻灵游侠私服务端洪荒神话私服务端

    完美世界服务端烈焰服务端洛汗服务端新魔界服务端绝对女神私服务端


    魔兽私服开区一条龙服务-

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


    传奇广告代理-

    IDC服务器以及空间租用-

    魔域开区sf一条龙开区服务-


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

    Email:1325876192@qq.com

    商业版本免费开放下载




    紫川科技最新毁灭天下1.85狂雷独家合击热血复古三职业新装传奇服务端



    紫川科技20星大极品良装+80麒麟锻造中变传奇服务端



    紫川科技独家轻变1.89奥妙转生神龙锻造珍珑元素版传奇服务端



    紫川科技独家九转1.85四皇冠加倍装备特戒龙卫일니

  18. BlogIcon persol 0714 2015.03.05 17:04  수정/삭제  댓글쓰기

    들들In Japan, the hon-shimeji mushroom is a delicacy costing as much as $450 a pound . in this topic Techno Magic a snappy Chicken And Mushroom Pie Recipe For Busy People the way to make moneyew or Tofu Casserole Mom’s Mushroom Stuff Melanzane Mushroom Meal
      'Now a student on the University of Gothenburg, Swede조리

  19. BlogIcon chaussure burberry homme pas cher 2015.03.31 00:03  수정/삭제  댓글쓰기

    뉴에de transparence et d'autres aspects de bien progresser. sous - banques ont form&eacute; une puissante dynamique,Liu Yan ", de la gorge, &agrave; partir de la source &agrave; un comportement de recherche de puissance. la question des entreprises porte approbation de fa&ccedil;on r&eacute;p&eacute;t&eacute;e de courir &agrave; long terme par critiqu&eacute;e.
    Lundi prochain, de polluants primaire지겠

  20. 匿名 2015.04.05 10:19  수정/삭제  댓글쓰기

    습마火车采集器html简单模板示范






    Narcissistic Wordsmith - Ghost Rider: Travels on the Healing Road







    [标签:来源]








    At the tender age of sixteen I was introduced to a band called Rush. The Canadian trio filled my ears as well as my soul and to this day Rush still rocks my world. Unfortunately, after the tour to support their album,Christmas Shopping on a Budge, Test for Echo, en선할

  21. 匿名 2015.04.08 09:20  수정/삭제  댓글쓰기

    종적火车采集器html简单模板示范






    Build You Own Chopper - Things to Consider Before You Start







    [标签:来源]








    When it comes to people wanting to learn more about how to build a custom chopper they will find that the internet is a great source of information,Why Buy A Used Moped Online_120485. Today not only will you be directed towards sites where you can arrange for one to be b니는

Powerd by Tistory, designed by criuce
rss