ASKER
#include <MsgBoxConstants.au3>
;Assign sidebar.exe path to variable
Local $sSidebarPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\sidebar.exe\", "")
If $sSidebarPath <> "" Then
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is installed at:" & @CRLF & $sSidebarPath)
Else
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is not installed." & @CRLF & "Sidebar path is : " & $sSidebarPath)
EndIf
ASKER
ASKER
if (condition1) {
block of code to be executed if condition1 is true
} else if (condition2) {
block of code to be executed if the condition1 is false and condition2 is true
} else {
block of code to be executed if the condition1 is false and condition2 is false
}
If @OSArch = "X64" Then
;Do Something for 64bit machines
Else
;Do Something for 32bit machines
; Insufficient Else detection code as could also reference "IA64" bit (DORON)
#include <MsgBoxConstants.au3>
If @OSArch = "X64" Then
;Do Something for 64 bit machines
MsgBox($MB_SYSTEMMODAL, "condition1 is true", "64 bit version Detected !", 10)
ElseIf @OSArch = "IA64" Then
;Do Something for IA64 bit machines
MsgBox($MB_SYSTEMMODAL, "condition1 is false and condition2 is true", "IA64 bit version Detected !", 10)
Else
;Do Something for 32 bit machines
MsgBox($MB_SYSTEMMODAL, "condition1 is false and condition2 is false", "32 bit version Detected !", 10)
EndIf
WinSet, AlwaysOnTop, On, ahk_class SideBar_HTMLHostWindow
ASKER
#include <MsgBoxConstants.au3>
#include <AutoItConstants.au3>
;Load the sidebar and get the handle
Local $hSidebar = LoadSideBar()
If Not $hSidebar Then
MsgBox($MB_SYSTEMMODAL, "", "Sidebar handle ERR: " & @error)
Else
MsgBox($MB_SYSTEMMODAL, "", "Sidebar handle OK: " & $hSidebar)
;Set sidebar to topmost
SidebarTopMost($hSidebar)
EndIf
Func LoadSidebar()
Local $sPath = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\sidebar.exe", "")
Local $sProgramFiles = EnvGet("PROGRAMFILES")
Local $sProgramFilesX86 = EnvGet("PROGRAMFILES(X86)")
If Not ProcessExists("[CLASS:SideBar_HTMLHostWindow]") Then
;AutoIT seems to have a problem expanding the registry value since it is
;surrounded by quotes, easier to just replace the text.
If StringInStr($sPath, "%ProgramFiles(x86)%", 2) > 0 Then
$sPath = StringReplace($sPath, "%ProgramFiles(x86)%", $sProgramFilesX86, 0, 2)
ElseIf StringInStr($sPath, "%ProgramFiles%", 2) > 0 Then
$sPath = StringReplace($sPath, "%ProgramFiles%", $sProgramFiles, 0, 2)
EndIf
Run($sPath, "", @SW_SHOW)
WinWait("[CLASS:SideBar_HTMLHostWindow]", "", 5.5)
EndIf
Return WinGetHandle("[CLASS:SideBar_HTMLHostWindow]")
EndFunc
Func SidebarTopMost($hWnd)
Local $iState = WinGetState($hWnd)
If @error <> 0 Then
MsgBox($MB_SYSTEMMODAL, "", "Sidebar has no window. Error: " & @error)
Else
MsgBox($MB_SYSTEMMODAL, "", "Sidebar has a window. State is: " & $iState)
EndIf
If WinActivate($hWnd) Then
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is active.")
Else
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is not active. Error: " & @error)
EndIf
If WinSetOnTop($hWnd, "", $WINDOWS_ONTOP) Then
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is topmost.")
Else
MsgBox($MB_SYSTEMMODAL, "", "Sidebar is not topmost. Error: " & @error)
EndIf
EndFunc
;-----------------
ASKER
#SingleInstance, Force
F5::
MsgBox MdM Zinc 3 Window AlwaysOnTop is to be set to 'On' (Mode)
;
;---------------------------------------------------------------------
WinSet, AlwaysOnTop, On, ahk_class MDMZINC3WINDOW
;---------------------------------------------------------------------
;
#SingleInstance, Force
F5::
MsgBox MdM Zinc 3 Window AlwaysOnTop is to be set to 'On' (Mode)
;
;---------------------------------------------------------------------
WinActivate, ahk_class MDMZINC3WINDOW
;---------------------------------------------------------------------
WinSet, AlwaysOnTop, On, ahk_class MDMZINC3WINDOW
;---------------------------------------------------------------------
;
ASKER
ASKER
ASKER
ASKER
A scripting language is a programming language that supports scripts, programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Scripting languages are often interpreted (rather than compiled). Primitives are usually the elementary tasks or API calls, and the language allows them to be combined into more complex programs. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), embedded systems, as well as numerous games. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language.
TRUSTED BY
You mention that FileExists is important to you. Is it important because you want to ensure that Windows Sidebar is installed? What is the end goal here?
-saige-