<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-8923491626648156686</id><updated>2009-02-21T12:09:03.175Z</updated><title type='text'>XSI Scripts</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://squid3d.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8923491626648156686/posts/default'/><link rel='alternate' type='text/html' href='http://squid3d.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Squid3d</name><uri>http://www.blogger.com/profile/02005073237841212284</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8923491626648156686.post-7911802119662363966</id><published>2007-02-10T21:29:00.000Z</published><updated>2007-02-10T22:17:24.353Z</updated><title type='text'>XSI, C# and Hiding the windows title bar</title><content type='html'>Very simple idea. 'Run xsi fullscreen'&lt;br /&gt;&lt;br /&gt;The relevant code :&lt;blockquote&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;public bool&lt;/span&gt; Execute(&lt;span style="color: rgb(51, 255, 255);"&gt;Context&lt;/span&gt; in_ctxt)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;       int&lt;/span&gt; hwnd = 0;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;      IntPtr&lt;/span&gt; HWND_TOP = &lt;span style="color: rgb(51, 255, 255);"&gt;IntPtr&lt;/span&gt;.Zero;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;      int&lt;/span&gt; style;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;      string&lt;/span&gt; str;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 0);"&gt;       // 1. Get a handle to XSI&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 255, 255);"&gt;      Process&lt;/span&gt;[] pXSi = &lt;span style="color: rgb(51, 255, 255);"&gt;Process&lt;/span&gt;.GetProcessesByName(&lt;span style="color: rgb(0, 153, 0);"&gt;"XSI"&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;      // no messing about here : just get the 1st instance found&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;      if&lt;/span&gt; (pXSi.Length != 0){ str = pXSi[0].MainWindowTitle; }&lt;br /&gt;    else{&lt;span style="color: rgb(51, 51, 255);"&gt;return false&lt;/span&gt;;}&lt;br /&gt;&lt;br /&gt;    hwnd = FindWindow(&lt;span style="color: rgb(51, 102, 255);"&gt;null&lt;/span&gt;, str);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;      // store the current windows style&lt;/span&gt;&lt;br /&gt;    style = GetWindowLong( (&lt;span style="color: rgb(51, 255, 255);"&gt;IntPtr&lt;/span&gt;) hwnd, GWL_STYLE);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;      // &lt;span style="font-weight: bold;"&gt;2. flip the WS_CAPTION bits&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;    SetWindowLong((&lt;span style="color: rgb(51, 255, 255);"&gt;IntPtr&lt;/span&gt;)hwnd, GWL_STYLE, (style ^= WS_CAPTION));&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;      // refresh the window&lt;/span&gt;&lt;br /&gt;    SetWindowPos((&lt;span style="color: rgb(51, 255, 255);"&gt;IntPtr&lt;/span&gt;)hwnd, HWND_TOP, 0, 0, 0, 0,&lt;br /&gt;            SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;      return true&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;1. GetProcessByName returns us an array of all the running instances of XSI. (if the array is empty we are in serious trouble as this plugin runs from inside xsi ;)&lt;br /&gt;I'm only really interested in the first one found so, i just get the title and pass that to the FindWindow function - imported from User32.dll.&lt;br /&gt;&lt;br /&gt;I know there are better ways of getting a handle and such but, that's not the point of these little tools. They only serve to serve me.&lt;br /&gt; I couldn't care less about good OOP practices, speed, when .Net's GC kicks in...and all the millions of other things that a good coder should be considering.&lt;br /&gt;XSI title bars, as you probably know are convolouted buggers. Essentially, the only thing not listed there is the contents of your 'sexify' directories. so messing about with xsi's sdk to get the current project, app path or whatever the hell i'd need just to get the hwnd didn't even register on my TODO list.&lt;br /&gt;If it works, it's good enough for now :)&lt;br /&gt;&lt;br /&gt;2.&lt;br /&gt;soo..I have a spanking new  handle to xsi's main window wich i use to find out what style is currently being used ( style = GetWindowLong). then it's just a matter of XOR-ing the bit flags  using         SetWindowLong (it is a toggle type plugin after all) and refreshing the window (SetWindowPos) and we are done.&lt;br /&gt;&lt;br /&gt;simple eh :)&lt;br /&gt;&lt;br /&gt;now i just need to work out how to attach the source to this blog&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8923491626648156686-7911802119662363966?l=squid3d.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://squid3d.blogspot.com/feeds/7911802119662363966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=8923491626648156686&amp;postID=7911802119662363966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8923491626648156686/posts/default/7911802119662363966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8923491626648156686/posts/default/7911802119662363966'/><link rel='alternate' type='text/html' href='http://squid3d.blogspot.com/2007/02/xsi-c-and-hiding-windows-title-bar.html' title='XSI, C# and Hiding the windows title bar'/><author><name>Squid3d</name><uri>http://www.blogger.com/profile/02005073237841212284</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07722672111634675466'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8923491626648156686.post-2655492740884983889</id><published>2007-02-10T21:04:00.000Z</published><updated>2007-02-10T21:22:32.369Z</updated><title type='text'>First post</title><content type='html'>There was a post on &lt;a href="http://www.xsibase.com/forum/index.php?board=14;action=display;threadid=29107"&gt;XSIBase&lt;/a&gt; recently and it got me thinking (no small feat).&lt;br /&gt;&lt;br /&gt;Virtually every day i write teeny tiny tools to make my time spent with XSI happier, more productive and generally,  an all round  groovy experience.&lt;br /&gt;&lt;br /&gt;It never once occured to me that these tools would be useful to anyone else. Just incase they are, they are here :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8923491626648156686-2655492740884983889?l=squid3d.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8923491626648156686/posts/default/2655492740884983889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8923491626648156686/posts/default/2655492740884983889'/><link rel='alternate' type='text/html' href='http://squid3d.blogspot.com/2007/02/first-post.html' title='First post'/><author><name>Squid3d</name><uri>http://www.blogger.com/profile/02005073237841212284</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07722672111634675466'/></author></entry></feed>