From: ibotrsi
how to make that? im not really good with computers
Compile it.. It will hide Smart and Show smart.. Hotkeys are F9 to hide itself.. F10 to show itself.
Hide Button to hide smart.. Show button to show smart..
I would edit this INTO smart itself as it's only a couple lines long to actually show/hide smart.. but meh.. I'm lazy to find the smart source, edit and recompile..
Compiles with Visual Studio.. The Codeblocks version is below this:
#define WINVER 0x0500
#include <iostream>
#include <windows.h>
#include <vector>
#include <string>
#include <tchar.h>
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df'language='*'\"")
enum {ID_LABEL = 1, ID_HIDE, ID_SHOW};
enum {F9_KEYID = 1, F10_KEYID = 2};
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
HWND Hide, Show, Label;
HINSTANCE g_hInst;
/* Make the class name into a global variable */
LPCWSTR szClassName = L"Hide Windows";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default colour as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_WINDOW;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
WS_EX_TOOLWINDOW | WS_EX_APPWINDOW, /* Extended possibilites for variation */
szClassName, /* Classname */
L"Hide Windows", /* Title Text */
WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
226, /* The programs width */
125, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nCmdShow);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
if ((messages.message == WM_HOTKEY))
{
if (messages.wParam == F9_KEYID)
{
ShowWindow(hwnd, SW_HIDE);
}
else if (messages.wParam == F10_KEYID)
{
ShowWindow(hwnd, SW_SHOW);
}
}
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
//Forward Declaration..
HWND FindWindowPartial(TCHAR const * windowTitle);
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HFONT hFont;
PAINTSTRUCT ps;
HDC hdc;
switch (message) /* handle the messages */
{
case WM_CREATE:
Hide = CreateWindow(L"Button", L"Hide", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 12, 51, 75, 23, hwnd,(HMENU)ID_HIDE, g_hInst, 0);
Show = CreateWindow(L"Button", L"Show", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 123, 51, 75, 23, hwnd, (HMENU)ID_SHOW, g_hInst, 0);
hFont = CreateFont(15, 0, 0, 0, FW_BOLD, 0, true, 0, 0, 0, 0, PROOF_QUALITY, 0, (L"Arial"));
Label = CreateWindowEx(WS_EX_TRANSPARENT, L"STATIC", L"Window Hider", WS_CHILD | WS_VISIBLE | SS_LEFT | WS_SYSMENU , 64, 9, 80, 13, hwnd, (HMENU)ID_LABEL, g_hInst, 0);
SendMessage(Label, WM_SETFONT, (WPARAM)hFont, true);
RegisterHotKey(0, F9_KEYID, 0x4000, VK_F9);
RegisterHotKey(0, F10_KEYID, 0x4000, VK_F10);
break;
case WM_COMMAND:
switch(wParam)
{
case ID_HIDE:
{
HWND Smart = FindWindow(L"SunAwtFrame", L"Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100");
if (Smart != 0)
{
int OldValue = GetWindowLong(Smart, GWL_EXSTYLE);
int NewOldValue = SetWindowLong(Smart, GWL_EXSTYLE, OldValue | WS_EX_LAYERED);
SetLayeredWindowAttributes(Smart, 0, 0, LWA_ALPHA);
}
break;
}
case ID_SHOW:
{
HWND Smart = FindWindow(L"SunAwtFrame", L"Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100");
if (Smart != 0)
{
int OldValue = GetWindowLong(Smart, GWL_EXSTYLE);
int NewOldValue = SetWindowLong(Smart, GWL_EXSTYLE, OldValue | WS_EX_LAYERED);
SetLayeredWindowAttributes(Smart, 0, 255, LWA_ALPHA);
}
break;
}
}
break;
case WM_CTLCOLORSTATIC:
{
//SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC) wParam, RGB(148, 0, 211)); //PURPLE
SetBkColor((HDC) wParam, RGB(240, 240, 240)); //COLOR_WINDOW
return (INT_PTR)(HBRUSH)GetStockObject(WHITE_BRUSH);
}
break;
case WM_PAINT:
hdc = BeginPaint(hwnd,&ps);
//HBRUSH NewColor;
//SetTextColor(hDC, RGB(255, 0, 255));
//TextOut(hDC, 50, 42, "Meh", 13);
//NewColor = CreateSolidBrush(RGB(250, 25, 5));
//SelectObject(hDC, NewColor);
//DeleteObject(NewColor);
EndPaint(hwnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
struct FindWindowData
{
FindWindowData(TCHAR const * windowTitle) : WindowTitle(windowTitle), ResultHandle(0)
{
}
std::basic_string<TCHAR> WindowTitle;
HWND ResultHandle;
};
BOOL CALLBACK FindWindowImpl(HWND hWnd, LPARAM lParam)
{
FindWindowData * p = reinterpret_cast<FindWindowData*>(LongToPtr(lParam));
if(!p)
{
// Finish enumerating we received an invalid parameter..
return FALSE;
}
int length = GetWindowTextLength(hWnd) + 1;
if(length > 0)
{
std::vector<TCHAR> buffer(size_t(length), 0);
if(GetWindowText(hWnd, &buffer[0], length))
{
if(_wcsnicmp(&buffer[0], p->WindowTitle.c_str(), min(buffer.size(), p->WindowTitle.size())) == 0)
{
p->ResultHandle = hWnd;
// Finish enumerating we found what we need..
return FALSE;
}
}
}
// Continue enumerating
return TRUE;
}
HWND FindWindowPartial(TCHAR const * windowTitle)
{
if(!windowTitle)
{
SetLastError(ERROR_INVALID_PARAMETER);
return 0;
}
FindWindowData data(windowTitle);
if(!EnumWindows(FindWindowImpl, PtrToLong(&data)) && data.ResultHandle != 0)
{
SetLastError(ERROR_SUCCESS);
return data.ResultHandle;
}
// Return ERROR_FILE_NOT_FOUND in GetLastError
SetLastError(ERROR_FILE_NOT_FOUND);
return 0;
}
Compiles with CodeBlocks:
#define WINVER 0x0500
#include <iostream>
#include <windows.h>
enum {ID_LABEL = 1, ID_HIDE, ID_SHOW};
enum {F9_KEYID = 1, F10_KEYID = 2};
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
HWND Hide, Show, Label;
HINSTANCE g_hInst;
/* Make the class name into a global variable */
char szClassName[ ] = "Hide Windows";
int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */
/* The Window structure */
wincl.hInstance = hThisInstance;
wincl.lpszClassName = szClassName;
wincl.lpfnWndProc = WindowProcedure; /* This function is called by windows */
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof (WNDCLASSEX);
/* Use default icon and mouse-pointer */
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL; /* No menu */
wincl.cbClsExtra = 0; /* No extra bytes after the window class */
wincl.cbWndExtra = 0; /* structure or the window instance */
/* Use Windows's default colour as the background of the window */
wincl.hbrBackground = (HBRUSH) COLOR_WINDOW;
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl))
return 0;
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Hide Windows", /* Title Text */
WS_EX_TOOLWINDOW| WS_SYSMENU, /* default window */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
226, /* The programs width */
125, /* and height in pixels */
HWND_DESKTOP, /* The window is a child-window to desktop */
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
/* Make the window visible on the screen */
ShowWindow (hwnd, nCmdShow);
/* Run the message loop. It will run until GetMessage() returns 0 */
while (GetMessage (&messages, NULL, 0, 0))
{
if ((messages.message == WM_HOTKEY))
{
if (messages.wParam == F9_KEYID)
{
ShowWindow(hwnd, SW_HIDE);
}
else if (messages.wParam == F10_KEYID)
{
ShowWindow(hwnd, SW_SHOW);
}
}
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}
/* This function is called by the Windows function DispatchMessage() */
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HFONT hFont;
PAINTSTRUCT ps;
HDC hdc;
switch (message) /* handle the messages */
{
case WM_CREATE:
Hide = CreateWindow("Button", "Hide", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 12, 51, 75, 23, hwnd,(HMENU)ID_HIDE, g_hInst, 0);
Show = CreateWindow("Button", "Show", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 123, 51, 75, 23, hwnd, (HMENU)ID_SHOW, g_hInst, 0);
hFont = CreateFont(15, 0, 0, 0, FW_BOLD, 0, true, 0, 0, 0, 0, PROOF_QUALITY, 0, ("Arial"));
Label = CreateWindowEx(WS_EX_TRANSPARENT, "STATIC", "Window Hider", WS_CHILD | WS_VISIBLE | SS_LEFT | WS_SYSMENU , 64, 9, 80, 13, hwnd, (HMENU)ID_LABEL, g_hInst, 0);
SendMessage(Label, WM_SETFONT, (WPARAM)hFont, true);
RegisterHotKey(0, F9_KEYID, 0x4000, VK_F9);
RegisterHotKey(0, F10_KEYID, 0x4000, VK_F10);
break;
case WM_COMMAND:
switch(wParam)
{
case ID_HIDE:
{
HWND Smart = FindWindow("SunAwtFrame", "Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100");
if (Smart != 0)
{
int OldValue = GetWindowLong(Smart, GWL_EXSTYLE);
int NewOldValue = SetWindowLong(Smart, GWL_EXSTYLE, OldValue | WS_EX_LAYERED);
SetLayeredWindowAttributes(Smart, 0, 0, LWA_ALPHA);
}
break;
}
case ID_SHOW:
{
HWND Smart = FindWindow("SunAwtFrame", "Public SMARTv6.9 - SMART Minimizing Autoing Resource Thing - By BenLand100");
if (Smart != 0)
{
int OldValue = GetWindowLong(Smart, GWL_EXSTYLE);
int NewOldValue = SetWindowLong(Smart, GWL_EXSTYLE, OldValue | WS_EX_LAYERED);
SetLayeredWindowAttributes(Smart, 0, 0, LWA_ALPHA);
}
break;
}
}
break;
case WM_CTLCOLORSTATIC:
{
//SetBkMode((HDC)wParam, TRANSPARENT);
SetTextColor((HDC) wParam, RGB(148, 0, 211)); //PURPLE
SetBkColor((HDC) wParam, RGB(240, 240, 240)); //COLOR_WINDOW
return (INT_PTR)(HBRUSH)GetStockObject(WHITE_BRUSH);
}
break;
case WM_PAINT:
hdc = BeginPaint(hwnd,&ps);
//HBRUSH NewColor;
//SetTextColor(hDC, RGB(255, 0, 255));
//TextOut(hDC, 50, 42, "Meh", 13);
//NewColor = CreateSolidBrush(RGB(250, 25, 5));
//SelectObject(hDC, NewColor);
//DeleteObject(NewColor);
EndPaint(hwnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}