This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires winapi-rs. | |
// Accidentally made this instead of a getOpenPrograms function so just putting it as a gist so it doesn't go to waste. | |
use winapi::{ | |
um::winuser::{EnumWindows, GetWindowTextW} | |
}; | |
static mut windows: Vec<String> = Vec::new(); // Use a static because local variables aren't sent to non-closure functions. | |
unsafe fn getOpenWindows() -> bool { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Program: Lua String Match Func | |
-- Purpose: To help in tokenizers and stuff. This is a pretty tiny function that allows you to match for custom strings (of course it also has perfect escape-character support.) | |
-- Returns number start_pos, number end_pos, string match | |
-- Vurv Update 0.2.0 12/25/2020 | |
-- Make sure quote and escape don't interfere with lua patterns. | |
local function match_str(self,quote,escape,pos) | |
local matched = false | |
local exp = string.format( "^[%s](.-)([%s]-)%s",quote,escape,quote ) | |
local matches = {} |
NewerOlder