#include "Trans.h"
#include "new.h"
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK SubClassWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK HookCallWndProc(int nCode, WPARAM wParam, LPARAM lParam);
HINSTANCE g_hInst;
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance
,LPSTR lpszCmdParam,int nCmdShow)
{
g_hInst=hInstance;
HWND hWnd;
MSG Message;
WNDCLASS WndClass;
LPSTR lpszClass="Trans";
HACCEL hAccelTable;
WndClass.cbClsExtra=0;
WndClass.cbWndExtra=0;
WndClass.hbrBackground=(HBRUSH)GetStockObject(NULL_BRUSH);
WndClass.hCursor=LoadCursor(NULL,IDC_ARROW);
WndClass.hIcon=LoadIcon(g_hInst,MAKEINTRESOURCE(IDR_MAINFRAME));
WndClass.hInstance=hInstance;
WndClass.lpfnWndProc=(WNDPROC)WndProc;
WndClass.lpszClassName=lpszClass;
WndClass.lpszMenuName=MAKEINTRESOURCE(IDR_MAINFRAME);
WndClass.style=CS_HREDRAW | CS_VREDRAW;
RegisterClass(&WndClass);
hWnd=CreateWindow(lpszClass,"Tarnsparent Menu",WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,
NULL,(HMENU)NULL,hInstance,NULL);
ShowWindow(hWnd,nCmdShow);
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDR_MAINFRAME);
while(GetMessage(&Message,0,0,0)) {
if(!TranslateAccelerator(Message.hwnd, hAccelTable, &Message)) {
TranslateMessage(&Message);
DispatchMessage(&Message);
}
}
return Message.wParam;
}
// Main Frame Window
LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
static HWND hEdit;
static HWND hState;
static HHOOK hHookID;
switch(iMessage) {
case WM_COMMAND:
// Parse the menu selections:
switch (LOWORD(wParam)) {
case IDM_ABOUT:
DialogBox(g_hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About);
break;
case IDM_FILE_EXIT:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd,iMessage,wParam,lParam);
}
return 0;
case WM_SIZE:
SendMessage(hState, WM_SIZE, wParam, 0);
RECT rect;
GetClientRect(hWnd,&rect);
rect.bottom-=20+rect.top;
MoveWindow(hEdit,rect.left,rect.top,rect.right,rect.bottom,TRUE);
return 0;
case WM_CREATE:
hHookID = SetWindowsHookEx(WH_CALLWNDPROC, HookCallWndProc,
0,GetWindowThreadProcessId(hWnd,0));
InitCommonControls();
hState=CreateStatusWindow(WS_CHILD | WS_VISIBLE, "", hWnd,0);
hEdit=CreateWindowEx(WS_EX_CLIENTEDGE, "edit",NULL,WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_HSCROLL | WS_VSCROLL,
0,0,0,0,hWnd,(HMENU)NULL,g_hInst,NULL);
return 0;
case WM_DESTROY:
if(hHookID!=0)
UnhookWindowsHookEx(hHookID);
PostQuitMessage(0);
return 0;
}
return(DefWindowProc(hWnd,iMessage,wParam,lParam));
}
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
EndDialog(hDlg,0);
return TRUE;
}
return TRUE;
}
return FALSE;
}
LRESULT CALLBACK HookCallWndProc(int nCode, WPARAM wParam, LPARAM lParam)
{
CWPSTRUCT cwps;
LONG lRet;
if( nCode == HC_ACTION )
{
CopyMemory(&cwps, (LPVOID)lParam, sizeof(CWPSTRUCT));
switch(cwps.message)
{
case WM_CREATE:
{
CHAR szClass[128];
GetClassName(cwps.hwnd, szClass, 127);
if(lstrcmpi(szClass, "#32768")==0)
{
lRet = SetWindowLong(cwps.hwnd, GWL_WNDPROC, (LONG)SubClassWndProc);
SetProp(cwps.hwnd, "OldWndProc", (HANDLE)lRet);
}
}
break;
}
}
return CallNextHookEx((HHOOK)WH_CALLWNDPROC, nCode, wParam, lParam);
}
LRESULT CALLBACK SubClassWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LONG lRet = (LONG) GetProp(hWnd, (LPCSTR)"OldWndProc");
//LONG dwStyle;
switch(uMsg)
{
case WM_CREATE:
/*dwStyle = GetWindowLong(hWnd, GWL_STYLE);
dwStyle &= ~WS_BORDER;
SetWindowLong(hWnd, GWL_STYLE, dwStyle);
dwStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
dwStyle &= ~WS_EX_WINDOWEDGE;
dwStyle &= ~WS_EX_DLGMODALFRAME;
SetWindowLong(hWnd, GWL_EXSTYLE, dwStyle);*/
MakeWndTrans(hWnd);
break;
case WM_DESTROY:
RemoveProp(hWnd, "OldWndProc");
SetWindowLong(hWnd, GWL_WNDPROC, lRet);
break;
}
return CallWindowProc((WNDPROC)lRet, hWnd, uMsg, wParam, lParam);
}
没有合适的资源?快使用搜索试试~ 我知道了~
透明MENU,SDK编写
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共21个文件
h:3个
pdb:2个
opt:1个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
![star](https://csdnimg.cn/release/downloadcmsfe/public/img/star.98a08eaa.png)
温馨提示
透明MENU,这个是SDK编写的,本人不会使用,希望下载后会使用的朋友,留下笔迹,说说使用方法了呵呵
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![slx](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/EXE.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/TXT.png)
共 21 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
- jiucaitian2012-09-27这个是通过钩子够到菜单后setlayeredwindowattributes弄的,效果还可以
![avatar](https://profile-avatar.csdnimg.cn/6e5cf0d12a5a4e369778262f6b629bff_menfolk_odon.jpg!1)
menfolk_odon
- 粉丝: 14
- 资源: 14
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)