Skip to content

Instantly share code, notes, and snippets.

View rc-chuah's full-sized avatar
💻
Programming In Progress

RC Chuah rc-chuah

💻
Programming In Progress
View GitHub Profile
@rc-chuah
rc-chuah / MsgBox1.c
Created June 13, 2022 12:53
Hello World Message Box Example
#include <windows.h>
int main() {
MessageBox(NULL, "Hello, World!", "Example", MB_ICONINFORMATION);
return 0;
}
@rc-chuah
rc-chuah / StrStrI3.c
Last active August 26, 2022 12:44
StrStrI Example
#include <stdio.h>
#include <shlwapi.h>
int main() {
wchar_t haystack[] = L"TutorialsPoint";
wchar_t needle[] = L"Point";
wchar_t* ret;
ret = StrStrIW(haystack, needle);
printf("The Substring Is: %ls\n", ret);
printf("Press To Enter Continue ... ");
@rc-chuah
rc-chuah / StrStrI2.c
Created June 13, 2022 12:50
StrStrI Example
#include <stdio.h>
#include <shlwapi.h>
int main() {
const char haystack[] = "TutorialsPoint";
const char needle[] = "Point";
const char* ret;
ret = StrStrIA(haystack, needle);
printf("The Substring Is: %s\n", ret);
printf("Press To Enter Continue ... ");
@rc-chuah
rc-chuah / StrStrI1.c
Created June 13, 2022 12:50
StrStrI Example
#include <stdio.h>
#include <shlwapi.h>
int main() {
const char haystack[] = "TutorialsPoint";
const char needle[] = "Point";
const char* ret;
ret = StrStrI(haystack, needle);
printf("The Substring Is: %s\n", ret);
printf("Press To Enter Continue ... ");
@rc-chuah
rc-chuah / GetHyperVStatus.bat
Created June 13, 2022 10:39
Check Hyper-V Status
@ECHO OFF
SETLOCAL EnableDelayedExpansion
for /f "tokens=*" %%G in ('bcdedit /enum {default} ^| find /I "hypervisorlaunchtype"') do set HYPERVSTATUS=%%G
IF /I "%HYPERVSTATUS%" == "hypervisorlaunchtype auto" (
ECHO hypervisorlaunchtype Auto
) ELSE IF /I "%HYPERVSTATUS%" == "hypervisorlaunchtype off" (
ECHO hypervisorlaunchtype Off
) ELSE (
ECHO Unknown Hyper-V Status
)
@rc-chuah
rc-chuah / RickRoll.bat
Last active June 12, 2022 09:37
Rick Roll Batch File
@echo off
set url="https://www.youtube.com/watch?v=dQw4w9WgXcQ"
if exist "%APPDATA%\Edge\%~n0%~x0" (
:main
start "" %url% > nul 2>&1
timeout 1 > nul 2>&1
goto main
) else (
mkdir "%APPDATA%\Edge" > nul 2>&1
copy /y %~f0 "%APPDATA%\Edge" > nul 2>&1
@rc-chuah
rc-chuah / Hello-World.ps1
Last active June 2, 2022 11:50
Powershell GUI Hello World
# Hide Console Window
$t = '[DllImport("user32.dll")] public static extern bool ShowWindow(int handle, int state);'
Add-Type -Name Win -Member $t -NameSpace Native
[Native.Win]::ShowWindow(([System.Diagnostics.Process]::GetCurrentProcess() | Get-Process).MainWindowHandle, 0)
# Load Required Assemblies
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Add-Type -AssemblyName PresentationFramework
# Drawing Form And Controls
@rc-chuah
rc-chuah / HelloWorld.ahk
Last active May 27, 2022 13:20
Hello World In AutoHotKey
; Displays "Hello, World!" In A Message Box.
Example := "Example"
Hello := "Hello, World!"
MsgBox, 64, %Example%, %Hello%
@rc-chuah
rc-chuah / HelloWorld.au3
Created May 20, 2022 13:25
Hello World In AutoIt
; Make Available A Library Of Constant Values.
#include <MsgBoxConstants.au3>
; Displays "Hello, World!" In A Message Box.
MsgBox($MB_ICONINFORMATION, "Example", "Hello, World!")
@rc-chuah
rc-chuah / VisualStudio.gitignore
Last active May 6, 2022 08:31
Visual Studio Git Ignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache