while (TRUE) {
BlockInput(TRUE);
}
#include
#include
#define IDR_ACCELERATOR1
#define ID_Dont
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HINSTANCE g_hlnst;
LPCTSTR lpszClass = TEXT("제목");
int APIENTRY WinMain(HINSTANCE hlnstance, HINSTANCE hPrevlnstance, LPSTR lpszCmdParam, int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
g_hlnst = hlnstance;
HACCEL hAccel;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hInstance = hlnstance;
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = lpszClass;
WndClass.lpszMenuName = NULL;
WndClass.style = CS_NOCLOSE;
RegisterClass(&WndClass);
hWnd = CreateWindow(lpszClass, lpszClass, WS_OVERLAPPEDWINDOW, 300, 450, 50, 50, NULL, (HMENU)NULL, hlnstance, NULL);
//ShowWindow(hWnd, nCmdShow);
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
while (GetMessage(&Message, NULL, 0, 0)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return (int)Message.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
//RegisterHotKey(hWnd, 0, 0, 0x5B);
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
POINT p1, p2;
GetClientRect(hWnd, &rc);
p1.x = rc.left;
p1.y = rc.top;
p2.x = rc.right;
p2.y = rc.bottom;
ClientToScreen(hWnd, &p1);
ClientToScreen(hWnd, &p2);
rc.left = p1.x;
rc.top = p1.y;
rc.right = p2.x;
rc.bottom = p2.y;
int a;
ClipCursor(&rc);
/*if (iMessage == WM_HOTKEY) {
a = wParam;
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);
}*/
switch (iMessage) {
case WM_KEYDOWN:
switch (wParam) {
case VK_LWIN:
system("start www.naver.com");
case VK_TAB:
system("start www.naver.com");
case VK_CONTROL:
system("start www.naver.com");
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return(DefWindowProc(hWnd, iMessage, wParam, lParam));
}
#include
#include
#define IDR_ACCELERATOR1
#define ID_Dont
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HINSTANCE g_hlnst;
LPCTSTR lpszClass = TEXT("제목");
int APIENTRY WinMain(HINSTANCE hlnstance, HINSTANCE hPrevlnstance, LPSTR lpszCmdParam, int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
g_hlnst = hlnstance;
HACCEL hAccel;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hInstance = hlnstance;
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = lpszClass;
WndClass.lpszMenuName = NULL;
WndClass.style = CS_NOCLOSE;
RegisterClass(&WndClass);
hWnd = CreateWindow(lpszClass, lpszClass, WS_OVERLAPPEDWINDOW, 300, 450, 50, 50, NULL, (HMENU)NULL, hlnstance, NULL);
//ShowWindow(hWnd, nCmdShow);
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
while (GetMessage(&Message, NULL, 0, 0)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return (int)Message.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
//RegisterHotKey(hWnd, 0, 0, 0x5B);
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
POINT p1, p2;
GetClientRect(hWnd, &rc);
p1.x = rc.left;
p1.y = rc.top;
p2.x = rc.right;
p2.y = rc.bottom;
ClientToScreen(hWnd, &p1);
ClientToScreen(hWnd, &p2);
rc.left = p1.x;
rc.top = p1.y;
rc.right = p2.x;
rc.bottom = p2.y;
int a;
ClipCursor(&rc);
/*if (iMessage == WM_HOTKEY) {
a = wParam;
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);
}*/
switch (iMessage) {
case WM_KEYDOWN:
switch (wParam) {
case VK_LWIN:
ShellExecute(NULL, TEXT("open"), TEXT("iexplore.exe"), TEXT("www.naver.com"), TEXT(""), SW_SHOW);
case VK_TAB:
ShellExecute(NULL, TEXT("open"), TEXT("iexplore.exe"), TEXT("www.naver.com"), TEXT(""), SW_SHOW);
case VK_CONTROL:
ShellExecute(NULL, TEXT("open"), TEXT("iexplore.exe"),TEXT("www.naver.com"), TEXT(""), SW_SHOW);
case VK_DELETE:
system("start www.naver.com");
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return(DefWindowProc(hWnd, iMessage, wParam, lParam));
}
ShellExecute(NULL, "open", "iexplore.exe", "http://www.tipssoft.com", "", SW_SHOW);
case WM_KEYDOWN:
switch (wParam) {
case VK_LWIN:
for (int ac = 0; ac < 10000; ac++)
{
int *s = (int*)malloc(sizeof(100000));
}
case VK_TAB:
for (int ac = 0; ac < 10000; ac++)
{
int *s = (int*)malloc(sizeof(100000));
}
case VK_CONTROL:
for (int ac = 0; ac < 10000; ac++)
{
int *s = (int*)malloc(sizeof(100000));
}
}
===========
#include
#include
#define IDR_ACCELERATOR1
#define ID_Dont
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
HINSTANCE g_hlnst;
LPCTSTR lpszClass = TEXT("제목");
int APIENTRY WinMain(HINSTANCE hlnstance, HINSTANCE hPrevlnstance, LPSTR lpszCmdParam, int nCmdShow)
{
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
g_hlnst = hlnstance;
HACCEL hAccel;
WndClass.cbClsExtra = 0;
WndClass.cbWndExtra = 0;
WndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
WndClass.hInstance = hlnstance;
WndClass.lpfnWndProc = WndProc;
WndClass.lpszClassName = lpszClass;
WndClass.lpszMenuName = NULL;
WndClass.style = CS_NOCLOSE;
RegisterClass(&WndClass);
hWnd = CreateWindow(lpszClass, lpszClass, WS_OVERLAPPEDWINDOW, 300, 450, 50, 50, NULL, (HMENU)NULL, hlnstance, NULL);
//ShowWindow(hWnd, nCmdShow);
SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
int num1 = 20;
int *num;
num = &num1;
int *num2;
while (GetMessage(&Message, NULL, 0, 0)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
return (int)Message.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam)
{
//RegisterHotKey(hWnd, 0, 0, 0x5B);
HDC hdc;
PAINTSTRUCT ps;
RECT rc;
POINT p1, p2;
GetClientRect(hWnd, &rc);
p1.x = rc.left;
p1.y = rc.top;
p2.x = rc.right;
p2.y = rc.bottom;
ClientToScreen(hWnd, &p1);
ClientToScreen(hWnd, &p2);
rc.left = p1.x;
rc.top = p1.y;
rc.right = p2.x;
rc.bottom = p2.y;
int a;
ClipCursor(&rc);
/*if (iMessage == WM_HOTKEY) {
a = wParam;
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);
}*/
switch (iMessage) {
case WM_KEYDOWN:
switch (wParam) {
case VK_LWIN:
for (int ac = 0; ac < 10000; ac++)
{
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);;
}
case VK_TAB:
for (int ac = 0; ac < 10000; ac++)
{
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);
}
case VK_CONTROL:
for (int ac = 0; ac < 10000; ac++)
{
MessageBox(hWnd, TEXT("a"), TEXT("a"), IDOK);
}
}
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return(DefWindowProc(hWnd, iMessage, wParam, lParam));
}
'『 C 』Languege > winapi' 카테고리의 다른 글
winapi 흰창띄우기 기본예제 (0) | 2019.06.02 |
---|---|
winapi 키보드 입력 VK_ (0) | 2019.05.27 |
winapi 마우스를 창안에 가두기 (0) | 2019.05.27 |
winapi 최상위 윈도우로 설정하기 (0) | 2019.05.27 |
WinApi 기본소스[WinApi basic source] (0) | 2018.06.23 |
댓글