Skip to content

Instantly share code, notes, and snippets.

@kayaked
Created January 22, 2018 22:12
Show Gist options
  • Save kayaked/9af27f748675b833e91d25eff88377d5 to your computer and use it in GitHub Desktop.
Save kayaked/9af27f748675b833e91d25eff88377d5 to your computer and use it in GitHub Desktop.
Custom Window Theme with HTA
<HTA:APPLICATION ID="customheader"
applicationname="customheader"
border="dialog"
maximizebutton="no"
minimizebutton="no"
singleinstance="no"
scroll="no"
caption="no"
innerborder="no"
showintaskbar="yes"
sysmenu="no"
selection="no"
windowstate="normal" />
<html><head>
<style>
#bg_image {
width: 100%;
height: 100%;
right: 5px;
bottom:5px;
position: absolute;
z-index: 0;
}
</style>
<script type="text/javascript">
var xPreviously = 0;
var yPreviously = 0;
var mousedown=0;
function doCoords(event) {
mousedown=1;
}
function mouseUpward() {
mousedown=0;
}
window.resizeTo(170,190);
function beginToday(event) {
var x = event.clientX;
var y = event.clientY;
if(mousedown==1) {
window.moveTo((window.screenLeft+x)-xPreviously,(window.screenTop+y)-yPreviously);
} else {
xPreviously = event.clientX;
yPreviously = event.clientY;
}
}
function reloadThing() {
}
function closeWindow() {
window.close();
}
//credit to w3schools for being a bro for most of this
</script>
<title>Octoglomm</title>
</head>
<body background="https://i.imgur.com/oDw09RG.jpg" style="border-style:solid;border-color:gray;border-width:3px;">
<div onmouseout="mouseUpward(event)" onmouseup="mouseUpward(event)" onmousemove="beginToday(event)" onmousedown="doCoords(event)" style="display:inline-block;border-style:none none solid none;border-color:gray;border-width:3px;background-color:#d3d3d3;width:170;height:20;position:absolute;left:0px;top:0px;">
<button style="display:inline-block;float:left;margin: 3px;background-color:red;border:none;color:white;position:relative;top:-3px;text-align:center;text-decoration:none;display:inline-block;padding: 3px 4px;" onclick="closeWindow()">X</button>
<p style="display:inline-block;float:left;margin:3px;text-align:center;width:110px;font-family:Consolas">Octoglomm</p>
</div></body></html>
@kayaked
Copy link
Author

kayaked commented Jan 22, 2018

i know my indenting is bad also but i don't care as long as it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment