evc写sp程序 发现对话框是透明的?还有菜单要怎么做?
[复制链接]
#include
#include"resource.h"
#include
#define MAX 256
BOOL CALLBACK Sun(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd )
{
int res;
res=DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)Sun);
return 0;
}
BOOL CALLBACK Sun(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
int res,res2;
HKEY pk;
TCHAR sz[MAX]={0};
DWORD type=REG_SZ;
DWORD szsize=sizeof(sz);
switch(uMsg)
{
case WM_INITDIALOG:
SHINITDLGINFO si;
si.dwMask = SHIDIM_FLAGS;
si.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;
si.hDlg = hwndDlg;
SHInitDialog(&si);
break;
case WM_COMMAND:
switch (wParam)
{
case IDOK:
EndDialog(hwndDlg,WM_COMMAND);
break;
case IDCANCEL:
EndDialog(hwndDlg,WM_COMMAND);
break;
case IDC_BUTTON1:
res=RegOpenKeyEx(HKEY_LOCAL_MACHINE,TEXT("Drivers\\BuiltIn"),0,0,&pk);
if(ERROR_SUCCESS==res)
{
memset(sz,0,256);
res2=RegQueryValueEx(pk,TEXT("dll"),0,&type,(LPBYTE)sz,&szsize);
// MessageBox(hwndDlg,sz,TEXT("CAPTION1"),MB_OK);
HWND hwndcheck=GetDlgItem(hwndDlg,IDC_CHECK1);
if (0==wcscmp(TEXT("RegEnum.dll"),sz))
{
//MessageBox(hwndDlg,sz,TEXT("CAPTION"),MB_OK);
SendMessage(hwndcheck,BM_SETCHECK ,BST_CHECKED,0);
}
else
{
MessageBox(hwndDlg,TEXT("失败1"),TEXT("CAPTION"),MB_OK);
}
}
else
{
MessageBox(hwndDlg,TEXT("失败2"),TEXT("CAPTION1"),MB_OK);
}
break;
default:
break;
}
break;
default:
break;
}
return 1;
}
这个代码。是一个对话框。。用sp2003的sdk写的,,但是运行的时候对话框并不出现,只是几个控件都出现了,,为什么?
还有sp的菜单要怎么编写 怎么出现在对话框上?
谢谢 我是新手,需要大家呵护,3Q