avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday July 6, 2022, 9:08 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - hgondalf [ switch to compact view ]

Pages: [1]
Coding Snacks / Re: re-map capslock function
« on: July 05, 2013, 08:52 AM »
Thanks Mouser.

In another post I found a link for remapkey.exe, which apparently does the same thing as sharpkeys.

The limitation for these programs is that they use a registry tweak to set the function of a single key.  Neither allows one to map shifted keys (e.g., Ctrl+Alt+Windows F1) to a new function.  I’d be dead in the water without autohotkey’s ability to map shift-key functions.

Using remapkey.exe, I mapped Capslock to Shift, and the right whatever-it-is (the list button next to RWin) to Caplock.

I use rwin as the hotkey trigger for for RunAndHide, so that other weird windows key was the last unused key on my keyboard.

But I would still rather use Ctrl-Capslock to toggle the capslock function.

Coding Snacks / re-map capslock function
« on: July 05, 2013, 07:38 AM »
I’m a thumb-fingered typist, so I keep hitting capslock by mistake, and sometimes +capslock.  I tried CapShift, but because of the accidental pressing of +capslock, I still get lines of ALL CAPS. I don’t need a beep or popup window. 

What I would like to do is:

  • Map Capslock to Shift. Make it a shift key. When I use the remapping suggestions in the Autohotkey help, pressing and holding Capslock and typing aaaaaa gives me Aaaaa, not AAAAA as I would get by pressing and holding Shift.
  • Toggle the capslock function on and off with ^Capslock.

Many thanks...

Living Room / Re: "Half of our users block ads. Now what?"
« on: May 15, 2013, 09:13 PM »
Would it increase your revenue if someone invented an application that would automatically click ads? The app could then discard the results of the click or perhaps place the results (and cookies) in some kind of browser-based sandbox.

Thanks to all for your help. I finally navigated fully the tidy page at sourceforge, and found the gui version, which solved my needs.

Kindly mark this issue SOLVED.

Thanks for the tip. Unfortunately, has no executable for Windows 7, and unfortunately is no longer supported. One can check out the source code, if one happens to have a compiler handy, I guess.

Komodo IDE (hundreds of bucks) has one, and also there are macros for Komodo Edit 7 (free). 

If I get around to writing this app I'll post it here.

Finished Programs / SOLVED: convert html tags/attributes to lowercase
« on: September 02, 2012, 11:59 AM »
The problem I need to solve is this: I have lot of books that I have typeset in Framemaker 5.5.6, Pagemaker 7, or Word format.  I need t o convert them to e-books: mobi, epub, etc format. I will be using calibre.exe for the conversion. E-book source is always in html. I want to use proper html/css programming so that there is a uniformity to the look & feel of the e-publications.

All of the word processing apps have an “export to html” function. Trouble is, the output html is all upper case, e.g., <P ALIGN="center">. I like to code web pages so that they comply with xhtml 1.0 strict, which means no upper case tags or attributes, among other things. (No ALIGN attribute, for instance!)

I have in mind a little app that would rest on the desktop, that I could drag and drop a file onto. Something like the good old DOS2UNIX.exe that converts line endings from CRLF to LF. No GUI, in other words.

I have started working on a little autohotkey app, but I''m not so skilled. (If someone would just help me with the code, I would be very grateful!) The code I have so far is copied below, but I consider it to be pseudocode rather than actual code.

BTW, this is exactly the type of app that is best written in assembler, because it's so simple. Why didn't anybody think of it before? --Google searches don't even come close. 

Logic, in brief:
Set a couple of boolean variables to false, and a pointer to 0
Scan through the file byte by byte looking for "<"   ** NOTE
If found, go into conversion mode, lowercase everything
if converting, and next character is " quote mark, temporarily stop converting
on second " quote mark, resume converting
until ">" is found
until EOF

** Since the source file is output from a word processor, all instances of “<” etc are automatically converted to their html codes &lt; etc, so any “<” encountered will have to be the start of an html tag.

------------------------------------ code follows

; maxmem default = 64 MB. Inputfile must be less than 64MB

filecopy, test-case.html, test-case.bak, 1 ; overwrite any existing bak file
filegetsize, FSize, test-case.html             ; test-case.html is my test file
; msgbox, "Size is "%FSize%

Ptr = 0       ; pointer to character position in BigStr
InMarkup = 0  ; false
QuoStr = 0    ; false
TChar =       ; temp char to hold bigstr character

fileread, BigStr, test-case.html
FSize := StrLen(BigStr)
; msgbox Outside loop. Filesize: %FSize% Ptr: %Ptr%     ; for debugging
if not errorlevel
;  msgbox Not errorlevel              ; for debugging
  loop while (%Ptr% < %FSize%)
    msgbox In loop while...          ; for debugging
    if (InMarkup)
      if (!QuoStr)
          if (TChar >= "A" && TChar <= "Z") {
            BigStr%Ptr% := %TChar%+32 }
          if (TChar==34) {
            QuoStr:=1  }
          if (TChar= ">") {
            InMarkup:=0 }
      if (TChar==34) {
        QuoStr:=0 }
        if (TChar = "<" && BigStr%Ptr%+1<>"!") {
          InMarkup:=1 }
  FileDelete, test-case.html
  FileAppend, %BigStr%, test-case.html
  BigStr =  ; Free the memory.

------------------------------------ code ends

PNG, converted to 256 colors *without* dithering. Disable background images before taking screenshot.

This dithering/anti-aliasing thing is a problem.  When creating images for print presentation, dithering causes unwanted effects in the final output.  This occurs in any area on the graphic that has a smooth blend of colors, such as Dark-blue fading to Light-blue, as in title bars on dialog boxes in Win 2K, or the 3D ("plastic") title bar in Win XP and beyond.  For regular photographs, this presents no problem. But for screen captures of dialog boxes with text areas, the output is not so good when viewed onscreen, and still worse when printed. You end up with moiré patterns.

The effect is also pronounced in text. Anti-aliasing creates a very fuzzy outline.

To get a non-dithered image, save it as a PNG, at 256 colors, as mentioned by  f0dder above.  You can also save it as a GIF with the same format. Or even BMP. The PNG can be marginally smaller than GIF. But some older page formatting software can’t handle PNG.

To get non-aliased text, turn off the “smooth edges of screen fonts” in My Computer > Properties > Advanced > Settings.  And in Display Properties > Appearance > Effects, un-check the “use the following methods to smooth screen fonts.”

Love this app!  :Thmbsup:

I don’t know if this is a bug, but. . .  All my screen caps are dithered. The colors on captured image kind of blend into the surrounding color.  I think this is called “anti-aliasing”.  And blended colors are often dithered with random nearby pixels set to another, similar color.  Well, this is OK for onscreen viewing, I suppose (I don’t care for it, though), but it makes for very fuzzy images when they are used for print.

I’m creating a help manual that will be delivered in PDF format which will enable it to be both printed and viewed onscreen.  In any kind of zoomed view, the graphics are not sharp.

How can I turn off the anti-aliasing and dithering features in order to get  a sharp image for print reproduction?

(BTW I have dithering turned OFF in IrfanView.)



I find the use of a shortcut bar, even with lots of submenus, much faster to navigate than the Start menu. I use old MS Office (97) shortcut bar. 

Being greedy for desktop space (because I often have a half-dozen or more apps up and running, I have formerly put the Office shortcut bar into the title bar area. Even so, this blocks the control buttons on some windows or the extended information in the title bar in others.

If I simply hide the shortcut bar, I'm always tripping it when I run the cursor to the top menu of an app.

Could  that nifty run-and-hide macro be modified to hide/restore the MS Office Shortcut bar?

I would be ever so grateful!


using autohotkey.exe, I have assigned skrommel’s runandhide to a hotkey — the right Winkey, actually — which hides and locks the taskbar.  I use it all the time.

Very simple to put the existing run and hide code between a hotkey assignment and a return statement.
 {run and hide code }

Why couldn’t the list view look like a spreadsheet, where one cell may span many lines?  That way it would still sort properly, but the view would still look and act more or less like the standard list view. There could be options to turn on and off grid lines, as well as whether to show multiple-line entries or truncate them.

Post New Requests Here / Silent msgbox() popup in VBA for Word
« on: May 06, 2010, 09:08 AM »
I write lots of VBA applications in the course of my work.  Often I use a msgbox() function, with buttons Yes, No, Cancel, to get a 3-way selection, e.g.,

Select case msgbox("Are you Hot (yes), Cold (no), or Lukewarm (cancel)", VBYesNoCancel)
   case vbyes :  <some code>
   case vbno :  <some code>
   case vbcancel :  <some code>
end select

Trouble is, looping through a long document causes the message box to pop up dozens of times, severely annoying my co-workers and driving me crazy. 

I know I can turn off the notification sound in the Control Panel.  How about writing a little app that could be called from VBA, that would turn on/turn off the sound?  My VBA code would then look like this:

   x = shell ("c:\utils\soundoff.exe off")
  < a little timer delay >
   messgebox ( ) parsing
   x = shell ("c:\utils\soundoff.exe on")

The shell function in VBA returns a value, 0 if no problem, or the program ID otherwise, which is why I have the dummy parameter variable x. 

One can set/reset the sounds in the registry, but I wonder if it is tempting fate to write/rewrite the registry...

How about simply muting the speakers for a moment while the messgebox come up?

BTW I'm running Windows XP HE, but I have Vista and 98 also.


Dear coders,

For reasons of security and privacy I start my Windows XP with the login screen. No auto-login.  I would like to use AHK to write an app that would run (once) at boot time, that is, at or before the appearance of the login screen.

Could anyone give me tips on how to do this? 



Thoughts, everybody?

See reply #140. I'm still wondering what all the fuss is about; boot snooze can not work for me; why do I have to log in, just to see the boot snooze window?  Faster to press Windows, U, H and be done with it.

Mouser, thank you for the program; nonetheless it is absolutely useless (for me) as is.  Here’s what I normally do (without boot snooze).

Press Windows, then U, then H. (I then walk away and forget it.)  Or, to shutdown completely, Win, U, S. Or, to restart, Win, U, R. 

What I want to do using bootsnooze:
Press Windows, U.  The Logout screen appears.
Press Z (or some other hotkey): The boot snooze operation begins, and I can walk away and forget it. 

None of this having to wait for the login screen, logging in, THEN selecting Hibernate.  Heck, I can do the same thing much faster from the keyboard! (Type Win, U, R, then wait for the login screen; then click Turn Off, followed by H.  Don’t even need to log in.) 

Pages: [1]