title_0

{"item":{"status":"visible","url":"\/2014\/08\/18\/Run-a-Windows-executable-with-a-hidden-console-window\/","trash":"","name":"Run-a-Windows-executable-with-a-hidden-console-window","parent":"","title":"Run a Windows executable with a hidden console window","date":"2014-08-18 22:50:15","filepath":"posts\/20140818_Run-a-Windows-executable-with-a-hidden-console-window.xml.json","type":"post","content":"<p><img style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/2012\/01\/gear.png\" alt=\"\" width=\"60\" height=\"64\" \/>You may find running a console application in the background with the big black console window hidden is difficult on Windows.<\/p>\n<p>Here is a solution that will even work for non-console apps (window exe's). &nbsp;But be careful since you will have to use the task manager to kill applications that don't close on their own.<\/p>\n<p>The script arguments is the command you want to run. &nbsp;For example:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: 'courier new', courier;\">&gt; hide.vbs \"C:\\Windows\\System32\\makecab.exe\" data.txt out.cab<\/span><\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: 'courier new', courier;\">&gt; hide.vbs notepad.exe<\/span><\/p>\n<p>Using the script allows the creation of shortcut files to specific actions by tools (batch files, ImageMagick, etc).<\/p>\n<p><strong>Quick Demo:<\/strong><\/p>\n<ol>\n<li>Save the code to hide.vbs (<a href=\"http:\/\/www.8bitrobot.com\/media\/uploads\/hide.txt\">download here<\/a>)<\/li>\n<li>Create a shortcut to hide.vbs (right click, drag to location, select create shortcut)<\/li>\n<li>Edit the shortcut target:&nbsp;<br \/><span style=\"font-family: 'courier new', courier;\">C:\\hide.vbs \"C:\\Windows\\System32\\makecab.exe\"&nbsp;\"C:\\hide.vbs\" trash.cab<\/span><\/li>\n<li>Double click on the shortcut and you will see a trash.cab file created without seeing the console window (try a shortcut directly to makecab.exe to see how it normally behaves).<\/li>\n<\/ol>\n<p><strong><a href=\"http:\/\/www.8bitrobot.com\/media\/uploads\/hide.txt\">Here is the script source<\/a>:<\/strong><\/p>\n<pre style=\"font-family: 'courier new', courier;\">If WScript.Arguments.Count &lt; 1 Then\n MsgBox(\"Error: Missing command arguments\")\n WScript.Quit\nEnd If\n\nDim argStr\nSet objSWbemServices = GetObject(\"WinMgmts:Root\\Cimv2\") \nSet colProcess = objSWbemServices.ExecQuery(\"Select * From Win32_Process\") \nFor Each objProcess In colProcess\n If InStr (objProcess.CommandLine, WScript.ScriptName) &lt;&gt; 0 Then\n argStr = Mid(objProcess.CommandLine, InStr(objProcess.CommandLine , WScript.ScriptName) + Len(WScript.ScriptName) + 1)\n End If\nNext\ncmdStr = Trim(argStr)\n\nCreateObject(\"Wscript.Shell\").Run cmdStr, 0, True\n\n<\/pre>\n<p>&nbsp;<\/p>"}}

title_1

{"item":{"status":"visible","url":"\/2014\/06\/21\/Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS\/","trash":"","name":"Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS","parent":"","title":"Win32: Revisited - Creating an AVI from a GIF that works with ANIMATE_CLASS","date":"2014-06-21 02:06:05","filepath":"posts\/20140621_Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS.xml.json","type":"post","content":"<p><img style=\"margin-left: 10px; margin-right: 10px; float: left;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/2012\/01\/gear.png\" alt=\"\" width=\"60\" height=\"64\" \/><\/p>\n<p>An earlier post (<a href=\"http:\/\/www.8bitrobot.com\/2014\/05\/24\/Win32--Creating-an-AVI-for-ANIMATE_CLASS\/\">Creating an AVI for ANIMATE_CLASS<\/a>) described how to create an AVI that will work with the ANIMATE_CLASS common control. &nbsp;However, there are still some particulars that need to be ironed out for the AVI creation and play to be successful... especially when attempting to create an AVI from a GIF animated image.<\/p>\n<p>Most of the issues center around bit depth and global palettes during the conversion. &nbsp;But, instead of explaining all this, I'll just give the basic steps used to create the AVI:<\/p>\n<ol>\n<li>Download <a href=\"http:\/\/www.imagemagick.org\/\">ImageMagick<\/a><\/li>\n<li>At the command prompt use IM to create a series of frames with the proper encoding<\/li>\n<ul>\n<li>convert -append spin.gif all.gif<\/li>\n<li>convert all.gif -unique-colors -depth 8 map.gif<\/li>\n<li>convert -coalesce spin.gif BMP2:frame_%05d.bmp<\/li>\n<li>mogrify -define bmp:format=bmp2 +matte -remap map.gif -colors 256 *.bmp<\/li>\n<\/ul>\n<li>Download <a href=\"http:\/\/makeavi.sourceforge.net\/\">MakeAVI<\/a><\/li>\n<li>Add the frame files (frame_00000.bmp)<\/li>\n<li>Select the fps and press Begin<\/li>\n<li>Choose a save name<\/li>\n<li>Choose the \"Microsoft RLE\" compressor with quality set to 100<\/li>\n<li>Press OK and verify the AVI can be played in Media Player<\/li>\n<\/ol>\n<div>Also, keep in mind some colors may cause problems with transparency. So, be sure to remove ACS_TRANSPARENT from the window style if you don't want transparency.<\/div>\n<div>Here is a <a href=\"http:\/\/code.msdn.microsoft.com\/windowsdesktop\/CppWindowsCommonControls-9ea0de64\/sourcecode?fileId=21600&amp;pathId=788479441\">Microsoft sample<\/a> for creating an AVI animation window (note: it uses ACS_TRANSPARENT).<\/div>"}}

title_2

{"item":{"status":"visible","url":"\/2014\/05\/24\/Win32--Creating-an-AVI-for-ANIMATE_CLASS\/","trash":"","name":"Win32--Creating-an-AVI-for-ANIMATE_CLASS","parent":"","title":"Win32: Creating an AVI for ANIMATE_CLASS","date":"2014-05-24 00:42:13","filepath":"posts\/20140524_Win32--Creating-an-AVI-for-ANIMATE_CLASS.xml.json","type":"post","content":"<p><br \/><img style=\"margin-left: 10px; margin-right: 10px; float: left;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/2012\/01\/gear.png\" alt=\"\" width=\"60\" height=\"64\" \/>I've spent far... far... too much time trying to get an AVI format that will actually work in the <a href=\"http:\/\/code.msdn.microsoft.com\/windowsdesktop\/CppWindowsCommonControls-9ea0de64\">ANIMATE_CLASS<\/a> common control. &nbsp;The usual tools were tried: <a href=\"http:\/\/www.imagemagick.org\/\">ImageMagick<\/a>, <a href=\"http:\/\/ffmpeg.org\/\">ffmpeg<\/a>, and <a href=\"http:\/\/www.mplayerhq.hu\/\">mplayer<\/a>. &nbsp;But, nothing worked.<\/p>\n<p>The windows API wouldn't complain about a bad format. &nbsp;It would just not display the AVI in the window.<\/p>\n<p>So, after some digging, I realized I needed an <a href=\"http:\/\/blogs.msdn.com\/b\/oldnewthing\/archive\/2009\/04\/18\/9553626.aspx?Redirected=true\">RLE-8 compressed AVI<\/a>. &nbsp;All the other tools would use an unsupported codec or they would produce a raw format codec that wouldn't be viewed in Windows Explorer or play in Windows Media Player.<\/p>\n<p>After a bunch of trial and error, I came across <a href=\"http:\/\/makeavi.sourceforge.net\/\">MakeAVI<\/a>. &nbsp;It's a super simple interface and gives you the choice of RLE compression or uncompressed video.<\/p>\n<p>So, save your time and use <a href=\"http:\/\/makeavi.sourceforge.net\/\">MakeAVI<\/a> when you want to mess around with archaic Win32 animation API's.<\/p>\n<p><strong>Update:<\/strong> Also see <a href=\"http:\/\/www.8bitrobot.com\/2014\/06\/21\/Win32--Revisited---Creating-an-AVI-from-a-GIF-that-works-with-ANIMATE_CLASS\/\">Creating an AVI from a GIF that works with ANIMATE_CLASS<\/a><\/p>"}}

title_3

{"item":{"status":"visible","url":"\/2014\/03\/19\/Win32-API--Set-window-to-foreground\/","trash":"","name":"Win32-API--Set-window-to-foreground","parent":"","title":"Win32 API: Set window to foreground","date":"2014-03-19 07:38:39","filepath":"posts\/20140319_Win32-API--Set-window-to-foreground.xml.json","type":"post","content":"<p><img style=\"margin-left: 10px; margin-right: 10px; float: left;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/2012\/01\/gear.png\" alt=\"\" width=\"60\" height=\"64\" \/>It can be tricky setting your window as the top z-order window. &nbsp;It's not just a simple call to SetForegroundWindow.<\/p>\n<div style=\"clear: both;\">&nbsp;<\/div>\n<p>Here's how to do it:<\/p>\n<pre style=\"padding-left: 30px;\">AttachThreadInput(GetWindowThreadProcessId(::GetForegroundWindow(), NULL),\n GetCurrentThreadId(), TRUE);\n\nBringWindowToTop(hwnd);\nSetForegroundWindow(hwnd);\nSetFocus(hwnd);\n\nAttachThreadInput(GetWindowThreadProcessId(::GetForegroundWindow(),NULL),\n GetCurrentThreadId(),FALSE);<\/pre>\n<p>This solution is from Nish Sivakumar's <a href=\"http:\/\/www.codeproject.com\/Articles\/1724\/Some-handy-dialog-box-tricks-tips-and-workarounds\">code project article<\/a> and KevinSW's <a href=\"http:\/\/www.codeproject.com\/Articles\/1724\/Some-handy-dialog-box-tricks-tips-and-workarounds?msg=2737186#xx2737186xx\">comment<\/a>.<\/p>"}}

title_4

{"item":{"status":"visible","url":"\/2014\/01\/25\/Maps-of-the-US-to-find-nice-problem-counties\/","trash":"","name":"Maps-of-the-US-to-find-nice-problem-counties","parent":"","title":"Maps of the US to find nice\/problem counties","date":"2014-01-25 20:50:15","filepath":"posts\/20140125_Maps-of-the-US-to-find-nice-problem-counties.xml.json","type":"post","content":"<p>Here are a series of maps of US counties showing various statistics (Religion, Mental Illness, Education, Income, etc...):<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/imgur.com\/a\/UYvu2#1\"><img src=\"http:\/\/i.imgur.com\/Wo6oCMw.jpg\" alt=\"\" width=\"350\" \/><\/a><\/p>\n<p style=\"text-align: left;\">If I had the time and the data, I'd throw together a US county filter\/screen app so people can browse and search the relative desirability of each county (like a stock filter).<\/p>\n<p style=\"text-align: left;\"><a href=\"http:\/\/imgur.com\/a\/UYvu2#1\">imgur link<\/a><\/p>"}}

title_5

{"item":{"status":"visible","url":"\/2013\/10\/08\/Front-lines-of-WWII-s-European-theater\/","trash":"","name":"Front-lines-of-WWII-s-European-theater","parent":"","title":"Front lines of WWII's European theater","date":"2013-10-08 21:23:10","filepath":"posts\/20131008_Front-lines-of-WWII-s-European-theater.xml.json","type":"post","content":"<p style=\"text-align: center;\"><iframe src=\"http:\/\/www.youtube.com\/embed\/WOVEy1tC7nk\" frameborder=\"0\" width=\"320\" height=\"240\"><\/iframe><\/p>"}}

title_6

{"item":{"status":"visible","url":"\/2013\/10\/04\/Windows--Yen-symbol-for-backslash\/","trash":"","name":"Windows--Yen-symbol-for-backslash","parent":"","title":"Windows: Yen symbol for backslash","date":"2013-10-04 23:38:28","filepath":"posts\/20131004_Windows--Yen-symbol-for-backslash.xml.json","type":"post","content":"<p><img style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/yen.png\" alt=\"\" width=\"72\" \/>First off, the term backslash for \\ doesn't sit well. &nbsp;It would be best described as downslash since that is the direction the pen travels as it is written. &nbsp;But, for consistency, let's call it a backslash.<\/p>\n<p>&nbsp;Maybe you have tried installing a Japanese keyboard and IME in Windows 7 and decided to uninstall it. &nbsp;You may notice after uninstalling everything (and doing the requisite restart) a yen symbols still replaces the backslash when typing the key.<\/p>\n<p>In a command prompt (console), paths will look like:<\/p>\n<pre style=\"padding-left: 30px;\"><span style=\"background-color: #000000; color: #ffffff;\">C:&yen;Windows&yen;System32&gt;<\/span><\/pre>\n<p>To fix the problem, go to:<\/p>\n<pre style=\"padding-left: 30px;\">Settings (Control Panel) -&gt; Region and Languages -&gt; Administrative -&gt; Language for non-Unicode programs -&gt; Change system locale<\/pre>\n<p>You may have noticed that the setting was still set to Japanese. &nbsp;Make sure it is set back to English, whichever flavor that is.<\/p>"}}

title_7

{"item":{"status":"visible","url":"\/2013\/10\/02\/Sparkle--Where-are-update-checks-saved\/","trash":"","name":"Sparkle--Where-are-update-checks-saved","parent":"","title":"Sparkle: Where are update checks saved","date":"2013-10-02 21:31:28","filepath":"posts\/20131002_Sparkle--Where-are-update-checks-saved.xml.json","type":"post","content":"<p><img style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/Sparkle.png\" alt=\"\" width=\"72\" \/><a href=\"http:\/\/en.wikipedia.org\/wiki\/Sparkle_(software)\">Sparkle<\/a> is an OSX framework used for automating software. &nbsp;Once integrated into an application it will pull an appcast to see if it a newer version is available. &nbsp;If a newer version exists, it will download and install it. &nbsp;This framework frees developers from having to roll out their own update mechanism that lives outside the App Store.<\/p>\n<p>Built into Sparkle are little crumbs that make sure the update isn't performed too often since it will degrade the host application's performance. &nbsp;These preferences are saved in the host application's OSX preference\/properties location.<\/p>\n<p>When developing it is useful to be able to do an update check on every launch, which means clearing the crumbs Sparkle left behind. &nbsp;To do this use the \"defaults\" commandline tool:<\/p>\n<pre>$ defaults delete com.yourappdomainbundlename SUEnableAutomaticUpdates<\/pre>\n<pre><span style=\"white-space: normal;\">$ defaults delete com.yourappdomainbundlename SULastCheckTime<\/span><\/pre>\n<p>If you want to see what else Sparkle puts in your application preferences, just read them:<\/p>\n<pre>$ defaults read<span style=\"white-space: normal;\">&nbsp;<\/span><span style=\"white-space: normal;\">com.yourappdomainbundlename<\/span><\/pre>"}}

title_8

{"item":{"status":"visible","url":"\/2013\/10\/02\/Xcode--Viewing-memory\/","trash":"","name":"Xcode--Viewing-memory","parent":"","title":"Xcode: Viewing memory","date":"2013-10-02 20:57:29","filepath":"posts\/20131002_Xcode--Viewing-memory.xml.json","type":"post","content":"<p><img style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/xcode.png\" alt=\"\" width=\"72\" \/>Xcode makes easy tasks hard. &nbsp;Want to view memory at a specific address? &nbsp;Well, don't look in the <strong>View menu<\/strong>, where most of the IDE panes are. &nbsp;Go to <strong>Product -&gt; Debug -&gt; View Memory<\/strong>.<\/p>\n<p>Everyday using Xcode is like a scavenger hunt in Hades where the reward is absent and you can only ask yourself why you continue.<\/p>"}}

title_9

{"item":{"status":"visible","url":"\/2013\/10\/02\/Xcode--How-to-set-environment-variable-for-debugging\/","trash":"","name":"Xcode--How-to-set-environment-variable-for-debugging","parent":"","title":"Xcode: How to set environment variable for debugging","date":"2013-10-02 19:34:40","filepath":"posts\/20131002_Xcode--How-to-set-environment-variable-for-debugging.xml.json","type":"post","content":"<p><img style=\"float: left; margin-left: 10px; margin-right: 10px;\" src=\"http:\/\/www.8bitrobot.com\/media\/uploads\/xcode.png\" alt=\"\" width=\"72\" \/>Say you have an application that makes a simple getenv() call to check an environment variable and you want to test it during runtime in the Xcode IDE debugger. &nbsp;How do you tell <strong>Xcode 4.6<\/strong> to supply the environment variable?<\/p>\n<p>It's hidden away in the schema. &nbsp;So, edit your schema and choose the \"Run YourApp\" item on the left panel. &nbsp;Then add an environment variable in the table to the right.<\/p>\n<p style=\"text-align: center;\"><em>~<\/em><\/p>\n<p><em>Working on any mildly complex project is a nightmare. &nbsp;Sure, Apple is all about minimalism, but those headers are descriptive and are useful when trying to describe solutions to project configurations. &nbsp;Scanning StackOverflow's Xcode questions reveal a funny but sad mix of \"the left panel\" or \"<a href=\"http:\/\/stackoverflow.com\/a\/6210437\/813249\">the second-to-left panel.<\/a>\"<\/em><\/p>\n<p><em>The Xcode IDE is a dirty joke that makes the life of a developer worse. &nbsp;The time spent in Xcode config land versus actually being productive creating something is&nbsp;obscene.<\/em><\/p>"}}
 

Lorem Ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

 
This page is best viewed with Firefox 3.5+, Chrome 5+, Safari 5+, Opera 10.6+, IE 9+
Copyright © 2014 8bitrobot.com