Jump to content

Search the Community

Showing results for tags 'gadget'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. well. Reading in msdn I found an interface to run a Gadget. So I wrote it. #include <Array.au3> #include <File.au3> Global Const $sCLSID_DesktopGadget = "{924CCC1B-6562-4C85-8657-D177925222B6}" Global Const $sIID_IDesktopGadget = "{C1646BC4-F298-4F91-A204-EB2DD1709D1A}" Global Const $sTagIDesktopGadget = "RunGadget hresult(wstr);" Global Enum $eNoShared = 1, $eShared, $eAll Local $aGadGets = _GetGadget($eAll) If IsArray($aGadGets) Then For $i = 1 To $aGadGets[0] If StringInStr($aGadGets[$i], "CPU") Then ;Run CPU GadGet RunGadget($aGadGets[$i]) EndIf Next EndIf Func RunGadget($sGadGetPath) Local $oDesktopGadget = ObjCreateInterface($sCLSID_DesktopGadget, $sIID_IDesktopGadget, $sTagIDesktopGadget) if not IsObj($oDesktopGadget) then Return False return SUCCEEDED($oDesktopGadget.RunGadget($sGadGetPath)) EndFunc ;==>RunGadget Func _GetGadget($GadgetType = $eNoShared) Local $aNoSharedGadGets = 0 Local $aSharedGadGets = 0 Local $aGadGets = 0 Local $Size = 0 Local Const $sSharedGadget = @ProgramFilesDir & "\Windows Sidebar\Shared Gadgets" Local Const $sNoShared = @ProgramFilesDir & "\Windows Sidebar\Gadgets" If $GadgetType < $eNoShared Or $GadgetType > $eAll Then Return 0 If BitAND($GadgetType, $eNoShared) Then $aNoSharedGadGets = _FileListToArray($sNoShared, Default, Default, True) If BitAND($GadgetType, $eShared) Then $aSharedGadGets = _FileListToArray($sSharedGadget, Default, Default, True) If IsArray($aSharedGadGets) And IsArray($aNoSharedGadGets) Then $Size = UBound($aNoSharedGadGets) - 1 + (UBound($aSharedGadGets) - 1) _ArrayConcatenate($aNoSharedGadGets, $aSharedGadGets, 1) $aGadGets = $aNoSharedGadGets $aGadGets[0] = $Size Else If IsArray($aSharedGadGets) Then $aGadGets = $aSharedGadGets If IsArray($aNoSharedGadGets) Then $aGadGets = $aNoSharedGadGets EndIf $aSharedGadGets = 0;Free $aNoSharedGadGets = 0 ;Free Return $aGadGets EndFunc ;==>_GetGadget Func SUCCEEDED($hr) Return ($hr >= 0) EndFunc ;==>SUCCEEDED Saludos
×
×
  • Create New...