<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx</link><description>They mean the same thing today, but at one time they were quite different.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155126</link><pubDate>Mon, 14 Jun 2004 14:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155126</guid><dc:creator>Jack Mathews</dc:creator><description>hinstPrev - In Win16, gave you the previously started HINSTANCE of a program so you could do things like keep one instance running.  Since everything ran in one address space, you could dereference this memory fine.&lt;br&gt;&lt;br&gt;Since Win32 and Win64 are a convoluted set of anachronisms, they have an hinstPrev in WinMain that is always NULL.  It has to be NULL because module base addresses are per-process, so your hinstPrev would both be useless and would be the same as the normal hinstance (because each of the processes would have the same base addresses in their respective address spaces).  &lt;br&gt;&lt;br&gt;In Win32/64, if you want to know about or interact with other running versions of your process, you can use some form of inter process communication like named Mutexes, file mapping objects, or DDE.&lt;br&gt;&lt;br&gt;Next! :)</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155151</link><pubDate>Mon, 14 Jun 2004 14:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155151</guid><dc:creator>asdf</dc:creator><description>I have seen code (including code from Microsoft) that treated the HINSTANCE/HMODULE as the pointer to the dll/exe that was mapped to memory from MapViewOfFile and read the the PE struct through that. Is this a safe thing to do or will it likely be changed in a future windows?</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155198</link><pubDate>Mon, 14 Jun 2004 15:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155198</guid><dc:creator>Raymond Chen</dc:creator><description>asdf: Yes, the base address of the module is the Win32/64 HINSTANCE.</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155296</link><pubDate>Mon, 14 Jun 2004 18:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155296</guid><dc:creator>Peter Montgomery</dc:creator><description>It's this sort of left over cruft from the 16 bit origins of Windows that makes me think it's time for Microsoft to write a single 32/64 bit &amp;quot;wrapper&amp;quot; whose job would be to clean up this stuff.  I know that MS has written all sorts of cracker macros and wrappers in the past - I'm talking about a single wrapper that cleans up ALL the leftover nonsense in the WinAPI.&lt;br&gt;&lt;br&gt;In (some people's) perfect world, they would boot Hungarian from ALL interfaces, but at the very least lets get rid of the &amp;quot;lp&amp;quot; nonsense that makes NO sense anymore.  They could also do things like eliminate the &amp;quot;HPrevInstance&amp;quot; parameter completely since it no longer does anything of use in the 32/64 bit world.  The wrapper could present a cleaner, alternative API interface so that Win programmers could write to a new, clean interface that is 100% compatible with the old one.  I know it'll never happen, but I can dream, can't I?&lt;br&gt;&lt;br&gt;     Thanks,&lt;br&gt;     PeterM&lt;br&gt;&lt;br&gt;PS - Regarding my desire for losing Hungarian in the interfaces, I feel that if MS wants to code with it internally, then more power to them.  However, having the interfaces littered with &amp;quot;lp&amp;quot; and other detritius that doesn't even make sense anymore proves that Hungarian has a serious flaw.  If the reason for Hungarian is to provide clarity to the programmer, then why do programmers today have to learn what a &amp;quot;long pointer&amp;quot; is (so that they understand what &amp;quot;lp&amp;quot; means in Hungarian) just so they know that they can IGNORE IT when they see it in the API?</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155311</link><pubDate>Mon, 14 Jun 2004 18:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155311</guid><dc:creator>Ben Hutchings</dc:creator><description>Peter: It's called .NET with Windows.Forms. ;-)</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155495</link><pubDate>Mon, 14 Jun 2004 22:47:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155495</guid><dc:creator>CW User</dc:creator><description>&amp;gt; Tomorrow, I'll talk about that mysterious hinstPrev parameter to WinMain.&lt;br&gt;&lt;br&gt; YES!&lt;br&gt;&lt;br&gt; And can you please put few comments on this article: &amp;quot;Avoiding&lt;br&gt;Multiple Instances of an Application&amp;quot; at: &lt;a target="_new" href="http://www.flounder.com/nomultiples.htm"&gt;http://www.flounder.com/nomultiples.htm&lt;/a&gt; or give few pointers in that&lt;br&gt;direction.</description></item><item><title>What is the oldest code that still compiles/works?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155523</link><pubDate>Mon, 14 Jun 2004 23:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155523</guid><dc:creator>Anonymous Coward</dc:creator><description>I am curious what the oldest Windows code that will still compile and run is.  Sadly I don't have the very first Petzold, but I suspect that code may still compile and run.&lt;br&gt;&lt;br&gt;Will Windows/386 binaries still run?</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155591</link><pubDate>Tue, 15 Jun 2004 00:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155591</guid><dc:creator>Mike Dunn</dc:creator><description>&amp;gt;Will Windows/386 binaries still run? &lt;br&gt; &lt;br&gt;I once came upon a site that had old Windows binaries like Calc archived, and they mostly ran on today's OSes. *Really* old apps (like for Win v1) had to have a bit flipped in their NE header and their graphics didn't look 100% right, but they were still usable.</description></item><item><title>re: What is the difference between HINSTANCE and HMODULE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#155861</link><pubDate>Tue, 15 Jun 2004 09:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155861</guid><dc:creator>John Topley</dc:creator><description>Mike,&lt;br&gt;&lt;br&gt;See &lt;a target="_new" href="http://toastytech.com/guis/misc2.html"&gt;http://toastytech.com/guis/misc2.html&lt;/a&gt;</description></item><item><title>Oldest code</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#156065</link><pubDate>Tue, 15 Jun 2004 14:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:156065</guid><dc:creator>John Elliott</dc:creator><description>There are various Windows 1.x/2.x sample apps at&lt;br&gt;&amp;lt;&lt;a target="_new" href="http://cd.textfiles.com/carousel/030A/&amp;gt;"&gt;http://cd.textfiles.com/carousel/030A/&amp;gt;&lt;/a&gt;.&lt;br&gt;I tried a few on Windows XP. The ones in WIN2APPS.ZIP (for win 2.x) run; the ones in WINAPPS.ZIP (for Win 1.x) don't (the DOS stub runs rather than the NE program). It doesn't seem to be the subsystem ID, because SUPRFUSE.EXE has it set to 0 (rather than 2 for Win16) and it still runs.&lt;br&gt;Then I tried setting the version number in the NE header to 1.0 and the DOS stub ran instead.</description></item><item><title>re: Oldest code</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#156107</link><pubDate>Tue, 15 Jun 2004 15:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:156107</guid><dc:creator>John Elliott</dc:creator><description>If the URL above fails, try &lt;a target="_new" href="http://cd.textfiles.com/carousel/030A/"&gt;http://cd.textfiles.com/carousel/030A/&lt;/a&gt; - ie, no angle brackets.&lt;br&gt;&lt;br&gt;I just tried the same checks on Win98 and WinNT 3.51. On Win98, neither the Win 1.x nor the Win 2.x programs work - you get the DOS stub. On NT, the Win 2.x programs work and the Win 1.x ones say &amp;quot;The system cannot find the file USER&amp;quot;.</description></item><item><title>re: Accessing the current module's HINSTANCE from a static library</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#247435</link><pubDate>Tue, 26 Oct 2004 00:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:247435</guid><dc:creator>The Old New Thing</dc:creator><description /></item><item><title>What can I do with the HINSTANCE returned by the ShellExecute function?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#590750</link><pubDate>Fri, 05 May 2006 17:00:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:590750</guid><dc:creator>The Old New Thing</dc:creator><description>It used to mean something on 16-bit Windows.</description></item><item><title>Martin&amp;#8217;s Blog &amp;raquo; Gibt es einen Unterschied zwischen HMODULE und HINSTANCE?</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#5383607</link><pubDate>Tue, 09 Oct 2007 19:38:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5383607</guid><dc:creator>Martin’s Blog » Gibt es einen Unterschied zwischen HMODULE und HINSTANCE?</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.m-ri.de/index.php/2007/10/09/gibt-es-einen-unterschied-zwischen-hmodule-und-hinstance/"&gt;http://blog.m-ri.de/index.php/2007/10/09/gibt-es-einen-unterschied-zwischen-hmodule-und-hinstance/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Snooping the Contents of a Password Edit Control</title><link>http://blogs.msdn.com/oldnewthing/archive/2004/06/14/155107.aspx#8273031</link><pubDate>Mon, 17 Mar 2008 00:01:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8273031</guid><dc:creator>All Your Base Are Belong To Us</dc:creator><description>&lt;p&gt;Did you ever get a chance to blankly stare at a screen similar to the above, trying to recollect what&lt;/p&gt;
</description></item></channel></rss>