Code Monkey home page Code Monkey logo

getdefaulticon's Introduction

GetDefaultIcon(fExt [, getHandle])

AHK Forum Post

Based on a specific use case of the AssocQueryString function.

Searches for and retrieves the default icon for a provided extension and returns a handle to the icon to be used in a picture control or the string to the associated icon path.

More info at MSDN


Params:

  • fExt - File extension to work on with optional . in front e.g.: ahk or .ahk
  • getHandle - instruct the function to either return the handle to a resource or the string to the default executable file

Returns:

  • A Handle to an icon resource (Default)
  • A string to the default executable and icon number for the extension

Examples:

The period is optional when passing the extension

	MsgBox GetDefaultIcon("ahk")
	MsgBox GetDefaultIcon(".ahk")

You can get the path to the default application associated with the extension as well

	for ext in ["ahk", ".html", ".bat", "vbs", ".dll"]
		strings .= GetDefaultIcon(ext, false) '`n'

	MsgBox strings

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.